fix in taxonomic tree and some comments
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / name / BacterialName.java
index 5b25e11e7e72e5bedc4def609be3a22691f2eb91..a6990f3570f11e507f4e637289e1ded6ab1a2158 100644 (file)
 package eu.etaxonomy.cdm.model.name;
 
 
-import org.apache.log4j.Logger;
-
-import javax.persistence.*;
+import javax.persistence.Entity;
+import javax.persistence.Transient;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
+import org.apache.log4j.Logger;
+import org.hibernate.envers.Audited;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
+import org.springframework.beans.factory.annotation.Configurable;
+
 /**
  * The taxon name class for bacteria.
  * <P>
@@ -35,22 +41,37 @@ import javax.xml.bind.annotation.XmlType;
 })
 @XmlRootElement(name = "BacterialName")
 @Entity
-public class BacterialName extends NonViralName {
+@Indexed(index = "eu.etaxonomy.cdm.model.name.TaxonNameBase")
+@Audited
+@Configurable
+public class BacterialName extends NonViralName<BacterialName> {
        
+       /**
+        * 
+        */
+       private static final long serialVersionUID = -7641841279209976443L;
+
        static Logger logger = Logger.getLogger(BacterialName.class);
 
        //Author team and year of the subgenus name
        @XmlElement(name = "SubGenusAuthorship")
+       @Field(index=Index.TOKENIZED)
        private String subGenusAuthorship;
        
        //Approbation of name according to approved list, validation list, or validly published, paper in IJSB after 1980
        @XmlElement(name = "NameApprobation")
+       @Field(index=Index.TOKENIZED)
        private String nameApprobation;
 
-       // ************* CONSTRUCTORS *************/    
+       // ************* CONSTRUCTORS *************/
+       
+       protected BacterialName(){
+               super();
+       }
+       
        /** 
         * Class constructor: creates a new bacterial taxon name instance
-        * only containing its {@link common.Rank rank},
+        * only containing its {@link Rank rank},
         * its {@link HomotypicalGroup homotypical group} and
         * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
         * The new bacterial taxon name instance will be also added to the set of
@@ -71,7 +92,7 @@ public class BacterialName extends NonViralName {
        //********* METHODS **************************************/
        /** 
         * Creates a new bacterial taxon name instance
-        * only containing its {@link common.Rank rank} and 
+        * only containing its {@link Rank rank} and 
         * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
         * 
         * @param  rank  the rank to be assigned to <i>this</i> bacterial taxon name
@@ -87,7 +108,7 @@ public class BacterialName extends NonViralName {
 
        /** 
         * Creates a new bacterial taxon name instance
-        * only containing its {@link common.Rank rank},
+        * only containing its {@link Rank rank},
         * its {@link HomotypicalGroup homotypical group} and 
         * the {@link eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy default cache strategy}.
         * The new bacterial taxon name instance will be also added to the set of
@@ -159,17 +180,16 @@ public class BacterialName extends NonViralName {
         * Returns the {@link NomenclaturalCode nomenclatural code} that governs
         * the construction of <i>this</i> bacterial taxon name, that is the
         * International Code of Nomenclature of Bacteria. This method overrides
-        * the getNomeclaturalCode method from {@link NonViralName#getNomeclaturalCode() NonViralName}.
+        * the getNomeclaturalCode method from {@link NonViralName NonViralName}.
         *
         * @return  the nomenclatural code for bacteria
         * @see         NonViralName#isCodeCompliant()
         * @see         TaxonNameBase#getHasProblem()
         */
-       @Transient
        @Override
        public NomenclaturalCode getNomenclaturalCode(){
-               return NomenclaturalCode.ICNB();
+               return NomenclaturalCode.ICNB;
 
        }
 
-}
\ No newline at end of file
+}