本文整理汇总了Java中org.hibernate.tuple.IdentifierProperty类的典型用法代码示例。如果您正苦于以下问题:Java IdentifierProperty类的具体用法?Java IdentifierProperty怎么用?Java IdentifierProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IdentifierProperty类属于org.hibernate.tuple包,在下文中一共展示了IdentifierProperty类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fixCompositeIdentifierInMetaModel
import org.hibernate.tuple.IdentifierProperty; //导入依赖的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);
}
}
}
示例2: getIdentifierProperty
import org.hibernate.tuple.IdentifierProperty; //导入依赖的package包/类
public IdentifierProperty getIdentifierProperty() {
return identifierAttribute;
}
示例3: getIdentifierProperty
import org.hibernate.tuple.IdentifierProperty; //导入依赖的package包/类
public IdentifierProperty getIdentifierProperty() {
return identifierProperty;
}