1 package org.hibernate.tuple; 3 4 import org.hibernate.engine.IdentifierValue; 5 import org.hibernate.id.IdentifierGenerator; 6 import org.hibernate.id.PostInsertIdentifierGenerator; 7 import org.hibernate.type.Type; 8 9 15 public class IdentifierProperty extends Property { 16 17 private boolean virtual; 18 private boolean embedded; 19 private IdentifierValue unsavedValue; 20 private IdentifierGenerator identifierGenerator; 21 private boolean identifierAssignedByInsert; 22 23 36 public IdentifierProperty( 37 String name, 38 String node, 39 Type type, 40 boolean embedded, 41 IdentifierValue unsavedValue, 42 IdentifierGenerator identifierGenerator) { 43 super(name, node, type); 44 this.virtual = false; 45 this.embedded = embedded; 46 this.unsavedValue = unsavedValue; 47 this.identifierGenerator = identifierGenerator; 48 this.identifierAssignedByInsert = identifierGenerator instanceof PostInsertIdentifierGenerator; 49 } 50 51 60 public IdentifierProperty( 61 Type type, 62 boolean embedded, 63 IdentifierValue unsavedValue, 64 IdentifierGenerator identifierGenerator) { 65 super(null, null, type); 66 this.virtual = true; 67 this.embedded = embedded; 68 this.unsavedValue = unsavedValue; 69 this.identifierGenerator = identifierGenerator; 70 this.identifierAssignedByInsert = identifierGenerator instanceof PostInsertIdentifierGenerator; 71 } 72 73 public boolean isVirtual() { 74 return virtual; 75 } 76 77 public boolean isEmbedded() { 78 return embedded; 79 } 80 81 public IdentifierValue getUnsavedValue() { 82 return unsavedValue; 83 } 84 85 public IdentifierGenerator getIdentifierGenerator() { 86 return identifierGenerator; 87 } 88 89 public boolean isIdentifierAssignedByInsert() { 90 return identifierAssignedByInsert; 91 } 92 } 93 | Popular Tags |