started replacing ArrayLists with Sets. Adding get/set/add/remove methods to all...
authorm.doering <m.doering@localhost>
Mon, 12 Nov 2007 14:59:14 +0000 (14:59 +0000)
committerm.doering <m.doering@localhost>
Mon, 12 Nov 2007 14:59:14 +0000 (14:59 +0000)
22 files changed:
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/agent/Contact.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/agent/Institution.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/agent/Person.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/agent/Team.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/common/AnnotatableEntity.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/common/CdmBase.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/common/DefinedTermBase.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/common/Extension.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/common/IdentifiableEntity.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/common/Media.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/common/MediaInstance.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/common/MultilanguageArray.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/common/VersionableEntity.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/description/StateData.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/description/TextData.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/molecular/DnaSample.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/molecular/Sequence.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/occurrence/Determination.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/occurrence/Occurrence.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/reference/BibtexReference.java
cdmlibrary/src/main/java/eu/etaxonomy/cdm/model/reference/StrictReferenceBase.java

index dad2b46160af2c375d2c8981a718fc98c357debb..e2391172dfaabc8efebf0ca5e584d665436d9799 100644 (file)
@@ -24,14 +24,19 @@ import javax.persistence.*;
  */
 @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;
        }
 
@@ -39,9 +44,15 @@ public class Contact extends VersionableEntity {
         * 
         * @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;
index 5fd733439548e9102080778e51fee85a65582ff3..8dcb3ba96789db532f3b3188b43fddef4b6c0059 100644 (file)
@@ -24,11 +24,16 @@ import javax.persistence.*;
  */
 @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;
 
@@ -44,15 +49,21 @@ public class Institution extends IdentifiableEntity {
                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;
        }
 
index 526bedac22b10ca1d5e2640ae74c9b86cca429bb..88c9fe6d4c31ea08c689de37977913f59e5f7665 100644 (file)
@@ -26,6 +26,11 @@ import javax.persistence.*;
  */
 @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;
@@ -40,12 +45,12 @@ public class Person extends IdentifiableEntity {
        //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;
        }
 
@@ -53,33 +58,38 @@ public class Person extends IdentifiableEntity {
         * 
         * @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;
index 7f8c6e00915d2a5c98ce49f6c2a4c61372ecac72..f92624bb66745611da4dded1988aecaac2185e61 100644 (file)
@@ -25,14 +25,19 @@ import javax.persistence.*;
  */
 @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;
        }
 
@@ -40,22 +45,24 @@ public class Team extends VersionableEntity {
         * 
         * @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;
        }
index 1ddaff03aaaf29b48045e9ddbef9495106b098c9..cac89c04914ff79679ada6f2f8cbfaf4f4e9655b 100644 (file)
@@ -22,11 +22,16 @@ import javax.persistence.*;
  */
 @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;
        }
 
@@ -46,7 +51,7 @@ public abstract class AnnotatableEntity extends VersionableEntity {
 
        }
 
-       public ArrayList<Annotation> getAnnotations(){
+       public Set<Annotation> getAnnotations(){
                return this.annotations;
        }
 
@@ -67,4 +72,12 @@ public abstract class AnnotatableEntity extends VersionableEntity {
 
        }
 
+       public void setMarkers(Set<Marker> markers) {
+               this.markers = markers;
+       }
+
+       public void setAnnotations(Set<Annotation> annotations) {
+               this.annotations = annotations;
+       }
+
 }
\ No newline at end of file
index 3875b486c24a4478149d6f6885d8741d5b1a2406..c1a06367609769bdcc75b57c9fc29245687c3817 100644 (file)
@@ -4,8 +4,14 @@ import java.beans.PropertyChangeListener;
 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) {
index b6b862871e668df3a868afb50f5d003f3ce93727..8aa0689edf8caa86e5075950fa5516995ecd789e 100644 (file)
@@ -25,31 +25,38 @@ import javax.persistence.*;
  */
 @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;
        }
@@ -62,7 +69,7 @@ public abstract class DefinedTermBase extends VersionableEntity {
                this.kindOf = kindOf;
        }
 
-       public ArrayList<DefinedTermBase> getGeneralizationOf(){
+       public Set<DefinedTermBase> getGeneralizationOf(){
                return this.generalizationOf;
        }
 
@@ -70,10 +77,11 @@ public abstract class DefinedTermBase extends VersionableEntity {
         * 
         * @param generalizationOf    generalizationOf
         */
-       public void setGeneralizationOf(ArrayList generalizationOf){
+       public void setGeneralizationOf(Set<DefinedTermBase> generalizationOf) {
                this.generalizationOf = generalizationOf;
        }
 
+
        public DefinedTermBase getPartOf(){
                return this.partOf;
        }
@@ -86,30 +94,34 @@ public abstract class DefinedTermBase extends VersionableEntity {
                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;
        }
index 836cd5d2fe04ab4d8f35554267048bc0309ba13f..ec14a75b044c6168d52452f3bb21bb94c4b5eb50 100644 (file)
@@ -18,7 +18,7 @@ import javax.persistence.*;
 /**
  * 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
@@ -29,7 +29,9 @@ public class Extension extends VersionableEntity {
        static Logger logger = Logger.getLogger(Extension.class);
        private String value;
        private ExtensionType type;
+       private IdentifiableEntity identifiableEntity;
 
+       @ManyToOne
        public ExtensionType getType(){
                return this.type;
        }
index 19965cc01e313beb996904ba8c2ce0b29f8b1ec0..4225b4429134e7bb86e73b7a97cf7c0f91dcc2e5 100644 (file)
@@ -22,13 +22,17 @@ import javax.persistence.*;
  */
 @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;
@@ -45,7 +49,7 @@ public abstract class IdentifiableEntity extends AnnotatableEntity {
        public abstract String generateTitle();
 
        public String getTitleCache(){
-               if (hasProtectedTitleCache){
+               if (protectedTitleCache){
                        return this.titleCache;                 
                }
                // is title dirty, i.e. equal NULL?
@@ -61,24 +65,16 @@ public abstract class IdentifiableEntity extends AnnotatableEntity {
         */
        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;
        }
 
        /**
@@ -87,7 +83,7 @@ public ArrayList<Rights> getRights(){
         * @param right
         */
        public void addRights(Rights right){
-
+               this.rights.add(right);
        }
 
        /**
@@ -95,19 +91,24 @@ public ArrayList<Rights> getRights(){
         * @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);
        }
 
        /**
@@ -115,7 +116,15 @@ public ArrayList<Rights> getRights(){
         * @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
index b97399f2c33acfe0e277678b560810fc08548e1c..20269661f8f19488eed98b05026aaa705b9fb7ad 100644 (file)
@@ -22,7 +22,13 @@ import javax.persistence.*;
  * @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)
@@ -30,46 +36,46 @@ public class Media extends AnnotatableEntity {
        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;
        }
@@ -82,6 +88,7 @@ public class Media extends AnnotatableEntity {
                this.title = title;
        }
 
+       @Temporal(TemporalType.DATE)
        public Calendar getMediaCreated(){
                return this.mediaCreated;
        }
@@ -97,13 +104,17 @@ public class Media extends AnnotatableEntity {
        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
index dc09e57d8f540dbc71ce33a7d25bfbae6b3f3ed9..3655be6754d6c095b024275a8d301c8b77924da2 100644 (file)
@@ -23,6 +23,7 @@ import javax.persistence.*;
  * @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
index c9df5ac9058e211ac5d449c382e7ee7c9aabea06..2df6e9dd54c2bb4c59482625ff225642144e67a5 100644 (file)
@@ -20,15 +20,15 @@ import org.apache.log4j.Logger;
 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);
        }
index ea4da557727c988fa3f54c0446ff799637a722a9..dab29918291b1e426a8f91b32bcc5d4cdc698552 100644 (file)
@@ -24,6 +24,12 @@ import javax.persistence.*;
  */
 @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
@@ -60,6 +66,7 @@ public abstract class VersionableEntity extends CdmBase {
                this.previousVersion = previousVersion;
        }
 
+       @ManyToOne
        public Person getUpdatedBy(){
                return this.updatedBy;
        }
@@ -72,6 +79,7 @@ public abstract class VersionableEntity extends CdmBase {
                this.updatedBy = updatedBy;
        }
 
+       @ManyToOne
        public Person getCreatedBy(){
                return this.createdBy;
        }
@@ -97,9 +105,6 @@ public abstract class VersionableEntity extends CdmBase {
        }
 
        public String getUuid(){
-               if (this.uuid == null){
-                       this.uuid = UUID.randomUUID().toString();
-               }
                return this.uuid;
        }
        /**
@@ -110,10 +115,8 @@ public abstract class VersionableEntity extends CdmBase {
                this.uuid = uuid;
        }
 
+       @Temporal(TemporalType.TIMESTAMP)
        public Calendar getCreated(){
-               if (this.created == null){
-                       this.created = Calendar.getInstance();
-               }
                return this.created;
        }
        /**
@@ -124,6 +127,7 @@ public abstract class VersionableEntity extends CdmBase {
                this.created = created;
        }
 
+       @Temporal(TemporalType.TIMESTAMP)
        public Calendar getUpdated(){
                return this.updated;
        }
index 5504d081fd8c9621fe61f46781426ee46039ff26..43f0b2404d8f9c9bd07b5828430c8895d5c2a3a6 100644 (file)
@@ -66,7 +66,7 @@ public class StateData extends VersionableEntity {
         * @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);
index d6c85e61014a5a55c0babca59c9766c19c52c2b9..7d0e7c2ac186c600b4a8374d787d0b93508d8f04 100644 (file)
@@ -45,7 +45,7 @@ public class TextData extends FeatureBase {
        }
 
        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);
index 38cfcec12ca58149c4c42571f0c7187b4c77d193..4a4939c01b4dda93c00aadd270e8914108989603 100644 (file)
@@ -93,6 +93,7 @@ public class DnaSample extends IdentifiableEntity {
                this.productionNotes = productionNotes;
        }
 
+       @Temporal(TemporalType.DATE)
        public Calendar getDateProduced(){
                return this.dateProduced;
        }
index acc5e93847789a9d5a7d69dfbc1a8a4f6797a8f6..c171b44e854274668747f424da71cc0c4bf1a345 100644 (file)
@@ -127,6 +127,7 @@ public class Sequence extends IdentifiableEntity implements IReferencedEntity {
                this.length = length;
        }
 
+       @Temporal(TemporalType.DATE)
        public Calendar getDateSequenced(){
                return this.dateSequenced;
        }
index 1247d8c3861a95472fe2d32eb2ae9a989f7e5d13..b514dc2a0815924f4c75e9743ca9a558b8d0f78e 100644 (file)
@@ -30,6 +30,7 @@ import javax.persistence.*;
  * @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
index 482edced8d54522b13bb6d7f3249865c82b3ba07..a625507ec97cf1086816105422440de7dc6ed237 100644 (file)
@@ -54,6 +54,7 @@ public class Determination extends AnnotatableEntity {
                this.identifierTeam = identifierTeam;
        }
 
+       @Temporal(TemporalType.DATE)
        public Calendar getIdentificationDate(){
                return this.identificationDate;
        }
index 2dbe93d7621b9ed7ae0faf6a775d57a186685bf0..7cf64cbdfa57e6f60459307e4da3c528aaca1449 100644 (file)
@@ -27,6 +27,7 @@ import javax.persistence.*;
  * @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
@@ -111,6 +112,7 @@ public class Occurrence extends IdentifiableEntity {
                this.locality = locality;
        }
 
+       @Temporal(TemporalType.TIMESTAMP)
        public Calendar getEventDate(){
                return this.eventDate;
        }
index 89f19d74991779f34f754da8714ccfd485efdbee..50ad2d0f70db479086e8727a8b19f0d1c955a094 100644 (file)
@@ -21,6 +21,7 @@ import javax.persistence.*;
  * @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;
index c2ec6237fb5cc6fea62422937fa30d43f70889c9..ca6b8d2436e13cd700c9483615c63b858edaa72a 100644 (file)
@@ -24,6 +24,7 @@ import javax.persistence.*;
  * @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