package eu.etaxonomy.cdm.api.application;\r
\r
import java.io.FileNotFoundException;\r
+import java.util.UUID;\r
\r
import org.apache.log4j.Logger;\r
import org.hibernate.SessionFactory;\r
* @return true, if at least one is missing, else false\r
*/\r
public boolean testDefinedTermsAreMissing(){\r
- String englishUuid = "e9f8cdb7-6819-44e8-95d3-e2d0690c3523";\r
- DefinedTermBase english = this.getTermService().getTermByUri(englishUuid);\r
- if ( english == null || ! english.getUuid().equalsIgnoreCase(englishUuid)){\r
+ UUID englishUuid = UUID.fromString("e9f8cdb7-6819-44e8-95d3-e2d0690c3523");\r
+ DefinedTermBase english = this.getTermService().getTermByUri(englishUuid.toString());\r
+ if ( english == null || ! english.getUuid().equals(englishUuid)){\r
return true;\r
}else{\r
return false;\r
package eu.etaxonomy.cdm.api.service;\r
\r
import java.util.List;\r
+import java.util.UUID;\r
\r
import org.apache.log4j.Logger;\r
import org.springframework.beans.factory.annotation.Autowired;\r
return super.findCdmObjectsByTitle(title);\r
}\r
\r
- public Agent getAgentByUuid(String uuid) {\r
+ public Agent getAgentByUuid(UUID uuid) {\r
return super.getCdmObjectByUuid(uuid);\r
}\r
\r
- public String saveAgent(Agent agent) {\r
+ public UUID saveAgent(Agent agent) {\r
return super.saveCdmObject(agent);\r
}\r
}\r
package eu.etaxonomy.cdm.api.service;\r
\r
import java.util.List;\r
+import java.util.UUID;\r
\r
import eu.etaxonomy.cdm.model.agent.Agent;\r
\r
public interface IAgentService extends IIdentifiableEntityService<Agent> {\r
- public abstract Agent getAgentByUuid(String uuid);\r
+ \r
+ public abstract Agent getAgentByUuid(UUID uuid);\r
\r
- public abstract String saveAgent(Agent agent);\r
+ public abstract UUID saveAgent(Agent agent);\r
\r
public abstract List<Agent> findAgentsByTitle(String title);\r
\r
package eu.etaxonomy.cdm.api.service;\r
\r
import java.util.List;\r
+import java.util.UUID;\r
\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.cdm.model.name.*;\r
\r
public interface INameService extends IIdentifiableEntityService<TaxonNameBase> {\r
\r
- public abstract TaxonNameBase getTaxonNameByUuid(String uuid);\r
+ public abstract TaxonNameBase getTaxonNameByUuid(UUID uuid);\r
\r
- public abstract String saveTaxonName(TaxonNameBase taxonName);\r
+ public abstract UUID saveTaxonName(TaxonNameBase taxonName);\r
\r
public abstract List<TaxonNameBase> getAllNames(int limit, int start);\r
\r
package eu.etaxonomy.cdm.api.service;
-import java.util.List;
-
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import java.util.UUID;
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao;
+
public interface IReferenceService extends IIdentifiableEntityService<ReferenceBase>{
/** find reference by UUID**/
- public abstract ReferenceBase getReferenceByUuid(String uuid);
+ public abstract ReferenceBase getReferenceByUuid(UUID uuid);
/** save a reference and return its UUID**/
- public abstract String saveReference(ReferenceBase reference);
+ public abstract UUID saveReference(ReferenceBase reference);
}
*/\r
package eu.etaxonomy.cdm.api.service;\r
\r
-import java.util.List;\r
-\r
import org.springframework.transaction.annotation.Propagation;\r
import org.springframework.transaction.annotation.Transactional;\r
-\r
import eu.etaxonomy.cdm.model.common.CdmBase;\r
-import eu.etaxonomy.cdm.model.common.IdentifiableEntity;\r
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
+\r
\r
/**\r
* @author a.mueller\r
package eu.etaxonomy.cdm.api.service;
import java.util.List;
+import java.util.UUID;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao;
+
public interface ITaxonService extends IIdentifiableEntityService<TaxonBase>{
- public abstract TaxonBase getTaxonByUuid(String uuid);
+
+ /** */
+ public abstract TaxonBase getTaxonByUuid(UUID uuid);
/** save a taxon and return its UUID**/
- public abstract String saveTaxon(TaxonBase taxon);
+ public abstract UUID saveTaxon(TaxonBase taxon);
+ /** */
public abstract List<Taxon> getRootTaxa(ReferenceBase sec);
-
+
+ /** */
public abstract List<TaxonBase> searchTaxaByName(String name, ReferenceBase sec);
}
package eu.etaxonomy.cdm.api.service;
import java.util.List;
+import java.util.UUID;
import javax.persistence.Transient;
public abstract List<DefinedTermBase> listTerms();
- public abstract List<DefinedTermBase> listTerms(String vocabularyUuid);
+ public abstract List<DefinedTermBase> listTerms(UUID vocabularyUuid);
public abstract List<TermVocabulary> listVocabularies(Class termClass);
\r
import org.apache.log4j.Logger;\r
import org.springframework.beans.factory.annotation.Autowired;\r
-import org.springframework.context.ApplicationContext;\r
-import org.springframework.stereotype.Repository;\r
import org.springframework.stereotype.Service;\r
import org.springframework.transaction.annotation.Transactional;\r
\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
-import eu.etaxonomy.cdm.model.common.VersionableEntity;\r
import eu.etaxonomy.cdm.model.name.*;\r
-import eu.etaxonomy.cdm.persistence.dao.common.IAgentDao;\r
import eu.etaxonomy.cdm.persistence.dao.name.ITaxonNameDao;\r
-import eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonDao;\r
-import eu.etaxonomy.cdm.strategy.BotanicNameCacheStrategy;\r
+\r
\r
import java.util.List;\r
+import java.util.UUID;\r
\r
\r
@Service\r
return super.findCdmObjectsByTitle(name);\r
}\r
\r
- public TaxonNameBase getTaxonNameByUuid(String uuid) {\r
+ public TaxonNameBase getTaxonNameByUuid(UUID uuid) {\r
return super.getCdmObjectByUuid(uuid);\r
}\r
\r
@Transactional(readOnly = false)\r
- public String saveTaxonName(TaxonNameBase taxonName) {\r
+ public UUID saveTaxonName(TaxonNameBase taxonName) {\r
return super.saveCdmObject(taxonName);\r
}\r
\r
\r
import org.apache.log4j.Logger;\r
import org.springframework.beans.factory.annotation.Autowired;\r
-import org.springframework.context.ApplicationContext;\r
-import org.springframework.stereotype.Repository;\r
import org.springframework.stereotype.Service;\r
import org.springframework.transaction.annotation.Transactional;\r
-\r
-import eu.etaxonomy.cdm.model.common.VersionableEntity;\r
-import eu.etaxonomy.cdm.model.name.*;\r
import eu.etaxonomy.cdm.model.reference.ReferenceBase;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
-import eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao;\r
-import eu.etaxonomy.cdm.persistence.dao.name.ITaxonNameDao;\r
import eu.etaxonomy.cdm.persistence.dao.reference.IReferenceDao;\r
-import eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonDao;\r
-import eu.etaxonomy.cdm.strategy.BotanicNameCacheStrategy;\r
-\r
-import java.util.List;\r
+import java.util.UUID;\r
\r
\r
@Service\r
}\r
\r
\r
- public ReferenceBase getReferenceByUuid(String uuid) {\r
+ public ReferenceBase getReferenceByUuid(UUID uuid) {\r
return super.getCdmObjectByUuid(uuid); \r
}\r
\r
@Transactional(readOnly = false)\r
- public String saveReference(ReferenceBase reference) {\r
+ public UUID saveReference(ReferenceBase reference) {\r
return super.saveCdmObject(reference);\r
}\r
\r
package eu.etaxonomy.cdm.api.service;\r
\r
import java.util.List;\r
+import java.util.UUID;\r
\r
import org.apache.log4j.Logger;\r
import org.springframework.beans.factory.annotation.Autowired;\r
this.appContext = appContext;\r
}\r
\r
- protected T getCdmObjectByUuid(String uuid){\r
+ protected T getCdmObjectByUuid(UUID uuid){\r
return dao.findByUuid(uuid);\r
}\r
\r
@Transactional(readOnly = false)\r
- protected String saveCdmObject(T cdmObj){\r
+ protected UUID saveCdmObject(T cdmObj){\r
if (logger.isDebugEnabled()){logger.debug("Save cdmObj: " + (cdmObj == null? null: cdmObj.toString()));}\r
return dao.saveOrUpdate(cdmObj);\r
}\r
import eu.etaxonomy.cdm.strategy.BotanicNameCacheStrategy;\r
\r
import java.util.List;\r
+import java.util.UUID;\r
\r
\r
@Service\r
}\r
\r
\r
- public TaxonBase getTaxonByUuid(String uuid) {\r
+ public TaxonBase getTaxonByUuid(UUID uuid) {\r
return super.getCdmObjectByUuid(uuid); \r
}\r
\r
@Transactional(readOnly = false)\r
- public String saveTaxon(TaxonBase taxon) {\r
+ public UUID saveTaxon(TaxonBase taxon) {\r
return super.saveCdmObject(taxon);\r
}\r
\r
import java.util.ArrayList;
import java.util.List;
+import java.util.UUID;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
}
public DefinedTermBase getTermByUri(String uri) {
- return DefinedTermBase.findByUuid(uri);
+ //FIXME transformation from URI to UUID
+ return DefinedTermBase.findByUuid(UUID.fromString(uri));
}
- public DefinedTermBase getTermByUuid(String uuid) {
+ public DefinedTermBase getTermByUuid(UUID uuid) {
return DefinedTermBase.findByUuid(uuid);
}
}
}
- public List<DefinedTermBase> listTerms(String vocabularyUuid) {
+ public List<DefinedTermBase> listTerms(UUID vocabularyUuid) {
// TODO Auto-generated method stub
+ logger.error("Method not implemented yet");
return null;
}
public List<TermVocabulary> listVocabularies(Class termClass) {
// TODO Auto-generated method stub
+ logger.error("Method not implemented yet");
return null;
}
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Map;
+import java.util.UUID;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
@Autowired
private ICdmGenericDao dao;
- private static Map<String, DefinedTermBase> definedTermsMap;
+ private static Map<UUID, DefinedTermBase> definedTermsMap;
- public static void setDefinedTermsMap(Map<String, DefinedTermBase> dtm){
+ public static void setDefinedTermsMap(Map<UUID, DefinedTermBase> dtm){
definedTermsMap = dtm;
}
dao.saveOrUpdate(voc);
}else{
//e.g. in tests when no database connection exists
- logger.info("No dao exists. Vocabulary for class '" + termClass + "' could not be saved");
+ logger.debug("No dao exists. Vocabulary for class '" + termClass + "' could not be saved to database");
}
if (definedTermsMap != null){
DefinedTermBase defTermBase = (DefinedTermBase)term;
public abstract class CdmBase implements Serializable{
private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
private int id;
- private String uuid;
+ private UUID uuid;
private Calendar created;
private Person createdBy;
public CdmBase() {
- this.uuid = UUID.randomUUID().toString();
+ this.uuid = UUID.randomUUID();
this.created = Calendar.getInstance();
}
}
- public String getUuid() {
+ public UUID getUuid() {
return this.uuid;
}
- public void setUuid(String uuid) {
+ public void setUuid(UUID uuid) {
this.uuid = uuid;
}
import eu.etaxonomy.cdm.api.service.ITermService;
import eu.etaxonomy.cdm.database.init.TermLoader;
-import eu.etaxonomy.cdm.model.taxon.ConceptRelationshipType;
-import eu.etaxonomy.cdm.persistence.dao.common.IDefinedTermDao;
-
-import java.io.FileNotFoundException;
-import java.io.Serializable;
import java.util.*;
-
import javax.persistence.*;
/**
//public static IDefinedTermDao dao;
//public static ITermService termService;
//Map for preloading all DefinedTerms
- static protected Map<String, DefinedTermBase> definedTermsMap = null;
+ static protected Map<UUID, DefinedTermBase> definedTermsMap = null;
private DefinedTermBase kindOf;
private Set<DefinedTermBase> generalizationOf = new HashSet<DefinedTermBase>();
logger.debug("initTermList");
if (definedTermsMap == null){
if (termService == null){ //e.g. when used in tests with no database connection
- definedTermsMap = new HashMap<String, DefinedTermBase>();
+ definedTermsMap = new HashMap<UUID, DefinedTermBase>();
try {
- String uuidEnglish = "e9f8cdb7-6819-44e8-95d3-e2d0690c3523";
+ String strUuidEnglish = "e9f8cdb7-6819-44e8-95d3-e2d0690c3523";
+ UUID uuidEnglish = UUID.fromString(strUuidEnglish);
Language english = new Language(uuidEnglish);
definedTermsMap.put(english.getUuid(), english);
TermLoader.setDefinedTermsMap(definedTermsMap);
}else{
List<DefinedTermBase> list = termService.listTerms();
- definedTermsMap = new HashMap<String, DefinedTermBase>();
+ definedTermsMap = new HashMap<UUID, DefinedTermBase>();
for (DefinedTermBase dtb: list){
definedTermsMap.put(dtb.getUuid(), dtb);
}
logger.debug("initTermList - end");
}
- public static DefinedTermBase findByUuid(String uuid){
+ public static DefinedTermBase findByUuid(UUID uuid){
//in tests tems may no be initialised by database access
if (!isInitialized()){
initTermList(null);
return (definedTermsMap != null);
}
- public static Map<String, DefinedTermBase> getDefinedTerms(){
+ public static Map<UUID, DefinedTermBase> getDefinedTerms(){
return definedTermsMap;
}
readCsvLine(csvLine, Language.ENGLISH());
}
public void readCsvLine(List<String> csvLine, Language lang) {
- this.setUuid(csvLine.get(0));
+ this.setUuid(UUID.fromString(csvLine.get(0)));
this.setUri(csvLine.get(1));
this.addRepresentation(new Representation(csvLine.get(3), csvLine.get(2).trim(), lang) );
}
*/
public void writeCsvLine(CSVWriter writer) {
String [] line = new String[4];
- line[0] = getUuid();
+ line[0] = getUuid().toString();
line[1] = getUri();
line[2] = getLabel();
line[3] = getDescription();
import au.com.bytecode.opencsv.CSVWriter;
import java.util.*;
+
import javax.persistence.*;
/**
public class Language extends DefinedTermBase {
static Logger logger = Logger.getLogger(Language.class);
+ private static final UUID uuidChinese = UUID.fromString("a9fc2782-5b2a-466f-b9c3-64d9ca6614c4");
+ private static final UUID uuidEnglish = UUID.fromString("e9f8cdb7-6819-44e8-95d3-e2d0690c3523");
+ private static final UUID uuidSpanish = UUID.fromString("511d8125-f5e6-445d-aee2-6327375238be");
+ private static final UUID uuidHindi = UUID.fromString("0a1d9d1d-135d-4575-b172-669b51673c39");
+ private static final UUID uuidArabic = UUID.fromString("4d3ec2eb-536f-4aab-81c5-34e37a3edbba");
+ private static final UUID uuidRussian = UUID.fromString("64ea9354-cbf8-40de-9f6e-387d24896f50");
+ private static final UUID uuidPortuguese = UUID.fromString("c2c08339-2405-4d7d-bd25-cbe01fb7ce09");
+ private static final UUID uuidJapanese = UUID.fromString("6778c7fb-c195-4dc1-ae3f-164201314e51");
+ private static final UUID uuidGerman = UUID.fromString("d1131746-e58b-4e80-a865-f5182c9c3073");
+ private static final UUID uuidFrench = UUID.fromString("7759a1d8-a5ea-454a-8c93-1dcfaae8cc21");
+ private static final UUID uuidItalian = UUID.fromString("fecbf0c7-fea9-465b-8a16-950517c5c0c4");
+ private static final UUID uuidDutch = UUID.fromString("9965d79a-acf9-4921-a2c0-863b8c16c056");
+ private static final UUID uuidPolish = UUID.fromString("3fdca387-f1b0-4ec1-808f-1bc3dc482194");
+
+
+
private char[] iso639_1 = new char[2];
private char[] iso639_2 = new char[3];
public Language() {
super();
}
- public Language(String uuid) {
+ public Language(UUID uuid) {
super();
this.setUuid(uuid);
}
this(label,text, DEFAULT());
}
- public static final Language getUUID(String uuid){
+ public static final Language getUUID(UUID uuid){
return (Language)findByUuid(uuid);
//return (Language)termService.getTermByUri(uuid);
//return (Language) dao.findByUuid(uuid);
public static final Language CHINESE(){
- return getUUID("a9fc2782-5b2a-466f-b9c3-64d9ca6614c4");
+ return getUUID(uuidChinese);
}
public static final Language ENGLISH(){
- return getUUID("e9f8cdb7-6819-44e8-95d3-e2d0690c3523");
+ return getUUID(uuidEnglish);
}
public static final Language SPANISH(){
- return getUUID("511d8125-f5e6-445d-aee2-6327375238be");
+ return getUUID(uuidSpanish);
}
public static final Language HINDI(){
- return getUUID("0a1d9d1d-135d-4575-b172-669b51673c39");
+ return getUUID(uuidHindi);
}
public static final Language ARABIC(){
- return getUUID("4d3ec2eb-536f-4aab-81c5-34e37a3edbba");
+ return getUUID(uuidArabic);
}
public static final Language RUSSIAN(){
- return getUUID("64ea9354-cbf8-40de-9f6e-387d24896f50");
+ return getUUID(uuidRussian);
}
public static final Language PORTUGUESE(){
- return getUUID("c2c08339-2405-4d7d-bd25-cbe01fb7ce09");
+ return getUUID(uuidPortuguese);
}
public static final Language JAPANESE(){
- return getUUID("6778c7fb-c195-4dc1-ae3f-164201314e51");
+ return getUUID(uuidJapanese);
}
public static final Language GERMAN(){
- return getUUID("d1131746-e58b-4e80-a865-f5182c9c3073");
+ return getUUID(uuidGerman);
}
public static final Language FRENCH(){
- return getUUID("7759a1d8-a5ea-454a-8c93-1dcfaae8cc21");
+ return getUUID(uuidFrench);
}
public static final Language ITALIAN(){
- return getUUID("fecbf0c7-fea9-465b-8a16-950517c5c0c4");
+ return getUUID(uuidItalian);
}
public static final Language DUTCH(){
- return getUUID("9965d79a-acf9-4921-a2c0-863b8c16c056");
+ return getUUID(uuidDutch);
}
public static final Language POLISH(){
- return getUUID("3fdca387-f1b0-4ec1-808f-1bc3dc482194");
+ return getUUID(uuidPolish);
}
public void readCsvLine(List<String> csvLine) {
}
public void writeCsvLine(CSVWriter writer) {
String [] line = new String[6];
- line[0] = getUuid();
+ line[0] = getUuid().toString();
line[1] = getUri();
line[2] = getLabel(Language.ENGLISH());
line[3] = getDescription(Language.ENGLISH());
return r.getLabel();
}
}
- return super.getUuid();
+ return super.getUuid().toString();
}
@Transient
public void writeCsvLine(CSVWriter writer) {
String [] line = new String[8];
- line[0] = getUuid();
+ line[0] = getUuid().toString();
line[1] = getUri();
line[2] = getLabel();
line[3] = getDescription();
return r.getLabel();
}
}
- return super.getUuid();
+ return super.getUuid().toString();
}
@Transient
}
public void writeCsvLine(CSVWriter writer) {
String [] line = new String[6];
- line[0] = getUuid();
+ line[0] = getUuid().toString();
line[1] = getUri();
line[2] = getLabel(Language.ENGLISH());
line[3] = getDescription();
public class Rank extends OrderedTermBase {
static Logger logger = Logger.getLogger(Rank.class);
+ private static final UUID uuidEmpire = UUID.fromString("ac470211-1586-4b24-95ca-1038050b618d");
+ private static final UUID uuidDomain = UUID.fromString("ffca6ec8-8b88-417b-a6a0-f7c992aac19b");
+ private static final UUID uuidSuperKingdom = UUID.fromString("64223610-7625-4cfd-83ad-b797bf7f0edd");
+ private static final UUID uuidKingdom = UUID.fromString("fbe7109d-66b3-498c-a697-c6c49c686162");
+ private static final UUID uuidSubKingdom = UUID.fromString("a71bd9d8-f3ab-4083-afb5-d89315d71655");
+ private static final UUID uuidInfraKingdom = UUID.fromString("1e37930c-86cf-44f6-90fd-7822928df260");
+ private static final UUID uuidSuperPhylum = UUID.fromString("0d0cecb1-e254-4607-b210-6801e7ecbb04");
+ private static final UUID uuidPhylum = UUID.fromString("773430d2-76b4-438c-b817-97a543a33287");
+
+ private static final UUID uuidDivision = UUID.fromString("7e56f5cc-123a-4fd1-8cbb-6fd80358b581");
+
+ private static final UUID uuidClass = UUID.fromString("f23d14c4-1d34-4ee6-8b4e-eee2eb9a3daf");
+
+ private static final UUID uuidOrder = UUID.fromString("b0785a65-c1c1-4eb4-88c7-dbd3df5aaad1");
+
+ private static final UUID uuidFamily = UUID.fromString("af5f2481-3192-403f-ae65-7c957a0f02b6");
+ private static final UUID uuidSubFamily = UUID.fromString("862526ee-7592-4760-a23a-4ff3641541c5");
+
+ private static final UUID uuidTribe = UUID.fromString("4aa6890b-0363-4899-8d7c-ee0cb78e6166");
+
+ private static final UUID uuidGenus = UUID.fromString("1b11c34c-48a8-4efa-98d5-84f7f66ef43a");
+ private static final UUID uuidSubGenus = UUID.fromString("78786e16-2a70-48af-a608-494023b91904");
+ private static final UUID uuidInfraGenus = UUID.fromString("a9972969-82cd-4d54-b693-a096422f13fa");
+ private static final UUID uuidSection = UUID.fromString("3edff68f-8527-49b5-bf91-7e4398bb975c");
+
+ private static final UUID uuidSpeciesAggregate = UUID.fromString("1ecae058-4217-4f75-9c27-6d8ba099ac7a");
+ private static final UUID uuidInfraGenericTaxon = UUID.fromString("41bcc6ac-37d3-4fd4-bb80-3cc5b04298b9");
+ private static final UUID uuidSpecies = UUID.fromString("b301f787-f319-4ccc-a10f-b4ed3b99a86d");
+
+ private static final UUID uuidSubSpecies = UUID.fromString("462a7819-8b00-4190-8313-88b5be81fad5");
+ private static final UUID uuidInfraSpecies = UUID.fromString("f28ebc9e-bd50-4194-9af1-42f5cb971a2c");
+ private static final UUID uuidVariety = UUID.fromString("d5feb6a5-af5c-45ef-9878-bb4f36aaf490");
+ private static final UUID uuidBioVariety = UUID.fromString("a3a364cb-1a92-43fc-a717-3c44980a0991");
+
public Rank() {
- super();
// TODO Auto-generated constructor stub
+ super();
}
public Rank(String term, String label) {
}
public static final Rank EMPIRE(){
- return (Rank)findByUuid("1234-8765-21341");
+ return (Rank)findByUuid(uuidEmpire);
}
public static final Rank DOMAIN(){
- return null;
+ return (Rank)findByUuid(uuidDomain);
}
public static final Rank SUPER_KINGDOM(){
- return null;
+ return (Rank)findByUuid(uuidSuperKingdom);
}
public static final Rank KINGDOM(){
- return null;
+ return (Rank)findByUuid(uuidKingdom);
}
public static final Rank SUBKINGDOM(){
- return null;
+ return (Rank)findByUuid(uuidSubKingdom);
}
public static final Rank INFRAKINGDOM(){
- return null;
+ return (Rank)findByUuid(uuidInfraKingdom);
}
public static final Rank SUPERPHYLUM(){
- return null;
+ return (Rank)findByUuid(uuidSuperPhylum);
}
public static final Rank PHYLUM(){
- return null;
+ return (Rank)findByUuid(uuidPhylum);
}
public static final Rank SUBPHYLUM(){
}
public static final Rank DIVISION(){
- return null;
+ return (Rank)findByUuid(uuidDivision);
}
public static final Rank SUBDIVISION(){
}
public static final Rank CLASS(){
- return null;
+ return (Rank)findByUuid(uuidClass);
}
public static final Rank SUBCLASS(){
}
public static final Rank ORDER(){
- return null;
+ return (Rank)findByUuid(uuidOrder);
}
public static final Rank SUBORDER(){
}
public static final Rank FAMILY(){
- return null;
+ return (Rank)findByUuid(uuidFamily);
}
public static final Rank SUBFAMILY(){
- return (Rank)findByUuid("af5f2481-3192-403f-ae65-7c957a0f02b6");
+ return (Rank)findByUuid(uuidSubFamily);
}
public static final Rank INFRAFAMILY(){
}
public static final Rank TRIBE(){
- return null;
+ return (Rank)findByUuid(uuidTribe);
}
public static final Rank SUBTRIBE(){
}
public static final Rank GENUS(){
- return (Rank)findByUuid("1b11c34c-48a8-4efa-98d5-84f7f66ef43a");
+ return (Rank)findByUuid(uuidGenus);
}
public static final Rank SUBGENUS(){
- return null;
+ return (Rank)findByUuid(uuidSubGenus);
}
public static final Rank INFRAGENUS(){
- return null;
+ return (Rank)findByUuid(uuidInfraGenus);
}
public static final Rank SECTION(){
- return null;
+ return (Rank)findByUuid(uuidSection);
}
public static final Rank SUBSECTION(){
}
public static final Rank SPECIES_AGGREGATE(){
- return null;
+ return (Rank)findByUuid(uuidSpeciesAggregate);
}
public static final Rank INFRAGENERIC_TAXON(){
- return null;
+ return (Rank)findByUuid(uuidInfraGenericTaxon);
}
public static final Rank SPECIES(){
- return (Rank)findByUuid("b301f787-f319-4ccc-a10f-b4ed3b99a86d");
+ return (Rank)findByUuid(uuidSpecies);
}
public static final Rank SUBSPECIFIC_AGGREGATE(){
}
public static final Rank SUBSPECIES(){
- return (Rank)findByUuid("462a7819-8b00-4190-8313-88b5be81fad5");
+ return (Rank)findByUuid(uuidSubSpecies);
}
public static final Rank INFRASPECIES(){
- return (Rank)findByUuid("f28ebc9e-bd50-4194-9af1-42f5cb971a2c");
+ return (Rank)findByUuid(uuidInfraSpecies);
}
public static final Rank VARIETY(){
- return (Rank)findByUuid("f28ebc9e-bd50-4194-9af1-42f5cb971a2c");
+ return (Rank)findByUuid(uuidVariety);
}
public static final Rank BIO_VARIETY(){
- return (Rank)findByUuid("d5feb6a5-af5c-45ef-9878-bb4f36aaf490");
+ return (Rank)findByUuid(uuidBioVariety);
}
public static final Rank PATHO_VARIETY(){
package eu.etaxonomy.cdm.model.occurrence;
+import java.util.UUID;
+
import javax.persistence.Entity;
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
@Entity
public class DerivationEventType extends DefinedTermBase {
+ private static final String strUnknownUuid = "00000000-0000-0000-0000-000000000000";
+
+ private static final UUID uuidDuplicate = UUID.fromString(strUnknownUuid);
+ private static final UUID uuidGateringInSitu = UUID.fromString(strUnknownUuid);
+ private static final UUID uuidTissueSampling = UUID.fromString(strUnknownUuid);
+ private static final UUID uuidDnaExtraction = UUID.fromString(strUnknownUuid);
+
+
public DerivationEventType() {
// TODO Auto-generated constructor stub
}
}
public static final DerivationEventType DUPLICATE(){
- return (DerivationEventType)findByUuid("1234-8765-21341");
+ return (DerivationEventType)findByUuid(uuidDuplicate);
}
public static final DerivationEventType GATHERING_IN_SITU(){
- return (DerivationEventType)findByUuid("1234-8765-21341");
+ return (DerivationEventType)findByUuid(uuidGateringInSitu);
}
public static final DerivationEventType TISSUE_SAMPLING(){
- return (DerivationEventType)findByUuid("1234-8765-21341");
+ return (DerivationEventType)findByUuid(uuidTissueSampling);
}
public static final DerivationEventType DNA_EXTRACTION(){
- return (DerivationEventType)findByUuid("1234-8765-21341");
+ return (DerivationEventType)findByUuid(uuidDnaExtraction);
}
}
package eu.etaxonomy.cdm.model.taxon;
-import eu.etaxonomy.cdm.model.common.OrderedTermBase;
-import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.common.RelationshipTermBase;
-
import org.apache.log4j.Logger;
-
-import java.util.*;
import javax.persistence.*;
+import java.util.UUID;
+
/**
* @author m.doering
public class ConceptRelationshipType extends RelationshipTermBase {
static Logger logger = Logger.getLogger(ConceptRelationshipType.class);
+ private static final UUID uuidTaxonomicallyIncludedIn = UUID.fromString("d13fecdf-eb44-4dd7-9244-26679c05df1c");
+
+
public ConceptRelationshipType() {
super();
}
super(term, label, symmetric, transitive);
}
- public static final ConceptRelationshipType getUUID(String uuid){
+ public static final ConceptRelationshipType getUUID(UUID uuid){
return (ConceptRelationshipType) findByUuid(uuid);
}
public static final ConceptRelationshipType TAXONOMICALLY_INCLUDED_IN(){
- return getUUID("d13fecdf-eb44-4dd7-9244-26679c05df1c");
+ return getUUID(uuidTaxonomicallyIncludedIn);
}
public static final ConceptRelationshipType MISAPPLIED_NAME_FOR(){
\r
import java.io.Serializable;\r
import java.util.List;\r
+import java.util.UUID;\r
\r
import org.apache.log4j.Logger;\r
import org.hibernate.Criteria;\r
logger.debug("Creating DAO of type [" + type.getSimpleName() + "]");\r
}\r
\r
- public String saveCdmObj(CdmBase cdmObj) throws DataAccessException {\r
+ public UUID saveCdmObj(CdmBase cdmObj) throws DataAccessException {\r
getSession().saveOrUpdate(cdmObj);\r
return cdmObj.getUuid();\r
}\r
\r
- public String saveOrUpdate(T transientObject) throws DataAccessException {\r
+ public UUID saveOrUpdate(T transientObject) throws DataAccessException {\r
getSession().saveOrUpdate(transientObject);\r
return transientObject.getUuid();\r
}\r
\r
- public String save(T newInstance) throws DataAccessException {\r
+ public UUID save(T newInstance) throws DataAccessException {\r
getSession().save(newInstance);\r
return newInstance.getUuid();\r
}\r
\r
- public String update(T transientObject) throws DataAccessException {\r
+ public UUID update(T transientObject) throws DataAccessException {\r
getSession().update(transientObject);\r
return transientObject.getUuid();\r
}\r
\r
- public String delete(T persistentObject) throws DataAccessException {\r
+ public UUID delete(T persistentObject) throws DataAccessException {\r
getSession().delete(persistentObject);\r
return persistentObject.getUuid();\r
}\r
return (T) getSession().get(type, id);\r
}\r
\r
- public T findByUuid(String uuid) throws DataAccessException{\r
+ public T findByUuid(UUID uuid) throws DataAccessException{\r
Session session = getSession();\r
-// logger.debug("BEGIN TRANSACTION");\r
-// session.beginTransaction();\r
- Transaction tx = session.getTransaction();\r
\r
Criteria crit = session.createCriteria(type);\r
crit.add(Restrictions.eq("uuid", uuid));\r
crit.addOrder(Order.desc("created"));\r
List<T> results = crit.list();\r
-// logger.debug("COMMIT TRANSACTION");\r
-// tx.commit();\r
- Object o = tx;\r
if (results.isEmpty()){\r
return null;\r
}else{\r
}\r
}\r
\r
- public Boolean exists(String uuid) {\r
+ public Boolean exists(UUID uuid) {\r
if (findByUuid(uuid)==null){\r
return false;\r
}\r
import java.io.Serializable;
import java.util.List;
+import java.util.UUID;
import org.apache.log4j.Logger;
import org.springframework.dao.DataAccessException;
*/
public interface ICdmEntityDao<T extends CdmBase> {
- public String saveOrUpdate(T transientObject) throws DataAccessException;
+ public UUID saveOrUpdate(T transientObject) throws DataAccessException;
- public String save(T newOrManagedObject) throws DataAccessException;
+ public UUID save(T newOrManagedObject) throws DataAccessException;
- public String update(T transientObject) throws DataAccessException;
+ public UUID update(T transientObject) throws DataAccessException;
- public String delete(T persistentObject) throws DataAccessException;
+ public UUID delete(T persistentObject) throws DataAccessException;
public List<T> list(int limit, int start) throws DataAccessException;
public T findById(int id) throws DataAccessException;
- public T findByUuid(String Uuid) throws DataAccessException;
+ public T findByUuid(UUID Uuid) throws DataAccessException;
- public Boolean exists(String uuid) throws DataAccessException;
+ public Boolean exists(UUID uuid) throws DataAccessException;
}
package eu.etaxonomy.cdm.persistence.dao.common;
-import java.util.List;
+import java.util.UUID;
import org.springframework.dao.DataAccessException;
public interface ICdmGenericDao {
- public String saveOrUpdate(CdmBase transientObject) throws DataAccessException;
+ public UUID saveOrUpdate(CdmBase transientObject) throws DataAccessException;
- public String save(CdmBase newOrManagedObject) throws DataAccessException;
+ public UUID save(CdmBase newOrManagedObject) throws DataAccessException;
- public String update(CdmBase transientObject) throws DataAccessException;
+ public UUID update(CdmBase transientObject) throws DataAccessException;
- public String delete(CdmBase persistentObject) throws DataAccessException;
+ public UUID delete(CdmBase persistentObject) throws DataAccessException;
}
package eu.etaxonomy.cdm.persistence.dao.common;
-import org.springframework.dao.DataAccessException;
-
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
-import eu.etaxonomy.cdm.model.common.TermVocabulary;
+
public interface IDefinedTermDao extends ICdmEntityDao<DefinedTermBase>, ITitledDao<DefinedTermBase>{
}