use of org.hibernate.persister.entity.AbstractEntityPersister in project hibernate-orm by hibernate.
the class JoinSequence method isSubclassAliasDereferenced.
private boolean isSubclassAliasDereferenced(Join join, String withClauseFragment) {
if (join.getJoinable() instanceof AbstractEntityPersister) {
AbstractEntityPersister persister = (AbstractEntityPersister) join.getJoinable();
int subclassTableSpan = persister.getSubclassTableSpan();
for (int j = 1; j < subclassTableSpan; j++) {
String subclassAlias = AbstractEntityPersister.generateTableAlias(join.getAlias(), j);
if (isAliasDereferenced(withClauseFragment, subclassAlias)) {
return true;
}
}
}
return false;
}
use of org.hibernate.persister.entity.AbstractEntityPersister in project hibernate-orm by hibernate.
the class TableCommentTest method getTableName.
private String getTableName() {
SessionFactoryImplementor sessionFactoryImplementor = sessionFactory();
ClassMetadata tableWithCommentMetadata = sessionFactoryImplementor.getClassMetadata(TableWithComment.class);
return ((AbstractEntityPersister) tableWithCommentMetadata).getTableName();
}
use of org.hibernate.persister.entity.AbstractEntityPersister in project midpoint by Evolveum.
the class RUtil method fixCompositeIdentifierInMetaModel.
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);
}
}
}
Aggregations