*/
@Entity
public class Contact extends VersionableEntity {
+ public Contact() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
static Logger logger = Logger.getLogger(Contact.class);
private String email;
private String url;
private String phone;
private String fax;
- private ArrayList<Address> addresses;
+ private Set<Address> addresses;
- public ArrayList<Address> getAddresses(){
+ public Set<Address> getAddresses(){
return this.addresses;
}
*
* @param addresses addresses
*/
- public void setAddresses(ArrayList<Address> addresses){
+ public void setAddresses(Set<Address> addresses){
this.addresses = addresses;
}
+ public void addAddress(Address address){
+ this.addresses.add(address);
+ }
+ public void removeAddress(Address address){
+ this.addresses.remove(address);
+ }
public String getEmail(){
return this.email;
*/
@Entity
public class Institution extends IdentifiableEntity {
+ public Institution() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
static Logger logger = Logger.getLogger(Institution.class);
//Acronym, code or initialism by which the insitution is generally known
private String code;
private String name;
- private ArrayList<InstitutionType> types;
+ private Set<InstitutionType> types;
private Institution isPartOf;
private Contact contact;
this.contact = contact;
}
- public ArrayList<InstitutionType> getTypes(){
+ public Set<InstitutionType> getTypes(){
return this.types;
}
+ public void addTypes(InstitutionType t){
+ this.types.add(t);
+ }
+ public void removeTypes(InstitutionType t){
+ this.types.remove(t);
+ }
/**
*
* @param types types
*/
- public void setTypes(ArrayList<InstitutionType> types){
+ public void setTypes(Set<InstitutionType> types){
this.types = types;
}
*/
@Entity
public class Person extends IdentifiableEntity {
+ public Person() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
static Logger logger = Logger.getLogger(Person.class);
//e.g. the title
private String prefix;
//suggestion as a flexible String. the form birthdate - deathdate (XXXX - YYYY; XXXX - or - YYYY as appropriate) is
//prefered, or as simple flourished date (fl. XXXX) may be given where that is all that is known
private TimePeriod lifespan;
- private ArrayList<InstitutionalMembership> institutionalMemberships;
+ private Set<InstitutionalMembership> institutionalMemberships;
private Contact contact;
- private ArrayList<PersonInSource> personInSources;
- private ArrayList<Keyword> keywords;
+ private Set<PersonInSource> personInSources;
+ private Set<Keyword> keywords;
- public ArrayList getInstitutionalMemberships(){
+ public Set<InstitutionalMembership> getInstitutionalMemberships(){
return this.institutionalMemberships;
}
*
* @param institutionalMemberships institutionalMemberships
*/
- public void setInstitutionalMemberships(ArrayList institutionalMemberships){
+ public void setInstitutionalMemberships(Set<InstitutionalMembership> institutionalMemberships){
this.institutionalMemberships = institutionalMemberships;
}
- public ArrayList getPersonInSources(){
+ public Set<PersonInSource> getPersonInSources(){
return this.personInSources;
}
-
- /**
- *
- * @param personInSources personInSources
- */
- public void setPersonInSources(ArrayList personInSources){
+ public void addPersonInSource(PersonInSource personInSource){
+ this.personInSources.add(personInSource);
+ }
+ public void removePersonInSource(PersonInSource personInSource){
+ this.personInSources.remove(personInSource);
+ }
+ public void setPersonInSources(Set<PersonInSource> personInSources){
this.personInSources = personInSources;
}
- public ArrayList getKeywords(){
+
+ public Set<Keyword> getKeywords(){
return this.keywords;
}
-
- /**
- *
- * @param keywords keywords
- */
- public void setKeywords(ArrayList keywords){
+ public void setKeywords(Set<Keyword> keywords){
this.keywords = keywords;
}
+ public void addKeyword(Keyword keyword){
+ this.keywords.add(keyword);
+ }
+ public void removeKeyword(Keyword keyword){
+ this.keywords.remove(keyword);
+ }
+
+
public Contact getContact(){
return this.contact;
*/
@Entity
public class Team extends VersionableEntity {
+ public Team() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
static Logger logger = Logger.getLogger(Team.class);
//An abreviated name for the team (e. g. in case of nomenclatural authorteams). A non abreviated name for the team (e. g.
//in case of some bibliographical references)
private String originalCitation;
- private ArrayList teamInSource;
- private ArrayList teamMembers;
+ private Set<TeamInSource> teamInSource;
+ private ArrayList<Person> teamMembers;
- public ArrayList getTeamMembers(){
+ public ArrayList<Person> getTeamMembers(){
return this.teamMembers;
}
*
* @param teamMembers teamMembers
*/
- public void setTeamMembers(ArrayList teamMembers){
+ public void setTeamMembers(ArrayList<Person> teamMembers){
this.teamMembers = teamMembers;
}
- public ArrayList getTeamInSource(){
+ public Set<TeamInSource> getTeamInSource(){
return this.teamInSource;
}
-
- /**
- *
- * @param teamInSource teamInSource
- */
- public void setTeamInSource(ArrayList teamInSource){
+ public void setTeamInSource(Set<TeamInSource> teamInSource){
this.teamInSource = teamInSource;
}
+ public void addTeamInSource(TeamInSource teamInSource){
+ this.teamInSource.add(teamInSource);
+ }
+ public void removeTeamInSource(TeamInSource teamInSource){
+ this.teamInSource.remove(teamInSource);
+ }
+
public String getOriginalCitation(){
return this.originalCitation;
}
*/
@MappedSuperclass
public abstract class AnnotatableEntity extends VersionableEntity {
+ public AnnotatableEntity() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
static Logger logger = Logger.getLogger(AnnotatableEntity.class);
- private ArrayList<Marker> markers;
- private ArrayList<Annotation> annotations;
+ private Set<Marker> markers;
+ private Set<Annotation> annotations;
- public ArrayList<Marker> getMarkers(){
+ public Set<Marker> getMarkers(){
return this.markers;
}
}
- public ArrayList<Annotation> getAnnotations(){
+ public Set<Annotation> getAnnotations(){
return this.annotations;
}
}
+ public void setMarkers(Set<Marker> markers) {
+ this.markers = markers;
+ }
+
+ public void setAnnotations(Set<Annotation> annotations) {
+ this.annotations = annotations;
+ }
+
}
\ No newline at end of file
import java.beans.PropertyChangeSupport;
import java.beans.PropertyChangeEvent;
+import javax.persistence.MappedSuperclass;
+
+
public abstract class CdmBase {
+ public CdmBase() {
+ // TODO Auto-generated constructor stub
+ }
private PropertyChangeSupport support = new PropertyChangeSupport(this);
public void addPropertyChangeListener(PropertyChangeListener listener) {
*/
@Entity
public abstract class DefinedTermBase extends VersionableEntity {
+ public DefinedTermBase() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
static Logger logger = Logger.getLogger(DefinedTermBase.class);
//URI used as an ID for the term. In the case of TDWG ontology derived terms the URL to the term!
private String uri;
//The RDF ontology source defining the terms to be loaded when a database is created for the first time. Software can go
//and grap these terms incl labels and description. UUID needed? Furhter vocs can be setup through our own ontology.
private static String initializationClassUri;
- private ArrayList<Representation> representations;
+ private Set<Representation> representations;
private DefinedTermBase kindOf;
- private ArrayList<DefinedTermBase> generalizationOf;
+ private Set<DefinedTermBase> generalizationOf;
private DefinedTermBase partOf;
- private ArrayList<DefinedTermBase> includes;
- private ArrayList<Media> media;
+ private Set<DefinedTermBase> includes;
+ private Set<Media> media;
- public ArrayList<Representation> getRepresentations(){
+ public Set<Representation> getRepresentations(){
return this.representations;
}
-
- /**
- *
- * @param representations representations
- */
- public void setRepresentations(ArrayList representations){
+ public void setRepresentations(Set<Representation> representations) {
this.representations = representations;
}
+ public void addRepresentation(Representation representation) {
+ this.representations.add(representation);
+ }
+ public void removeRepresentation(Representation representation) {
+ this.representations.remove(representation);
+ }
+
public DefinedTermBase getKindOf(){
return this.kindOf;
}
this.kindOf = kindOf;
}
- public ArrayList<DefinedTermBase> getGeneralizationOf(){
+ public Set<DefinedTermBase> getGeneralizationOf(){
return this.generalizationOf;
}
*
* @param generalizationOf generalizationOf
*/
- public void setGeneralizationOf(ArrayList generalizationOf){
+ public void setGeneralizationOf(Set<DefinedTermBase> generalizationOf) {
this.generalizationOf = generalizationOf;
}
+
public DefinedTermBase getPartOf(){
return this.partOf;
}
this.partOf = partOf;
}
- public ArrayList<DefinedTermBase> getIncludes(){
+ public Set<DefinedTermBase> getIncludes(){
return this.includes;
}
-
- /**
- *
- * @param includes includes
- */
- public void setIncludes(ArrayList includes){
+ public void setIncludes(Set<DefinedTermBase> includes) {
this.includes = includes;
}
+ public void addIncludes(DefinedTermBase includes) {
+ this.includes.add(includes);
+ }
+ public void removeIncludes(DefinedTermBase includes) {
+ this.includes.remove(includes);
+ }
+
- public ArrayList<Media> getMedia(){
+ public Set<Media> getMedia(){
return this.media;
}
-
- /**
- *
- * @param media media
- */
- public void setMedia(ArrayList media){
+ public void setMedia(Set<Media> media) {
this.media = media;
}
+ public void addMedia(Media media) {
+ this.media.add(media);
+ }
+ public void removeMedia(Media media) {
+ this.media.remove(media);
+ }
+
public String getUri(){
return this.uri;
}
/**
* This class aims to make available more "attributes" for identifiable entities
* in a flexible way. Application developers (and even users) can define their own
- * "attrributes" as an ExtensionType and add data to Identifiable instances via
+ * "attributes" as an ExtensionType and add data to Identifiable instances via
* Extension instances.
* @author m.doering
* @version 1.0
static Logger logger = Logger.getLogger(Extension.class);
private String value;
private ExtensionType type;
+ private IdentifiableEntity identifiableEntity;
+ @ManyToOne
public ExtensionType getType(){
return this.type;
}
*/
@MappedSuperclass
public abstract class IdentifiableEntity extends AnnotatableEntity {
+ public IdentifiableEntity() {
+ super();
+ }
+
static Logger logger = Logger.getLogger(IdentifiableEntity.class);
private String lsid;
private String titleCache;
//if true titleCache will not be automatically generated/updated
- private boolean hasProtectedTitleCache;
- private ArrayList<Rights> rights;
- private ArrayList<Extension> extensions;
+ private boolean protectedTitleCache;
+ private Set<Rights> rights;
+ private Set<Extension> extensions;
public String getLsid(){
return this.lsid;
public abstract String generateTitle();
public String getTitleCache(){
- if (hasProtectedTitleCache){
+ if (protectedTitleCache){
return this.titleCache;
}
// is title dirty, i.e. equal NULL?
*/
public void setTitleCache(String titleCache){
this.titleCache = titleCache;
- this.setHasProtectedTitleCache(true);
+ this.setProtectedTitleCache(true);
}
- /**
- *
- * @param hasProtectedTitleCache hasProtectedTitleCache
- */
- public void setHasProtectedTitleCache(boolean hasProtectedTitleCache){
- this.hasProtectedTitleCache = hasProtectedTitleCache;
- }
-
- public boolean hasProtectedTitleCache(){
- return false;
+ @OneToMany
+ public Set<Rights> getRights(){
+ return this.rights;
}
-
-public ArrayList<Rights> getRights(){
- return this.rights;
+ public void setRights(Set<Rights> rights) {
+ this.rights = rights;
}
/**
* @param right
*/
public void addRights(Rights right){
-
+ this.rights.add(right);
}
/**
* @param right
*/
public void removeRights(Rights right){
-
+ this.rights.remove(right);
}
- public ArrayList<Extension> getExtensions(){
+ @OneToMany(mappedBy="identifiableEntity")
+ public Set<Extension> getExtensions(){
return this.extensions;
}
+ public void setExtensions(Set<Extension> extensions) {
+ this.extensions = extensions;
+ }
+
/**
*
* @param extension extension
*/
public void addExtension(Extension extension){
-
+ this.extensions.add(extension);
}
/**
* @param extension extension
*/
public void removeExtension(Extension extension){
+ this.extensions.remove(extension);
+ }
+
+ public boolean isProtectedTitleCache() {
+ return protectedTitleCache;
+ }
+ public void setProtectedTitleCache(boolean protectedTitleCache) {
+ this.protectedTitleCache = protectedTitleCache;
}
}
\ No newline at end of file
* @created 08-Nov-2007 13:06:34
*/
@Entity
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class Media extends AnnotatableEntity {
+ public Media() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
static Logger logger = Logger.getLogger(Media.class);
private MultilanguageArray title;
//creation date of the media (not of the record)
private MultilanguageArray description;
//A single medium such as a picture can have multiple representations in files. Common are multiple resolutions or file
//formats for images for example
- private ArrayList instances;
- private ArrayList rights;
+ private Set<MediaInstance> instances;
+ private Set<Rights> rights;
private Team artist;
- public ArrayList getInstances(){
+ public Set<MediaInstance> getInstances(){
return this.instances;
}
-
- /**
- *
- * @param instances instances
- */
- public void setInstances(ArrayList instances){
+ public void setInstances(Set<MediaInstance> instances){
this.instances = instances;
}
+ public void addInstance(MediaInstance instance){
+ this.instances.add(instance);
+ }
+ public void removeInstance(MediaInstance instance){
+ this.instances.remove(instance);
+ }
+
public Team getArtist(){
return this.artist;
}
-
- /**
- *
- * @param artist artist
- */
public void setArtist(Team artist){
this.artist = artist;
}
- public ArrayList getRights(){
+
+ public Set getRights(){
return this.rights;
}
-
- /**
- *
- * @param rights rights
- */
- public void setRights(ArrayList rights){
+ public void setRights(Set rights){
this.rights = rights;
}
+ public void addRights(Rights rights){
+ this.rights.add(rights);
+ }
+ public void removeRights(Rights rights){
+ this.rights.remove(rights);
+ }
+
public MultilanguageArray getTitle(){
return this.title;
}
this.title = title;
}
+ @Temporal(TemporalType.DATE)
public Calendar getMediaCreated(){
return this.mediaCreated;
}
public MultilanguageArray getDescription(){
return this.description;
}
-
- /**
- *
- * @param description description
- */
public void setDescription(MultilanguageArray description){
this.description = description;
}
+ public void addDescription(LanguageString description){
+ this.description.add(description);
+ }
+ public void addDescription(String text, Language lang){
+ this.description.add(text, lang);
+ }
+ public void removeDescription(Language lang){
+ this.description.remove(lang);
+ }
}
\ No newline at end of file
* @created 08-Nov-2007 13:06:34
*/
@Entity
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class MediaInstance extends VersionableEntity {
static Logger logger = Logger.getLogger(MediaInstance.class);
//http://www.iana.org/assignments/media-types
public class MultilanguageArray extends ArrayList<LanguageString>{
static Logger logger = Logger.getLogger(MultilanguageArray.class);
- public LanguageString addText(String text, Language lang){
+ public LanguageString add(String text, Language lang){
LanguageString ls = new LanguageString(text, lang);
super.add(ls);
return ls;
}
- public void removeText(Language lang){
- super.remove(getText(lang));
+ public void remove(Language lang){
+ super.remove(get(lang));
}
- public LanguageString getText(Language lang){
+ public LanguageString get(Language lang){
// FIXME: ...
return super.get(0);
}
*/
@MappedSuperclass
public abstract class VersionableEntity extends CdmBase {
+ public VersionableEntity() {
+ super();
+ this.uuid = UUID.randomUUID().toString();
+ this.created = Calendar.getInstance();
+ }
+
static Logger logger = Logger.getLogger(VersionableEntity.class);
private int id;
//the globally unique identifier
this.previousVersion = previousVersion;
}
+ @ManyToOne
public Person getUpdatedBy(){
return this.updatedBy;
}
this.updatedBy = updatedBy;
}
+ @ManyToOne
public Person getCreatedBy(){
return this.createdBy;
}
}
public String getUuid(){
- if (this.uuid == null){
- this.uuid = UUID.randomUUID().toString();
- }
return this.uuid;
}
/**
this.uuid = uuid;
}
+ @Temporal(TemporalType.TIMESTAMP)
public Calendar getCreated(){
- if (this.created == null){
- this.created = Calendar.getInstance();
- }
return this.created;
}
/**
this.created = created;
}
+ @Temporal(TemporalType.TIMESTAMP)
public Calendar getUpdated(){
return this.updated;
}
* @param modifyingText modifyingText
*/
public void addModifyingText(String text, Language lang){
- this.modifyingText.addText(text, lang);
+ this.modifyingText.add(text, lang);
}
public void removeModifyingText(Language lang){
this.modifyingText.removeText(lang);
}
public void addText(String text, Language lang) {
- this.texts.addText(text, lang);
+ this.texts.add(text, lang);
}
public void removeText(LanguageString ls) {
this.texts.remove(ls);
this.productionNotes = productionNotes;
}
+ @Temporal(TemporalType.DATE)
public Calendar getDateProduced(){
return this.dateProduced;
}
this.length = length;
}
+ @Temporal(TemporalType.DATE)
public Calendar getDateSequenced(){
return this.dateSequenced;
}
* @created 08-Nov-2007 13:06:57
*/
@Entity
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public abstract class TaxonNameBase extends IdentifiableEntity implements IReferencedEntity {
static Logger logger = Logger.getLogger(TaxonNameBase.class);
//The scientific name without author strings and year
this.identifierTeam = identifierTeam;
}
+ @Temporal(TemporalType.DATE)
public Calendar getIdentificationDate(){
return this.identificationDate;
}
* @created 08-Nov-2007 13:06:41
*/
@Entity
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class Occurrence extends IdentifiableEntity {
static Logger logger = Logger.getLogger(Occurrence.class);
//Locality name (as free text) where this occurrence happened
this.locality = locality;
}
+ @Temporal(TemporalType.TIMESTAMP)
public Calendar getEventDate(){
return this.eventDate;
}
* @created 08-Nov-2007 13:06:12
*/
@Entity
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class BibtexReference extends ReferenceBase implements INomenclaturalReference {
static Logger logger = Logger.getLogger(BibtexReference.class);
private BibtexEntryType type;
* @created 08-Nov-2007 13:06:54
*/
@Entity
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public abstract class StrictReferenceBase extends ReferenceBase {
static Logger logger = Logger.getLogger(StrictReferenceBase.class);
//Title of the reference