Methods Summary |
---|
public java.lang.Object | deepCopy(java.lang.Object value)Return a deep copy of the persistent state, stopping at
entities and collections.
return (SourceMedia)value;
|
public boolean | equals(java.lang.Object x, java.lang.Object y)Compare two instances of the class mapped by this type for persistence
"equality".
// We can compare instances, since SourceMedia are immutable singletons
return (x == y);
|
public boolean | isMutable()Indicates whether objects managed by this type are mutable.
return false;
|
public java.lang.Object | nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, java.lang.Object owner)Retrieve an instance of the mapped class from a JDBC {@link ResultSet}.
// Start by looking up the value name
String name = (String) Hibernate.STRING.nullSafeGet(rs, names[0]);
if (name == null) {
return null;
}
// Then find the corresponding enumeration value
try {
return SourceMedia.getInstanceByName(name);
}
catch (java.util.NoSuchElementException e) {
throw new HibernateException("Bad SourceMedia value: " + name, e);
}
|
public void | nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index)Write an instance of the mapped class to a {@link PreparedStatement},
handling null values.
String name = null;
if (value != null)
name = ((SourceMedia)value).getName();
Hibernate.STRING.nullSafeSet(st, name, index);
|
public java.lang.Class | returnedClass()Determine the class that is returned by {@link #nullSafeGet}.
return SourceMedia.class;
|
public int[] | sqlTypes()Determine the SQL type(s) of the column(s) used by this type mapping.
// Allocate a new array each time to protect against callers changing
// its contents.
int[] typeList = {
Types.VARCHAR
};
return typeList;
|