Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Fetch a location with the given source and code:
Code Block
java
java
Location location = metadataService.getItem(Location.class, "SOME-SOURCE", "CODE");

...


// should be implemented as: generic <T> getItem(T type, String source, String code);
Fetch all visit types from the given source:
Code Block
java
java
List<VisitType> visitTypes = metadataService.getItems(VisitType.class, "SOME-SOURCE");

...


// should be implemented as: generic <T> getItems(T type, String source);
Fetch all visit types for the given set:
Code Block
java
java
List<VisitType> visitTypes = metadataSerivce
  .getItems(VisitType.class, "SOME-SOURCE", "CODE");

...


// should be implemented as: generic <T> getItems(T type, String source, String code);

...

 
// source = metadataSet.source.name, code = metadataSet.code
Retire term:
Code Block
java
java
List<MetadataTerm> terms = metadataService.getMetadataTerms(location);

...


metadataService.retireMapping(terms.get(0), "some reason");
Create term: 
Code Block
java
java
MetadataSource source = metadataService.getSourceByName("SOME-SOURCE");

...


MetadataTerm term = new MetadataTerm(source, "CODE", location);

...


metadataService.saveMetadataTerm(term);
Create terms in bulk:
Code Block
java
java
List<MetadataTerm> terms = Arrays.asList(mapping1, mapping2, mapping3);

...


metadataService.saveMetadataTerms(terms);
Get term by source and code:

...

Code Block
java
java
MetadataTerm term = metadataService.getMetdataTerm(mappingSource, "CODE");
Get terms by source:
Code Block
java
java
List<MetadataTerm> terms = metadataService.getMetadataTerms(source);
Get term by uuid:

...

Code Block
java
java
MetadataTerm mapping = metadataService.getMetadataTermByUuid(String uuid);
Get source by uuid:

...

Code Block
java
java
MetadataSource source = metadataService.getMetadataSourceByUuid(String uuid);
MetadataTerm, MetadataSource, MetadataSet should support all CRUD operations.

...