1 package org.hibernate.type; 3 4 import java.io.Serializable ; 5 import java.sql.PreparedStatement ; 6 import java.sql.ResultSet ; 7 import java.sql.SQLException ; 8 import java.util.Map ; 9 10 import org.dom4j.Node; 11 import org.hibernate.EntityMode; 12 import org.hibernate.HibernateException; 13 import org.hibernate.MappingException; 14 import org.hibernate.engine.Mapping; 15 import org.hibernate.engine.SessionFactoryImplementor; 16 import org.hibernate.engine.SessionImplementor; 17 18 26 public interface Type extends Serializable { 27 28 35 public boolean isAssociationType(); 36 39 public boolean isCollectionType(); 40 41 49 public boolean isComponentType(); 50 51 55 public boolean isEntityType(); 56 57 63 public boolean isAnyType(); 64 65 public boolean isXMLElement(); 66 67 74 public int[] sqlTypes(Mapping mapping) throws MappingException; 75 76 79 public int getColumnSpan(Mapping mapping) throws MappingException; 80 81 87 public Class getReturnedClass(); 88 89 100 public boolean isSame(Object x, Object y, EntityMode entityMode) throws HibernateException; 101 102 112 public boolean isEqual(Object x, Object y, EntityMode entityMode) throws HibernateException; 113 114 124 public boolean isEqual(Object x, Object y, EntityMode entityMode, SessionFactoryImplementor factory) 125 throws HibernateException; 126 127 132 public int getHashCode(Object x, EntityMode entityMode) throws HibernateException; 133 134 140 public int getHashCode(Object x, EntityMode entityMode, SessionFactoryImplementor factory) 141 throws HibernateException; 142 143 147 public int compare(Object x, Object y, EntityMode entityMode); 148 149 158 public boolean isDirty(Object old, Object current, SessionImplementor session) 159 throws HibernateException; 160 161 168 public boolean isModified(Object oldHydratedState, Object currentState, SessionImplementor session) 169 throws HibernateException; 170 171 184 public Object nullSafeGet(ResultSet rs, String [] names, SessionImplementor session, Object owner) 185 throws HibernateException, SQLException ; 186 187 200 public Object nullSafeGet(ResultSet rs, String name, SessionImplementor session, Object owner) 201 throws HibernateException, SQLException ; 202 203 216 public void nullSafeSet(PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session) 217 throws HibernateException, SQLException ; 218 219 231 public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) 232 throws HibernateException, SQLException ; 233 234 242 public void setToXMLNode(Node node, Object value, SessionFactoryImplementor factory) 243 throws HibernateException; 244 245 253 public String toLoggableString(Object value, SessionFactoryImplementor factory) 254 throws HibernateException; 255 256 264 public Object fromXMLNode(Node xml, Mapping factory) throws HibernateException; 265 266 271 public String getName(); 272 273 281 public Object deepCopy(Object value, EntityMode entityMode, SessionFactoryImplementor factory) 282 throws HibernateException; 283 284 291 public boolean isMutable(); 292 293 300 public Serializable disassemble(Object value, SessionImplementor session, Object owner) throws HibernateException; 301 302 309 public Object assemble(Serializable cached, SessionImplementor session, Object owner) 310 throws HibernateException; 311 312 326 public Object hydrate(ResultSet rs, String [] names, SessionImplementor session, Object owner) 327 throws HibernateException, SQLException ; 328 329 340 public Object resolve(Object value, SessionImplementor session, Object owner) 341 throws HibernateException; 342 343 347 public Object semiResolve(Object value, SessionImplementor session, Object owner) 348 throws HibernateException; 349 350 353 public Type getSemiResolvedType(SessionFactoryImplementor factory); 354 355 366 public Object replace( 367 Object original, 368 Object target, 369 SessionImplementor session, 370 Object owner, 371 Map copyCache) 372 throws HibernateException; 373 374 385 public Object replace( 386 Object original, 387 Object target, 388 SessionImplementor session, 389 Object owner, 390 Map copyCache, 391 ForeignKeyDirection foreignKeyDirection) 392 throws HibernateException; 393 394 400 public boolean[] toColumnNullness(Object value, Mapping mapping); 401 402 } 403 404 405 406 407 408 409 | Popular Tags |