• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EntityMetamodel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.hibernate.tuple.entity.EntityMetamodel的典型用法代码示例。如果您正苦于以下问题:Java EntityMetamodel类的具体用法?Java EntityMetamodel怎么用?Java EntityMetamodel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EntityMetamodel类属于org.hibernate.tuple.entity包,在下文中一共展示了EntityMetamodel类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: fixCompositeIdentifierInMetaModel

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
private static void fixCompositeIdentifierInMetaModel(SessionFactory sessionFactory, Class clazz) {
    ClassMetadata classMetadata = sessionFactory.getClassMetadata(clazz);
    if (classMetadata instanceof AbstractEntityPersister) {
        AbstractEntityPersister persister = (AbstractEntityPersister) classMetadata;
        EntityMetamodel model = persister.getEntityMetamodel();
        IdentifierProperty identifier = model.getIdentifierProperty();

        try {
            Field field = IdentifierProperty.class.getDeclaredField("hasIdentifierMapper");
            field.setAccessible(true);
            field.set(identifier, true);
            field.setAccessible(false);
        } catch (Exception ex) {
            throw new SystemException("Attempt to fix entity meta model with hack failed, reason: "
                    + ex.getMessage(), ex);
        }
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:RUtil.java


示例2: OBDynamicTuplizer

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
public OBDynamicTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {
  super(entityMetamodel, mappedEntity);
  log.debug("Created tuplizer for "
      + (mappedEntity.getMappedClass() != null ? mappedEntity.getMappedClass().getName()
          : mappedEntity.getEntityName()));
  persistentClass = mappedEntity;
}
 
开发者ID:mauyr,项目名称:openbravo-brazil,代码行数:8,代码来源:OBDynamicTuplizer.java


示例3: PojoEntityTuplizer

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
public PojoEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {
		super( entityMetamodel, mappedEntity );
		this.mappedClass = mappedEntity.getMappedClass();
		this.proxyInterface = mappedEntity.getProxyInterface();
		this.lifecycleImplementor = Lifecycle.class.isAssignableFrom( mappedClass );
		this.validatableImplementor = Validatable.class.isAssignableFrom( mappedClass );

		Iterator iter = mappedEntity.getPropertyClosureIterator();
		while ( iter.hasNext() ) {
			Property property = (Property) iter.next();
			if ( property.isLazy() ) {
				lazyPropertyNames.add( property.getName() );
			}
		}

		String[] getterNames = new String[propertySpan];
		String[] setterNames = new String[propertySpan];
		Class[] propTypes = new Class[propertySpan];
		for ( int i = 0; i < propertySpan; i++ ) {
			getterNames[i] = getters[i].getMethodName();
			setterNames[i] = setters[i].getMethodName();
			propTypes[i] = getters[i].getReturnType();
		}

		if ( hasCustomAccessors || !Environment.useReflectionOptimizer() ) {
			optimizer = null;
		}
		else {
			// todo : YUCK!!!
			optimizer = Environment.getBytecodeProvider().getReflectionOptimizer( mappedClass, getterNames, setterNames, propTypes );
//			optimizer = getFactory().getSettings().getBytecodeProvider().getReflectionOptimizer(
//					mappedClass, getterNames, setterNames, propTypes
//			);
		}
	
	}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:37,代码来源:PojoEntityTuplizer.java


示例4: PartCollectionEntityTuplizer

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
/**
 * Default constructor. 
 * @param entityModel entity model class
 * @param persistentClass persistent class
 */
public PartCollectionEntityTuplizer(EntityMetamodel entityModel, PersistentClass persistentClass) {
    super(entityModel, persistentClass);
    propertyNames = new String[propertySpan];
    
    Iterator propertiesIterator = persistentClass.getPropertyIterator();
    
    int count = 0;
    while (propertiesIterator.hasNext()) {
        propertyNames[count++] = ((Property) propertiesIterator.next()).getName();
    }
}
 
开发者ID:NCIP,项目名称:iso21090,代码行数:17,代码来源:PartCollectionEntityTuplizer.java


示例5: getEntityMetamodel

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
public EntityMetamodel getEntityMetamodel() {
	return entityMetamodel;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:AbstractEntityPersister.java


示例6: collectAttributeDefinitions

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
private void collectAttributeDefinitions(
		Map<String,AttributeDefinition> attributeDefinitionsByName,
		EntityMetamodel metamodel) {
	for ( int i = 0; i < metamodel.getPropertySpan(); i++ ) {
		final AttributeDefinition attributeDefinition = metamodel.getProperties()[i];
		// Don't replace an attribute definition if it is already in attributeDefinitionsByName
		// because the new value will be from a subclass.
		final AttributeDefinition oldAttributeDefinition = attributeDefinitionsByName.get(
				attributeDefinition.getName()
		);
		if ( oldAttributeDefinition != null ) {
			if ( LOG.isTraceEnabled() ) {
					LOG.tracef(
							"Ignoring subclass attribute definition [%s.%s] because it is defined in a superclass ",
							entityMetamodel.getName(),
							attributeDefinition.getName()
					);
			}
		}
		else {
			attributeDefinitionsByName.put( attributeDefinition.getName(), attributeDefinition );
		}
	}

	// see if there are any subclass persisters...
	final Set<String> subClassEntityNames = metamodel.getSubclassEntityNames();
	if ( subClassEntityNames == null ) {
		return;
	}

	// see if we can find the persisters...
	for ( String subClassEntityName : subClassEntityNames ) {
		if ( metamodel.getName().equals( subClassEntityName ) ) {
			// skip it
			continue;
		}
		try {
			final EntityPersister subClassEntityPersister = factory.getEntityPersister( subClassEntityName );
			collectAttributeDefinitions( attributeDefinitionsByName, subClassEntityPersister.getEntityMetamodel() );
		}
		catch (MappingException e) {
			throw new IllegalStateException(
					String.format(
							"Could not locate subclass EntityPersister [%s] while processing EntityPersister [%s]",
							subClassEntityName,
							metamodel.getName()
					),
					e
			);
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:53,代码来源:AbstractEntityPersister.java


示例7: getEntityMetamodel

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
@Override
public EntityMetamodel getEntityMetamodel() {
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:geodir,项目名称:Layer-Query,代码行数:6,代码来源:DinamicEntityPersister.java


示例8: OBTuplizer

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
public OBTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {
  super(entityMetamodel, mappedEntity);
  log.debug("Created tuplizer for "
      + (mappedEntity.getMappedClass() != null ? mappedEntity.getMappedClass().getName()
          : mappedEntity.getEntityName()));
}
 
开发者ID:mauyr,项目名称:openbravo-brazil,代码行数:7,代码来源:OBTuplizer.java


示例9: GroovyAwarePojoEntityTuplizer

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
public GroovyAwarePojoEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {
    super(entityMetamodel, mappedEntity);
}
 
开发者ID:grails,项目名称:gorm-hibernate5,代码行数:4,代码来源:GroovyAwarePojoEntityTuplizer.java


示例10: getEntityMetamodel

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
public EntityMetamodel getEntityMetamodel() {
	return null;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:4,代码来源:CustomPersister.java


示例11: MyEntityTuplizer

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
public MyEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {
	super( entityMetamodel, mappedEntity );
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:4,代码来源:MyEntityTuplizer.java


示例12: AbstractEntityTuplizerImpl

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
public AbstractEntityTuplizerImpl(EntityMetamodel entityMetamodel, PersistentClass persistentClass) {
	super(entityMetamodel, persistentClass);
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:4,代码来源:AbstractEntityTuplizerImpl.java


示例13: addClass

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
/**
 * Add the metadata for an entity.
 * 
 * @param meta
 */
void addClass(ClassMetadata meta) {
    Class type = meta.getMappedClass();

    String classKey = getEntityTypeName(type);
    HashMap<String, Object> cmap = new LinkedHashMap<String, Object>();
    _typeList.add(cmap);

    cmap.put("shortName", type.getSimpleName());
    cmap.put("namespace", type.getPackage().getName());

    EntityMetamodel metaModel = ((EntityPersister) meta).getEntityMetamodel();
    String superTypeName = metaModel.getSuperclass();
    if (superTypeName != null) {
        ClassMetadata superMeta = _sessionFactory.getClassMetadata(superTypeName);
        if (superMeta != null) {
            Class superClass = superMeta.getMappedClass();
            cmap.put("baseTypeName", getEntityTypeName(superClass));
        }
    }

    String genType = "None";
    if (meta instanceof EntityPersister) {
        EntityPersister entityPersister = (EntityPersister) meta;
        // multipart keys can never have an AutoGeneratedKeyType
        if (entityPersister.hasIdentifierProperty()) {
            IdentifierGenerator generator = entityPersister != null
                    ? entityPersister.getIdentifierGenerator()
                    : null;
            if (generator != null) {
                if (generator instanceof IdentityGenerator) {
                    genType = "Identity";
                } else if (generator instanceof Assigned || generator instanceof ForeignGenerator) {
                    genType = "None";
                } else {
                    genType = "KeyGenerator";
                }
                // TODO find the real generator
            }
        }
    }
    cmap.put("autoGeneratedKeyType", genType);

    String resourceName = pluralize(type.getSimpleName()); // TODO find the real name
    cmap.put("defaultResourceName", resourceName);
    _resourceMap.put(resourceName, classKey);

    ArrayList<HashMap<String, Object>> dataArrayList = new ArrayList<HashMap<String, Object>>();
    cmap.put("dataProperties", dataArrayList);
    ArrayList<HashMap<String, Object>> navArrayList = new ArrayList<HashMap<String, Object>>();
    cmap.put("navigationProperties", navArrayList);

    addClassProperties(meta, dataArrayList, navArrayList);
}
 
开发者ID:Breeze,项目名称:breeze.server.java,代码行数:59,代码来源:HibernateMetadata.java


示例14: OptionAwarePojoEntityTuplizer

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
public OptionAwarePojoEntityTuplizer(EntityMetamodel emm, EntityBinding eb) {
  super(emm, eb);
}
 
开发者ID:solita,项目名称:query-utils,代码行数:4,代码来源:OptionAwarePojoEntityTuplizer.java


示例15: getEntityMetamodel

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
/**
 * Retrieve the underlying entity metamodel instance...
 *
 *@return The metamodel
 */
public EntityMetamodel getEntityMetamodel();
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:EntityPersister.java


示例16: DynamicPojoEntityTuplizer

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
/**
 * Constructs a new {@code ProxyPojoEntityTuplizer} instance.
 *
 * @param entityMetamodel
 *          the entity meta model.
 * @param mappedEntity
 *          the mapped entity.
 */
public DynamicPojoEntityTuplizer(EntityMetamodel entityMetamodel,
    PersistentClass mappedEntity) {
  super(entityMetamodel, mappedEntity);
  fixPropertyAccessors(mappedEntity);
}
 
开发者ID:jspresso,项目名称:jspresso-ce,代码行数:14,代码来源:DynamicPojoEntityTuplizer.java


示例17: IsoCustomEntityTuplizer

import org.hibernate.tuple.entity.EntityMetamodel; //导入依赖的package包/类
/**
 * Default constructor.
 * @param entityModel entityMetaModel
 * @param persistentClass persistentClass
 */
public IsoCustomEntityTuplizer(EntityMetamodel entityModel, PersistentClass persistentClass) {
    super(entityModel, persistentClass);
}
 
开发者ID:NCIP,项目名称:iso21090,代码行数:9,代码来源:IsoCustomEntityTuplizer.java



注:本文中的org.hibernate.tuple.entity.EntityMetamodel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MotionRange类代码示例发布时间:2022-05-22
下一篇:
Java ComponentManagerFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap