Revision b68853e5
Added by Andreas Müller almost 3 years ago
cdmlib-api/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
|
|
4 |
<parent> |
|
5 |
<groupId>eu.etaxonomy</groupId> |
|
6 |
<artifactId>cdmlib-parent</artifactId> |
|
7 |
<version>5.29.0-SNAPSHOT</version> |
|
8 |
<relativePath>../pom.xml</relativePath> |
|
9 |
</parent> |
|
10 |
|
|
11 |
<modelVersion>4.0.0</modelVersion> |
|
12 |
<artifactId>cdmlib-api</artifactId> |
|
13 |
<name>CDM API</name> |
|
14 |
<description>CDM API</description> |
|
15 |
|
|
16 |
<build> |
|
17 |
<plugins> |
|
18 |
</plugins> |
|
19 |
</build> |
|
20 |
|
|
21 |
<dependencies> |
|
22 |
<dependency> |
|
23 |
<groupId>eu.etaxonomy</groupId> |
|
24 |
<artifactId>cdmlib-model</artifactId> |
|
25 |
</dependency> |
|
26 |
</dependencies> |
|
27 |
|
|
28 |
</project> |
cdmlib-api/src/main/java/eu/etaxonomy/cdm/persistence/dto/UuidAndTitleCache.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2007 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
|
|
10 |
package eu.etaxonomy.cdm.persistence.dto; |
|
11 |
|
|
12 |
import java.io.Serializable; |
|
13 |
import java.util.UUID; |
|
14 |
|
|
15 |
import org.apache.log4j.Logger; |
|
16 |
|
|
17 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
|
18 |
|
|
19 |
/** |
|
20 |
* @author n.hoffmann |
|
21 |
* @since Aug 14, 2009 |
|
22 |
*/ |
|
23 |
public class UuidAndTitleCache<T extends ICdmBase> implements Serializable { |
|
24 |
|
|
25 |
private static final long serialVersionUID = 3446993458279371682L; |
|
26 |
|
|
27 |
@SuppressWarnings("unused") |
|
28 |
private static final Logger logger = Logger .getLogger(UuidAndTitleCache.class); |
|
29 |
|
|
30 |
private Class<? extends T> type; |
|
31 |
final private UUID uuid; |
|
32 |
private Integer id; |
|
33 |
private String titleCache; |
|
34 |
private String abbrevTitleCache; |
|
35 |
private boolean isProtectedTitleCache = true; |
|
36 |
|
|
37 |
private boolean isOrphaned; |
|
38 |
|
|
39 |
public UuidAndTitleCache(UUID uuid, Integer id, String titleCache, String abbrevTitleCache) { |
|
40 |
this.uuid = uuid; |
|
41 |
this.setTitleCache(titleCache); |
|
42 |
this.id = id; |
|
43 |
this.abbrevTitleCache = abbrevTitleCache; |
|
44 |
} |
|
45 |
|
|
46 |
public UuidAndTitleCache(UUID uuid, Integer id, String titleCache) { |
|
47 |
this.uuid = uuid; |
|
48 |
this.setTitleCache(titleCache); |
|
49 |
this.id = id; |
|
50 |
this.abbrevTitleCache = null; |
|
51 |
} |
|
52 |
|
|
53 |
public UuidAndTitleCache(Class<? extends T> type, UUID uuid, Integer id, String titleCache, String abbrevTitleCache) { |
|
54 |
this(uuid, id, titleCache, abbrevTitleCache); |
|
55 |
this.type = type; |
|
56 |
this.isOrphaned = false; |
|
57 |
} |
|
58 |
|
|
59 |
public UuidAndTitleCache(Class<? extends T> type, UUID uuid, Integer id, String titleCache) { |
|
60 |
this(uuid, id, titleCache, null); |
|
61 |
this.type = type; |
|
62 |
this.isOrphaned = false; |
|
63 |
} |
|
64 |
|
|
65 |
public UuidAndTitleCache(Class<? extends T> type, UUID uuid, Integer id, String titleCache, Boolean isOrphaned, String abbrevTitleCache) { |
|
66 |
this(type, uuid, id, titleCache, abbrevTitleCache); |
|
67 |
this.isOrphaned = isOrphaned; |
|
68 |
} |
|
69 |
|
|
70 |
public UuidAndTitleCache(UUID uuid, String titleCache) { |
|
71 |
this( uuid, null, titleCache); |
|
72 |
} |
|
73 |
|
|
74 |
// ******************* GETTER / SETTER **********************/ |
|
75 |
|
|
76 |
public String getTitleCache() { |
|
77 |
return titleCache; |
|
78 |
} |
|
79 |
public void setTitleCache(String titleCache) { |
|
80 |
this.titleCache = titleCache; |
|
81 |
} |
|
82 |
|
|
83 |
public String getAbbrevTitleCache() { |
|
84 |
return abbrevTitleCache; |
|
85 |
} |
|
86 |
public void setAbbrevTitleCache(String abbrevTitleCache) { |
|
87 |
this.abbrevTitleCache = abbrevTitleCache; |
|
88 |
} |
|
89 |
|
|
90 |
public boolean isProtectedTitleCache() { |
|
91 |
return isProtectedTitleCache; |
|
92 |
} |
|
93 |
public void setProtectedTitleCache(boolean isProtectedTitleCache) { |
|
94 |
this.isProtectedTitleCache = isProtectedTitleCache; |
|
95 |
} |
|
96 |
|
|
97 |
public UUID getUuid() { |
|
98 |
return uuid; |
|
99 |
} |
|
100 |
|
|
101 |
public Integer getId() { |
|
102 |
return id; |
|
103 |
} |
|
104 |
|
|
105 |
public Class<? extends T> getType(){ |
|
106 |
return type; |
|
107 |
} |
|
108 |
|
|
109 |
public boolean getIsOrphaned() { |
|
110 |
return this.isOrphaned; |
|
111 |
} |
|
112 |
|
|
113 |
public void setType(Class<T> type) { |
|
114 |
this.type = type; |
|
115 |
} |
|
116 |
|
|
117 |
//************************** toString **********************************/ |
|
118 |
|
|
119 |
@Override |
|
120 |
public String toString() { |
|
121 |
return "UuidAndTitleCache [type= " + type + ", uuid= " + uuid + ", id=" + id + ", titleCache= " + getTitleCache() |
|
122 |
+ ", isOrphaned=" + isOrphaned + ", abbrevTitleCache= " + abbrevTitleCache +"]"; |
|
123 |
} |
|
124 |
} |
cdmlib-persistence/pom.xml | ||
---|---|---|
38 | 38 |
<groupId>eu.etaxonomy</groupId> |
39 | 39 |
<artifactId>cdmlib-model</artifactId> |
40 | 40 |
</dependency> |
41 |
<dependency> |
|
42 |
<groupId>eu.etaxonomy</groupId> |
|
43 |
<artifactId>cdmlib-api</artifactId> |
|
44 |
</dependency> |
|
41 | 45 |
<dependency> |
42 | 46 |
<groupId>org.javassist</groupId> |
43 | 47 |
<artifactId>javassist</artifactId> |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dto/UuidAndTitleCache.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2007 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
|
|
10 |
package eu.etaxonomy.cdm.persistence.dto; |
|
11 |
|
|
12 |
import java.io.Serializable; |
|
13 |
import java.util.UUID; |
|
14 |
|
|
15 |
import org.apache.log4j.Logger; |
|
16 |
|
|
17 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
|
18 |
|
|
19 |
/** |
|
20 |
* @author n.hoffmann |
|
21 |
* @since Aug 14, 2009 |
|
22 |
*/ |
|
23 |
public class UuidAndTitleCache<T extends ICdmBase> implements Serializable { |
|
24 |
|
|
25 |
private static final long serialVersionUID = 3446993458279371682L; |
|
26 |
|
|
27 |
@SuppressWarnings("unused") |
|
28 |
private static final Logger logger = Logger .getLogger(UuidAndTitleCache.class); |
|
29 |
|
|
30 |
private Class<? extends T> type; |
|
31 |
final private UUID uuid; |
|
32 |
private Integer id; |
|
33 |
private String titleCache; |
|
34 |
private String abbrevTitleCache; |
|
35 |
private boolean isProtectedTitleCache = true; |
|
36 |
|
|
37 |
private boolean isOrphaned; |
|
38 |
|
|
39 |
public UuidAndTitleCache(UUID uuid, Integer id, String titleCache, String abbrevTitleCache) { |
|
40 |
this.uuid = uuid; |
|
41 |
this.setTitleCache(titleCache); |
|
42 |
this.id = id; |
|
43 |
this.abbrevTitleCache = abbrevTitleCache; |
|
44 |
} |
|
45 |
|
|
46 |
public UuidAndTitleCache(UUID uuid, Integer id, String titleCache) { |
|
47 |
this.uuid = uuid; |
|
48 |
this.setTitleCache(titleCache); |
|
49 |
this.id = id; |
|
50 |
this.abbrevTitleCache = null; |
|
51 |
} |
|
52 |
|
|
53 |
public UuidAndTitleCache(Class<? extends T> type, UUID uuid, Integer id, String titleCache, String abbrevTitleCache) { |
|
54 |
this(uuid, id, titleCache, abbrevTitleCache); |
|
55 |
this.type = type; |
|
56 |
this.isOrphaned = false; |
|
57 |
} |
|
58 |
|
|
59 |
public UuidAndTitleCache(Class<? extends T> type, UUID uuid, Integer id, String titleCache) { |
|
60 |
this(uuid, id, titleCache, null); |
|
61 |
this.type = type; |
|
62 |
this.isOrphaned = false; |
|
63 |
} |
|
64 |
|
|
65 |
public UuidAndTitleCache(Class<? extends T> type, UUID uuid, Integer id, String titleCache, Boolean isOrphaned, String abbrevTitleCache) { |
|
66 |
this(type, uuid, id, titleCache, abbrevTitleCache); |
|
67 |
this.isOrphaned = isOrphaned; |
|
68 |
} |
|
69 |
|
|
70 |
public UuidAndTitleCache(UUID uuid, String titleCache) { |
|
71 |
this( uuid, null, titleCache); |
|
72 |
} |
|
73 |
|
|
74 |
// ******************* GETTER / SETTER **********************/ |
|
75 |
|
|
76 |
public String getTitleCache() { |
|
77 |
return titleCache; |
|
78 |
} |
|
79 |
public void setTitleCache(String titleCache) { |
|
80 |
this.titleCache = titleCache; |
|
81 |
} |
|
82 |
|
|
83 |
public String getAbbrevTitleCache() { |
|
84 |
return abbrevTitleCache; |
|
85 |
} |
|
86 |
public void setAbbrevTitleCache(String abbrevTitleCache) { |
|
87 |
this.abbrevTitleCache = abbrevTitleCache; |
|
88 |
} |
|
89 |
|
|
90 |
public boolean isProtectedTitleCache() { |
|
91 |
return isProtectedTitleCache; |
|
92 |
} |
|
93 |
public void setProtectedTitleCache(boolean isProtectedTitleCache) { |
|
94 |
this.isProtectedTitleCache = isProtectedTitleCache; |
|
95 |
} |
|
96 |
|
|
97 |
public UUID getUuid() { |
|
98 |
return uuid; |
|
99 |
} |
|
100 |
|
|
101 |
public Integer getId() { |
|
102 |
return id; |
|
103 |
} |
|
104 |
|
|
105 |
public Class<? extends T> getType(){ |
|
106 |
return type; |
|
107 |
} |
|
108 |
|
|
109 |
public boolean getIsOrphaned() { |
|
110 |
return this.isOrphaned; |
|
111 |
} |
|
112 |
|
|
113 |
public void setType(Class<T> type) { |
|
114 |
this.type = type; |
|
115 |
} |
|
116 |
|
|
117 |
//************************** toString **********************************/ |
|
118 |
|
|
119 |
@Override |
|
120 |
public String toString() { |
|
121 |
return "UuidAndTitleCache [type= " + type + ", uuid= " + uuid + ", id=" + id + ", titleCache= " + getTitleCache() |
|
122 |
+ ", isOrphaned=" + isOrphaned + ", abbrevTitleCache= " + abbrevTitleCache +"]"; |
|
123 |
} |
|
124 |
} |
pom.xml | ||
---|---|---|
11 | 11 |
<packaging>pom</packaging> |
12 | 12 |
<modules> |
13 | 13 |
<module>cdmlib-commons</module> |
14 |
|
|
15 | 14 |
<module>cdmlib-model</module> |
16 |
<module>cdmlib-db</module> |
|
15 |
<module>cdmlib-api</module> |
|
16 |
<module>cdmlib-db</module> |
|
17 | 17 |
<module>cdmlib-test</module> |
18 | 18 |
<module>cdmlib-persistence</module> |
19 | 19 |
<module>cdmlib-services</module> |
... | ... | |
612 | 612 |
<artifactId>cdmlib-model</artifactId> |
613 | 613 |
<version>${project.version}</version> |
614 | 614 |
</dependency> |
615 |
<dependency> |
|
616 |
<groupId>eu.etaxonomy</groupId> |
|
617 |
<artifactId>cdmlib-api</artifactId> |
|
618 |
<version>${project.version}</version> |
|
619 |
</dependency> |
|
615 | 620 |
<dependency> |
616 | 621 |
<groupId>eu.etaxonomy</groupId> |
617 | 622 |
<artifactId>cdmlib-persistence</artifactId> |
Also available in: Unified diff
ref #9886 first implementation for cdmlib-api with only UuidAndTitleCache moved to new module