Uniquely identifies of an entity instance in a particular session by identifier.
Uniqueing information consists of the entity-name and the identifier value.
Method from org.hibernate.engine.EntityKey Detail: |
static EntityKey deserialize(ObjectInputStream ois,
SessionImplementor session) throws IOException, ClassNotFoundException {
return new EntityKey(
( Serializable ) ois.readObject(),
( String ) ois.readObject(),
( String ) ois.readObject(),
( Type ) ois.readObject(),
ois.readBoolean(),
session.getFactory(),
EntityMode.parse( ( String ) ois.readObject() )
);
}
Custom deserialization routine used during deserialization of a
Session/PersistenceContext for increased performance. |
public boolean equals(Object other) {
EntityKey otherKey = (EntityKey) other;
return otherKey.rootEntityName.equals(this.rootEntityName) &&
identifierType.isEqual(otherKey.identifier, this.identifier, entityMode, factory);
}
|
public String getEntityName() {
return entityName;
}
|
public Serializable getIdentifier() {
return identifier;
}
Get the user-visible identifier |
public int hashCode() {
return hashCode;
}
|
public boolean isBatchLoadable() {
return isBatchLoadable;
}
|
void serialize(ObjectOutputStream oos) throws IOException {
oos.writeObject( identifier );
oos.writeObject( rootEntityName );
oos.writeObject( entityName );
oos.writeObject( identifierType );
oos.writeBoolean( isBatchLoadable );
oos.writeObject( entityMode.toString() );
}
Custom serialization routine used during serialization of a
Session/PersistenceContext for increased performance. |
public String toString() {
return "EntityKey" +
MessageHelper.infoString( factory.getEntityPersister( entityName ), identifier, factory );
}
|