@Override public String resolveEntityName(Object entity) { String entityName = interceptor.getEntityName( entity ); if ( entityName != null ) { return entityName; } for ( EntityNameResolver resolver : factory.iterateEntityNameResolvers() ) { entityName = resolver.resolveEntityName( entity ); if ( entityName != null ) { break; } } if ( entityName != null ) { return entityName; } // the old-time stand-by... return entity.getClass().getName(); }
private void registerEntityNameResolvers(EntityTuplizer tuplizer) { EntityNameResolver[] resolvers = tuplizer.getEntityNameResolvers(); if ( resolvers == null ) { return; } for ( EntityNameResolver resolver : resolvers ) { registerEntityNameResolver( resolver ); } }
private EntityPersister guessEntityPersister(Object object) { if ( scope == null ) { return null; } String entityName = null; // this code is largely copied from Session's bestGuessEntityName Object entity = object; if ( entity instanceof HibernateProxy ) { final LazyInitializer initializer = ( (HibernateProxy) entity ).getHibernateLazyInitializer(); if ( initializer.isUninitialized() ) { entityName = initializer.getEntityName(); } entity = initializer.getImplementation(); } if ( entityName == null ) { for ( EntityNameResolver resolver : scope.resolveFactory().iterateEntityNameResolvers() ) { entityName = resolver.resolveEntityName( entity ); if ( entityName != null ) { break; } } } if ( entityName == null ) { // the old-time stand-by... entityName = object.getClass().getName(); } return scope.resolveFactory().getEntityPersister( entityName ); }
private void registerEntityNameResolvers(EntityTuplizer tuplizer) { EntityNameResolver[] resolvers = tuplizer.getEntityNameResolvers(); if (resolvers == null) { return; } for (EntityNameResolver resolver : resolvers) { registerEntityNameResolver(resolver); } }
public Iterable<EntityNameResolver> iterateEntityNameResolvers() { return sessionFactoryImplementor.iterateEntityNameResolvers(); }
@Override public EntityNameResolver[] getEntityNameResolvers() { return new EntityNameResolver[] { BasicEntityNameResolver.INSTANCE }; }
@Override public EntityNameResolver[] getEntityNameResolvers() { return null; }
public void registerEntityNameResolver(EntityNameResolver resolver) { entityNameResolvers.put( resolver, ENTITY_NAME_RESOLVER_MAP_VALUE ); }
@Override public Iterable<EntityNameResolver> iterateEntityNameResolvers() { return entityNameResolvers.keySet(); }
@Override public EntityNameResolver[] getEntityNameResolvers() { return new EntityNameResolver[] { CFCEntityNameResolver.INSTANCE }; }
public void registerEntityNameResolver(EntityNameResolver resolver) { entityNameResolvers.put(resolver, ENTITY_NAME_RESOLVER_MAP_VALUE); }
public Iterable<EntityNameResolver> iterateEntityNameResolvers() { return entityNameResolvers.keySet(); }
/** * Get any {@link EntityNameResolver EntityNameResolvers} associated with this {@link Tuplizer}. * * @return The associated resolvers. May be null or empty. */ public EntityNameResolver[] getEntityNameResolvers();
Iterable<EntityNameResolver> iterateEntityNameResolvers();