1 package org.hibernate.persister.entity; 3 4 import java.io.Serializable ; 5 import java.util.Map ; 6 7 import org.hibernate.HibernateException; 8 import org.hibernate.LockMode; 9 import org.hibernate.MappingException; 10 import org.hibernate.EntityMode; 11 import org.hibernate.cache.CacheConcurrencyStrategy; 12 import org.hibernate.cache.entry.CacheEntryStructure; 13 import org.hibernate.engine.CascadeStyle; 14 import org.hibernate.engine.SessionFactoryImplementor; 15 import org.hibernate.engine.SessionImplementor; 16 import org.hibernate.id.IdentifierGenerator; 17 import org.hibernate.metadata.ClassMetadata; 18 import org.hibernate.type.Type; 19 import org.hibernate.type.VersionType; 20 21 30 public interface EntityPersister { 31 32 35 public static final String ENTITY_ID = "id"; 36 37 42 public void postInstantiate() throws MappingException; 43 44 49 public SessionFactoryImplementor getFactory(); 50 51 52 56 61 public String getRootEntityName(); 62 63 66 public String getEntityName(); 67 68 71 public boolean isSubclassEntityName(String entityName); 72 73 77 public Serializable [] getPropertySpaces(); 78 79 83 public Serializable [] getQuerySpaces(); 84 85 88 public boolean hasProxy(); 89 90 93 public boolean hasCollections(); 94 95 99 public boolean hasMutableProperties(); 100 101 105 public boolean hasSubselectLoadableCollections(); 106 107 110 public boolean hasCascades(); 111 112 115 public boolean isMutable(); 116 117 120 public boolean isInherited(); 121 122 127 public boolean isIdentifierAssignedByInsert(); 128 129 132 public Type getPropertyType(String propertyName) throws MappingException; 133 134 139 public int[] findDirty(Object [] x, Object [] y, Object owner, SessionImplementor session) 140 throws HibernateException; 141 142 146 public int[] findModified(Object [] old, Object [] current, Object object, SessionImplementor session) 147 throws HibernateException; 148 149 152 public boolean hasIdentifierProperty(); 153 156 public boolean hasIdentifierPropertyOrEmbeddedCompositeIdentifier(); 157 158 161 public boolean isVersioned(); 162 163 166 public VersionType getVersionType(); 167 168 171 public int getVersionProperty(); 172 173 176 public boolean hasNaturalIdentifier(); 177 178 181 public int[] getNaturalIdentifierProperties(); 182 183 186 public IdentifierGenerator getIdentifierGenerator() throws HibernateException; 187 188 191 public Object load(Serializable id, Object optionalObject, LockMode lockMode, SessionImplementor session) 192 throws HibernateException; 193 194 197 public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) 198 throws HibernateException; 199 200 203 public void insert(Serializable id, Object [] fields, Object object, SessionImplementor session) 204 throws HibernateException; 205 206 209 public Serializable insert(Object [] fields, Object object, SessionImplementor session) 210 throws HibernateException; 211 212 215 public void delete(Serializable id, Object version, Object object, SessionImplementor session) 216 throws HibernateException; 217 218 221 public void update( 222 Serializable id, 223 Object [] fields, 224 int[] dirtyFields, 225 boolean hasDirtyCollection, 226 Object [] oldFields, 227 Object oldVersion, 228 Object object, 229 Object rowId, 230 SessionImplementor session 231 ) throws HibernateException; 232 233 236 public Type[] getPropertyTypes(); 237 238 242 public String [] getPropertyNames(); 243 244 248 public boolean[] getPropertyInsertability(); 249 250 254 public boolean[] getPropertyUpdateability(); 255 256 261 public boolean[] getPropertyCheckability(); 262 263 266 public boolean[] getPropertyNullability(); 267 268 272 public boolean[] getPropertyVersionability(); 273 276 public CascadeStyle[] getPropertyCascadeStyles(); 277 278 281 public Type getIdentifierType(); 282 283 287 public String getIdentifierPropertyName(); 288 289 293 public boolean isCacheInvalidationRequired(); 294 297 public boolean hasCache(); 298 301 public CacheConcurrencyStrategy getCache(); 302 305 public CacheEntryStructure getCacheEntryStructure(); 306 307 310 public ClassMetadata getClassMetadata(); 311 312 315 public boolean isBatchLoadable(); 316 317 320 public boolean isSelectBeforeUpdateRequired(); 321 322 327 public Object [] getDatabaseSnapshot(Serializable id, SessionImplementor session) 328 throws HibernateException; 329 330 335 public Object getCurrentVersion(Serializable id, SessionImplementor session) 336 throws HibernateException; 337 338 public EntityMode guessEntityMode(Object object); 339 340 341 345 348 public void afterInitialize(Object entity, boolean lazyPropertiesAreUnfetched, SessionImplementor session); 349 350 353 public void afterReassociate(Object entity, SessionImplementor session); 354 355 358 public Object createProxy(Serializable id, SessionImplementor session) 359 throws HibernateException; 360 361 364 public Boolean isTransient(Object object, SessionImplementor session) throws HibernateException; 365 366 369 public Object [] getPropertyValuesToInsert(Object object, Map mergeMap, SessionImplementor session) throws HibernateException; 370 371 372 376 379 public Class getMappedClass(EntityMode entityMode); 380 381 384 public boolean implementsLifecycle(EntityMode entityMode); 385 386 389 public boolean implementsValidatable(EntityMode entityMode); 390 394 public Class getConcreteProxyClass(EntityMode entityMode); 395 396 399 public void setPropertyValues(Object object, Object [] values, EntityMode entityMode) throws HibernateException; 400 401 404 public void setPropertyValue(Object object, int i, Object value, EntityMode entityMode) throws HibernateException; 405 406 409 public Object [] getPropertyValues(Object object, EntityMode entityMode) throws HibernateException; 410 411 414 public Object getPropertyValue(Object object, int i, EntityMode entityMode) throws HibernateException; 415 416 419 public Object getPropertyValue(Object object, String propertyName, EntityMode entityMode) throws HibernateException; 420 421 424 public Serializable getIdentifier(Object object, EntityMode entityMode) throws HibernateException; 425 426 429 public void setIdentifier(Object object, Serializable id, EntityMode entityMode) throws HibernateException; 430 431 434 public Object getVersion(Object object, EntityMode entityMode) throws HibernateException; 435 436 439 public Object instantiate(Serializable id, EntityMode entityMode) throws HibernateException; 440 441 444 public boolean isInstance(Object object, EntityMode entityMode); 445 446 449 public boolean hasUninitializedLazyProperties(Object object, EntityMode entityMode); 450 451 457 public void resetIdentifier(Object entity, Serializable currentId, Object currentVersion, EntityMode entityMode); 458 459 462 public EntityPersister getSubclassEntityPersister(Object instance, SessionFactoryImplementor factory, EntityMode entityMode); 463 } 464 | Popular Tags |