Github user bbende commented on a diff in the pull request:
https://github.com/apache/nifi-registry/pull/10#discussion_r140072829
--- Diff:
nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/repository/BucketRepository.java
---
@@ -14,38 +14,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.nifi.registry.metadata;
+package org.apache.nifi.registry.db.repository;
-import java.util.Set;
+import org.apache.nifi.registry.db.entity.BucketEntity;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.PagingAndSortingRepository;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
/**
- * The metadata for a bucket, along with the metadata about any objects
stored in the bucket, such as flows.
+ * Spring Data Repository for BucketEntity.
*/
-public interface BucketMetadata {
-
- /**
- * @return the identifier of this bucket
- */
- String getIdentifier();
-
- /**
- * @return the name of this bucket
- */
- String getName();
-
- /**
- * @return the timestamp of when this bucket was created
- */
- long getCreatedTimestamp();
-
- /**
- * @return the description of this bucket
- */
- String getDescription();
+public interface BucketRepository extends
PagingAndSortingRepository<BucketEntity,String> {
- /**
- * @return the metadata about the flows that are part of this bucket
- */
- Set<FlowMetadata> getFlowMetadata();
+ @Query("SELECT b FROM BucketEntity b WHERE LOWER(b.name) =
LOWER(:name)")
+ List<BucketEntity> findByName(@Param("name") String name);
--- End diff --
Great idea, I'll update to use that approach
---