Java 类org.hibernate.EntityNameResolver 实例源码

项目:lams    文件:SessionImpl.java   
@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();
}
项目:lams    文件:SessionFactoryImpl.java   
private void registerEntityNameResolvers(EntityTuplizer tuplizer) {
    EntityNameResolver[] resolvers = tuplizer.getEntityNameResolvers();
    if ( resolvers == null ) {
        return;
    }

    for ( EntityNameResolver resolver : resolvers ) {
        registerEntityNameResolver( resolver );
    }
}
项目:lams    文件:AnyType.java   
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 );
}
项目:hibernate-dynamic-dialects    文件:SessionFactoryImpl.java   
private void registerEntityNameResolvers(EntityTuplizer tuplizer) {
    EntityNameResolver[] resolvers = tuplizer.getEntityNameResolvers();
    if (resolvers == null) {
        return;
    }

    for (EntityNameResolver resolver : resolvers) {
        registerEntityNameResolver(resolver);
    }
}
项目:lemon    文件:SessionFactoryWrapper.java   
public Iterable<EntityNameResolver> iterateEntityNameResolvers() {
    return sessionFactoryImplementor.iterateEntityNameResolvers();
}
项目:lams    文件:DynamicMapEntityTuplizer.java   
@Override
public EntityNameResolver[] getEntityNameResolvers() {
    return new EntityNameResolver[] { BasicEntityNameResolver.INSTANCE };
}
项目:lams    文件:PojoEntityTuplizer.java   
@Override
public EntityNameResolver[] getEntityNameResolvers() {
    return null;
}
项目:lams    文件:SessionFactoryImpl.java   
public void registerEntityNameResolver(EntityNameResolver resolver) {
    entityNameResolvers.put( resolver, ENTITY_NAME_RESOLVER_MAP_VALUE );
}
项目:lams    文件:SessionFactoryImpl.java   
@Override
public Iterable<EntityNameResolver> iterateEntityNameResolvers() {
    return entityNameResolvers.keySet();
}
项目:openbravo-brazil    文件:OBDynamicTuplizer.java   
@Override
public EntityNameResolver[] getEntityNameResolvers() {
  return null;
}
项目:Lucee4    文件:AbstractEntityTuplizerImpl.java   
@Override
public EntityNameResolver[] getEntityNameResolvers() {
    return new EntityNameResolver[] { CFCEntityNameResolver.INSTANCE };
}
项目:hibernate-dynamic-dialects    文件:SessionFactoryImpl.java   
public void registerEntityNameResolver(EntityNameResolver resolver) {
    entityNameResolvers.put(resolver, ENTITY_NAME_RESOLVER_MAP_VALUE);
}
项目:hibernate-dynamic-dialects    文件:SessionFactoryImpl.java   
public Iterable<EntityNameResolver> iterateEntityNameResolvers() {
    return entityNameResolvers.keySet();
}
项目:lams    文件:EntityTuplizer.java   
/**
 * Get any {@link EntityNameResolver EntityNameResolvers} associated with this {@link Tuplizer}.
 *
 * @return The associated resolvers.  May be null or empty.
 */
public EntityNameResolver[] getEntityNameResolvers();
项目:lams    文件:SessionFactoryImplementor.java   
Iterable<EntityNameResolver> iterateEntityNameResolvers();