List of usage examples for org.hibernate.persister.collection OneToManyPersister getMappedByProperty
@Override
public String getMappedByProperty()
From source file:be.shad.tsqb.helper.TypeSafeQueryHelperImpl.java
License:Apache License
/** * *///w ww . j a v a 2 s .c o m @Override public String getMappedByProperty(TypeSafeQueryProxyData child) { Type propertyType = getTargetType(child.getParent(), child.getPropertyPath()); if (!propertyType.isCollectionType()) { throw new IllegalArgumentException("Method not designed to fetch MappedByProperty " + "for a non-collection type. PropertyType was: " + propertyType); } CollectionMetadata collectionMetadata = (CollectionMetadata) metaModel .collectionPersister(((CollectionType) propertyType).getRole()); if (collectionMetadata instanceof OneToManyPersister) { OneToManyPersister persister = (OneToManyPersister) collectionMetadata; return persister.getMappedByProperty(); } // what about many to many? return null; }