cdmlib-model/src/main/resources/terms/PreservationMethod.csv -text
cdmlib-model/src/main/resources/terms/README.TXT -text
cdmlib-model/src/main/resources/terms/Rank.csv -text
+cdmlib-model/src/main/resources/terms/RightsTerm.csv -text
cdmlib-model/src/main/resources/terms/Sex.csv -text
cdmlib-model/src/main/resources/terms/StatisticalMeasure.csv -text
cdmlib-model/src/main/resources/terms/SynonymRelationshipType.csv -text
@XmlElement(name = "LinkbackURL")
private URL linkbackUrl;
- @Any(metaDef = "AnnotatableEntity",
+ @Any(metaDef = "CdmBase",
metaColumn=@Column(name = "annotatedObj_type"),
fetch = FetchType.LAZY,
optional = false)
/**
* @return
*/
- @Any(metaDef = "AnnotatableEntity",
+ @Any(metaDef = "CdmBase",
fetch=FetchType.LAZY,
metaColumn = @Column(name="markedObj_type"),
optional = false)
package eu.etaxonomy.cdm.model.common;
+import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import org.apache.log4j.Logger;
+import org.hibernate.annotations.Any;
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
}
-// @ManyToOne
-// @Cascade(CascadeType.SAVE_UPDATE)
- @Transient //beacause IdentifiableEntity is MappedSuperclass
+ @Any(metaDef = "CdmBase",
+ metaColumn=@Column(name = "sourcedObj_type"),
+ fetch = FetchType.LAZY,
+ optional = false)
+ @JoinColumn(name = "sourcedObj_id")
public IdentifiableEntity getSourcedObj() {
return sourcedObj;
}
+
public void setSourcedObj(IdentifiableEntity sourcedObj) {
this.sourcedObj = sourcedObj;
}
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
import eu.etaxonomy.cdm.model.location.NamedAreaType;
import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry;
+import eu.etaxonomy.cdm.model.media.RightsTerm;
import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
import eu.etaxonomy.cdm.model.name.NameRelationshipType;
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
insertDefaultTerms(PreservationMethod.class, NOT_ORDERED);
insertDefaultTerms(DeterminationModifier.class, ORDERED);
insertDefaultTerms(StatisticalMeasure.class, NOT_ORDERED);
+ insertDefaultTerms(RightsTerm.class, NOT_ORDERED);
logger.debug("terms loaded");
return true;
}
@org.hibernate.annotations.TypeDef(name="partialUserType", typeClass=eu.etaxonomy.cdm.model.common.PartialUserType.class),\r
@org.hibernate.annotations.TypeDef(name="uuidUserType", typeClass=eu.etaxonomy.cdm.model.common.UUIDUserType.class)\r
})\r
-@org.hibernate.annotations.AnyMetaDef(name = "AnnotatableEntity" ,\r
+@org.hibernate.annotations.AnyMetaDef(name = "CdmBase" ,\r
metaType="string", \r
idType="integer",\r
metaValues={\r
}
- @Transient
+ @ManyToOne(fetch = FetchType.LAZY)
@Cascade({CascadeType.SAVE_UPDATE})
public RightsTerm getType(){
return this.type;
package eu.etaxonomy.cdm.model.media;
+import java.util.UUID;
+
import org.apache.log4j.Logger;
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.description.Feature;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlAccessType;
super(term, label, labelAbbrev);
}
+ /**
+ * Returns the rights term identified through its immutable universally
+ * unique identifier (UUID).
+ *
+ * @param uuid the universally unique identifier
+ * @return the rights term corresponding to the given
+ * universally unique identifier
+ */
+ public static final RightsTerm getByUuid(UUID uuid){
+ return (RightsTerm)findByUuid(uuid);
+ }
+
/**
* http://purl.org/dc/terms/accessRights
*/
public static final RightsTerm ACCESS_RIGHTS(){
- return null;
+ return getByUuid(uuidAccessRights);
}
public static final RightsTerm COPYRIGHT(){
- return null;
+ return getByUuid(uuidCopyright);
}
public static final RightsTerm LICENSE(){
- return null;
+ return getByUuid(uuidLicense);
}
+
+ private static final UUID uuidLicense = UUID.fromString("67c0d47e-8985-1014-8845-c84599f9992c");
+ private static final UUID uuidCopyright = UUID.fromString("d1ef838e-b195-4f28-b8eb-0d3be080bd37");
+ private static final UUID uuidAccessRights = UUID.fromString("a50b4def-b3ac-4508-b50a-e0f249e3a1d7");
}
\ No newline at end of file
--- /dev/null
+"8627c526-73af-44d9-902c-11c1f11b60b4",,"RightsTerm","RightsTerm",\r
+"67c0d47e-8985-1014-8845-c84599f9992c",,"license",\r
+"d1ef838e-b195-4f28-b8eb-0d3be080bd37",,"copyright",\r"a50b4def-b3ac-4508-b50a-e0f249e3a1d7",,"access rights",