import org.hibernate.annotations.Index;
import org.hibernate.annotations.Table;
import org.hibernate.envers.Audited;
+import org.hibernate.search.annotations.ClassBridge;
+import org.hibernate.search.annotations.ClassBridges;
import org.hibernate.search.annotations.IndexedEmbedded;
+import org.hibernate.search.annotations.Store;
+import eu.etaxonomy.cdm.hibernate.search.AcceptedTaxonBridge;
+import eu.etaxonomy.cdm.hibernate.search.ClassInfoBridge;
+import eu.etaxonomy.cdm.model.common.IPublishable;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
"name",
"sec",
"doubtful",
- "publish",
"appendedPhrase",
- "useNameCache"
+ "useNameCache",
+ "publish"
})
@Entity
@Audited
//@PreFilter("hasPermission(filterObject, 'edit')")
@Table(appliesTo="TaxonBase", indexes = { @Index(name = "taxonBaseTitleCacheIndex", columnNames = { "titleCache" }) })
@TaxonNameCannotBeAcceptedAndSynonym(groups = Level3.class)
-public abstract class TaxonBase<S extends IIdentifiableEntityCacheStrategy> extends IdentifiableEntity<S> implements Cloneable {
+@ClassBridges({
+ @ClassBridge(name="classInfo",
+ index = org.hibernate.search.annotations.Index.YES,
+ store = Store.YES,
+ impl = ClassInfoBridge.class),
+ @ClassBridge(name="accTaxon", // TODO rename to acceptedTaxon, since we are usually not using abbreviations for field names
+ index = org.hibernate.search.annotations.Index.YES,
+ store = Store.YES,
+ impl = AcceptedTaxonBridge.class),
+ @ClassBridge(impl = eu.etaxonomy.cdm.hibernate.search.NomenclaturalSortOrderBrigde.class)
+})
+public abstract class TaxonBase<S extends IIdentifiableEntityCacheStrategy> extends IdentifiableEntity<S> implements IPublishable, Cloneable {
private static final long serialVersionUID = -3589185949928938529L;
private static final Logger logger = Logger.getLogger(TaxonBase.class);
//The assignment to the Taxon or to the Synonym class is not definitive
@XmlAttribute(name = "isDoubtful")
private boolean doubtful;
-
- @XmlAttribute(name = "publish")
- private boolean publish = true;
+
@XmlElement(name = "Name", required = true)
@XmlIDREF
@XmlAttribute(name= "UseNameCache")
private boolean useNameCache = false;
+
+ @XmlAttribute(name = "publish")
+ private boolean publish = true;
// ************* CONSTRUCTORS *************/
/**
* Returns the boolean value indicating whether the assignment of <i>this</i>
- * (abstract) taxon to the {@link Taxon Taxon} or to the {@link Synonym Synonym} class
+ * (abstract) taxon to the {@link Taxon Taxon} or to the {@link Synonym Synonym} class
* is definitive (false) or not (true). If this flag is set the use of <i>this</i> (abstract)
* taxon as an "accepted/correct" name or as a (junior) "synonym" might
* still change in the course of taxonomical working process.
}
- /**
- * Returns the boolean value indicating if this taxon should be withheld (<code>publish=false</code>) or not
- * (<code>publish=true</code>) during any publication process to the general public.
- * This publish flag implementation is preliminary and may be replaced by a more general
- * implementation of READ rights in future.<BR>
- * The default value is <code>true</code>.
- */
- public boolean isPublish() {
- return publish;
- }
-
- public void setPublish(boolean publish) {
- this.publish = publish;
- }
+ /**
+ * Returns the boolean value indicating if this taxon should be withheld (<code>publish=false</code>) or not
+ * (<code>publish=true</code>) during any publication process to the general public.
+ * This publish flag implementation is preliminary and may be replaced by a more general
+ * implementation of READ rights in future.<BR>
+ * The default value is <code>true</code>.
+ */
+ @Override
+ public boolean isPublish() {
+ return publish;
+ }
+
+ @Override
+ public void setPublish(boolean publish) {
+ this.publish = publish;
+ }
/**
* Returns the {@link eu.etaxonomy.cdm.model.reference.Reference reference} of <i>this</i> (abstract) taxon.
public void setUseNameCache(boolean useNameCache) {
this.useNameCache = useNameCache;
}
-
+
@Transient
public abstract boolean isOrphaned();
//*********************** CLONE ********************************************************/