Methods Summary |
---|
private void | checkAbilityToSerialize()
// The unique property value represented here may or may not be
// serializable, so we do an explicit check here in order to generate
// a better error message
if ( key != null && ! Serializable.class.isAssignableFrom( key.getClass() ) ) {
throw new IllegalStateException(
"Cannot serialize an EntityUniqueKey which represents a non " +
"serializable property value [" + entityName + "." + uniqueKeyName + "]"
);
}
|
static org.hibernate.engine.EntityUniqueKey | deserialize(java.io.ObjectInputStream ois, SessionImplementor session)Custom deserialization routine used during deserialization of a
Session/PersistenceContext for increased performance.
return new EntityUniqueKey(
( String ) ois.readObject(),
( String ) ois.readObject(),
ois.readObject(),
( Type ) ois.readObject(),
( EntityMode ) ois.readObject(),
session.getFactory()
);
|
public boolean | equals(java.lang.Object other)
EntityUniqueKey that = (EntityUniqueKey) other;
return that.entityName.equals(entityName) &&
that.uniqueKeyName.equals(uniqueKeyName) &&
keyType.isEqual(that.key, key, entityMode);
|
public int | generateHashCode(SessionFactoryImplementor factory)
int result = 17;
result = 37 * result + entityName.hashCode();
result = 37 * result + uniqueKeyName.hashCode();
result = 37 * result + keyType.getHashCode(key, entityMode, factory);
return result;
|
public java.lang.String | getEntityName()
return entityName;
|
public java.lang.Object | getKey()
return key;
|
public java.lang.String | getUniqueKeyName()
return uniqueKeyName;
|
public int | hashCode()
return hashCode;
|
void | serialize(java.io.ObjectOutputStream oos)Custom serialization routine used during serialization of a
Session/PersistenceContext for increased performance.
checkAbilityToSerialize();
oos.writeObject( uniqueKeyName );
oos.writeObject( entityName );
oos.writeObject( key );
oos.writeObject( keyType );
oos.writeObject( entityMode );
|
public java.lang.String | toString()
return "EntityUniqueKey" + MessageHelper.infoString(entityName, uniqueKeyName, key);
|
private void | writeObject(java.io.ObjectOutputStream oos)
checkAbilityToSerialize();
oos.defaultWriteObject();
|