Methods Summary |
---|
public java.lang.Object | assemble(java.io.Serializable cached, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
ObjectTypeCacheEntry e = (ObjectTypeCacheEntry) cached;
return e==null ? null : session.internalLoad(e.entityName, e.id, false, false);
|
public int | compare(java.lang.Object x, java.lang.Object y, org.hibernate.EntityMode entityMode)
return 0; //TODO: entities CAN be compared, by PK and entity name, fix this!
|
public java.lang.Object | deepCopy(java.lang.Object value, org.hibernate.EntityMode entityMode, org.hibernate.engine.SessionFactoryImplementor factory)
return value;
|
public java.io.Serializable | disassemble(java.lang.Object value, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
return value==null ?
null :
new ObjectTypeCacheEntry(
session.bestGuessEntityName(value),
ForeignKeys.getEntityIdentifierIfNotUnsaved(
session.bestGuessEntityName(value), value, session
)
);
|
public java.lang.Object | fromXMLNode(org.dom4j.Node xml, org.hibernate.engine.Mapping factory)
throw new UnsupportedOperationException(); //TODO: is this right??
|
public java.lang.String | getAssociatedEntityName(org.hibernate.engine.SessionFactoryImplementor factory)
throw new UnsupportedOperationException("any types do not have a unique referenced persister");
|
public org.hibernate.persister.entity.Joinable | getAssociatedJoinable(org.hibernate.engine.SessionFactoryImplementor factory)
throw new UnsupportedOperationException("any types do not have a unique referenced persister");
|
public org.hibernate.engine.CascadeStyle | getCascadeStyle(int i)
return CascadeStyle.NONE;
|
public int | getColumnSpan(org.hibernate.engine.Mapping session)
return 2;
|
public org.hibernate.FetchMode | getFetchMode(int i)
return FetchMode.SELECT;
|
public ForeignKeyDirection | getForeignKeyDirection()
//return AssociationType.FOREIGN_KEY_TO_PARENT; //this is better but causes a transient object exception...
return ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT;
|
private java.io.Serializable | getIdentifier(java.lang.Object value, org.hibernate.engine.SessionImplementor session)
try {
return ForeignKeys.getEntityIdentifierIfNotUnsaved( session.bestGuessEntityName(value), value, session );
}
catch (TransientObjectException toe) {
return null;
}
|
public java.lang.String | getLHSPropertyName()
return null;
|
public java.lang.String | getName()
return "object";
|
public java.lang.String | getOnCondition(java.lang.String alias, org.hibernate.engine.SessionFactoryImplementor factory, java.util.Map enabledFilters)
throw new UnsupportedOperationException();
|
public java.lang.String[] | getPropertyNames()
return PROPERTY_NAMES;
|
public boolean[] | getPropertyNullability()
return null;
|
public java.lang.Object | getPropertyValue(java.lang.Object component, int i, org.hibernate.engine.SessionImplementor session)
return i==0 ?
session.bestGuessEntityName(component) :
getIdentifier(component, session);
|
public java.lang.Object[] | getPropertyValues(java.lang.Object component, org.hibernate.engine.SessionImplementor session)
return new Object[] { session.bestGuessEntityName(component), getIdentifier(component, session) };
|
public java.lang.Object[] | getPropertyValues(java.lang.Object component, org.hibernate.EntityMode entityMode)
throw new UnsupportedOperationException();
|
public java.lang.String | getRHSUniqueKeyPropertyName()
return null;
|
public java.lang.Class | getReturnedClass()
return Object.class;
|
public Type[] | getSubtypes()
return new Type[] { metaType, identifierType };
|
public java.lang.Object | hydrate(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
String entityName = (String) metaType.nullSafeGet(rs, names[0], session, owner);
Serializable id = (Serializable) identifierType.nullSafeGet(rs, names[1], session, owner);
return new ObjectTypeCacheEntry(entityName, id);
|
public boolean | isAlwaysDirtyChecked()
return false;
|
public boolean | isAnyType()
return true;
|
public boolean | isAssociationType()
return true;
|
public boolean | isComponentType()
return true;
|
public boolean | isDirty(java.lang.Object old, java.lang.Object current, boolean[] checkable, org.hibernate.engine.SessionImplementor session)
//TODO!!!
return isDirty(old, current, session);
|
public boolean | isEmbedded()
return false;
|
public boolean | isEmbeddedInXML()
return false;
|
public boolean | isMethodOf(java.lang.reflect.Method method)
return false;
|
public boolean | isModified(java.lang.Object old, java.lang.Object current, boolean[] checkable, org.hibernate.engine.SessionImplementor session)
if (current==null) return old!=null;
if (old==null) return current!=null;
ObjectTypeCacheEntry holder = (ObjectTypeCacheEntry) old;
boolean[] idcheckable = new boolean[checkable.length-1];
System.arraycopy(checkable, 1, idcheckable, 0, idcheckable.length);
return ( checkable[0] && !holder.entityName.equals( session.bestGuessEntityName(current) ) ) ||
identifierType.isModified(holder.id, getIdentifier(current, session), idcheckable, session);
|
public boolean | isMutable()
return false;
|
public boolean | isReferenceToPrimaryKey()
return true;
|
public boolean | isSame(java.lang.Object x, java.lang.Object y, org.hibernate.EntityMode entityMode)
return x==y;
|
public java.lang.Object | nullSafeGet(java.sql.ResultSet rs, java.lang.String name, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
throw new UnsupportedOperationException("object is a multicolumn type");
|
public java.lang.Object | nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
return resolveAny(
(String) metaType.nullSafeGet(rs, names[0], session, owner),
(Serializable) identifierType.nullSafeGet(rs, names[1], session, owner),
session
);
|
public void | nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, org.hibernate.engine.SessionImplementor session)
nullSafeSet(st, value, index, null, session);
|
public void | nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, boolean[] settable, org.hibernate.engine.SessionImplementor session)
Serializable id;
String entityName;
if (value==null) {
id=null;
entityName=null;
}
else {
entityName = session.bestGuessEntityName(value);
id = ForeignKeys.getEntityIdentifierIfNotUnsaved(entityName, value, session);
}
// metaType is assumed to be single-column type
if ( settable==null || settable[0] ) {
metaType.nullSafeSet(st, entityName, index, session);
}
if (settable==null) {
identifierType.nullSafeSet(st, id, index+1, session);
}
else {
boolean[] idsettable = new boolean[ settable.length-1 ];
System.arraycopy(settable, 1, idsettable, 0, idsettable.length);
identifierType.nullSafeSet(st, id, index+1, idsettable, session);
}
|
public java.lang.Object | replace(java.lang.Object original, java.lang.Object target, org.hibernate.engine.SessionImplementor session, java.lang.Object owner, java.util.Map copyCache)
if (original==null) {
return null;
}
else {
String entityName = session.bestGuessEntityName(original);
Serializable id = ForeignKeys.getEntityIdentifierIfNotUnsaved(
entityName,
original,
session
);
return session.internalLoad(
entityName,
id,
false,
false
);
}
|
public java.lang.Object | resolve(java.lang.Object value, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
ObjectTypeCacheEntry holder = (ObjectTypeCacheEntry) value;
return resolveAny(holder.entityName, holder.id, session);
|
private java.lang.Object | resolveAny(java.lang.String entityName, java.io.Serializable id, org.hibernate.engine.SessionImplementor session)
return entityName==null || id==null ?
null : session.internalLoad( entityName, id, false, false );
|
public java.lang.Object | semiResolve(java.lang.Object value, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
throw new UnsupportedOperationException("any mappings may not form part of a property-ref");
|
public void | setPropertyValues(java.lang.Object component, java.lang.Object[] values, org.hibernate.EntityMode entityMode)
throw new UnsupportedOperationException();
|
public void | setToXMLNode(org.dom4j.Node xml, java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)
throw new UnsupportedOperationException("any types cannot be stringified");
|
public int[] | sqlTypes(org.hibernate.engine.Mapping mapping)
return ArrayHelper.join(
metaType.sqlTypes(mapping),
identifierType.sqlTypes(mapping)
);
|
public boolean[] | toColumnNullness(java.lang.Object value, org.hibernate.engine.Mapping mapping)
boolean[] result = new boolean[ getColumnSpan(mapping) ];
if (value!=null) Arrays.fill(result, true);
return result;
|
public java.lang.String | toLoggableString(java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)
//TODO: terrible implementation!
return value==null ?
"null" :
Hibernate.entity( HibernateProxyHelper.getClassWithoutInitializingProxy(value) )
.toLoggableString(value, factory);
|
public boolean | useLHSPrimaryKey()
return false;
|