MetaTypepublic class MetaType extends AbstractType
Fields Summary |
---|
private final Map | values | private final Map | keys | private final Type | baseType |
Constructors Summary |
---|
public MetaType(Map values, Type baseType)
this.baseType = baseType;
this.values = values;
keys = new HashMap();
Iterator iter = values.entrySet().iterator();
while ( iter.hasNext() ) {
Map.Entry me = (Map.Entry) iter.next();
keys.put( me.getValue(), me.getKey() );
}
|
Methods Summary |
---|
public java.lang.Object | deepCopy(java.lang.Object value, org.hibernate.EntityMode entityMode, org.hibernate.engine.SessionFactoryImplementor factory)
return value;
| public java.lang.Object | fromXMLNode(org.dom4j.Node xml, org.hibernate.engine.Mapping factory)
return fromXMLString( xml.getText(), factory );
| public java.lang.Object | fromXMLString(java.lang.String xml, org.hibernate.engine.Mapping factory)
return xml; //xml is the entity name
| public int | getColumnSpan(org.hibernate.engine.Mapping mapping)
return baseType.getColumnSpan(mapping);
| public java.lang.String | getName()
return baseType.getName(); //TODO!
| public java.lang.Class | getReturnedClass()
return String.class;
| public boolean | isDirty(java.lang.Object old, java.lang.Object current, boolean[] checkable, org.hibernate.engine.SessionImplementor session)
return checkable[0] && isDirty(old, current, session);
| public boolean | isMutable()
return false;
| public java.lang.Object | nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
Object key = baseType.nullSafeGet(rs, names, session, owner);
return key==null ? null : values.get(key);
| public java.lang.Object | nullSafeGet(java.sql.ResultSet rs, java.lang.String name, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
Object key = baseType.nullSafeGet(rs, name, session, owner);
return key==null ? null : values.get(key);
| public void | nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, org.hibernate.engine.SessionImplementor session)
baseType.nullSafeSet(st, value==null ? null : keys.get(value), index, session);
| public void | nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, boolean[] settable, org.hibernate.engine.SessionImplementor session)
if ( settable[0] ) nullSafeSet(st, value, index, 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)
return original;
| public void | setToXMLNode(org.dom4j.Node node, java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)
node.setText( toXMLString(value, factory) );
| public int[] | sqlTypes(org.hibernate.engine.Mapping mapping)
return baseType.sqlTypes(mapping);
| public boolean[] | toColumnNullness(java.lang.Object value, org.hibernate.engine.Mapping mapping)
throw new UnsupportedOperationException();
| public java.lang.String | toLoggableString(java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)
return toXMLString(value, factory);
| public java.lang.String | toXMLString(java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)
return (String) value; //value is the entity name
|
|