01: package com.bm.introspectors;
02:
03: import javax.persistence.EmbeddedId;
04: import javax.persistence.GeneratedValue;
05: import javax.persistence.Id;
06:
07: /**
08: * This class represents informations about PK fields.
09: *
10: * @author Daniel Wiese
11: *
12: */
13: public class PrimaryKeyInfo {
14:
15: private GeneratedValue genValue;
16:
17: private final Id idValue;
18:
19: private final EmbeddedId embeddedIDValue;
20:
21: /**
22: * Default constructor.
23: *
24: * @param id -
25: * the generator type
26: */
27: public PrimaryKeyInfo(Id id) {
28: this .idValue = id;
29: this .embeddedIDValue = null;
30: }
31:
32: /**
33: * Default constructor.
34: *
35: * @param id -
36: * the generator type
37: */
38: public PrimaryKeyInfo(EmbeddedId id) {
39: this .embeddedIDValue = id;
40: this .idValue = null;
41: }
42:
43: /**
44: * Returns the genType.
45: *
46: * @return Returns the genType.
47: */
48: public GeneratedValue getGenValue() {
49: return genValue;
50: }
51:
52: /**
53: * Returns the id.
54: *
55: * @return the id
56: */
57: public Id getIDValue() {
58: return this .idValue;
59: }
60:
61: /**
62: * Sets the gen value.
63: * @param genValue - the gen value.
64: */
65: public void setGenValue(GeneratedValue genValue) {
66: this .genValue = genValue;
67: }
68:
69: /**
70: * Returns the embeddedIDValue.
71: * @return Returns the embeddedIDValue.
72: */
73: public EmbeddedId getEmbeddedIDValue() {
74: return embeddedIDValue;
75: }
76:
77: }
|