hi Sanne, what about sfi.getMetamodel().entityPersister( x ).getClassMetadata(); ?
On 7 July 2017 at 12:55, Sanne Grinovero <[email protected]> wrote: > Hi all, > > Hibernate Search is using this method, but it's deprecated with the > following comment: > "Use the descriptors from #getMetamodel() instead". > > I'm a bit lost about how to reach the same by using the Metamodel. > > I found this solution: > > SessionFactoryImplementor sfi =.. > ClassMetadata cm = (ClassMetadata) sfi.getMetamodel().entityPersister( x > ); > > But it's requiring a suspicious casting, which I was hoping to avoid > as I'm already working at SPI level? > > > My goal is to ultimately read > `ClassMetadata#getIdentifierPropertyName()`. Maybe there's a better > approach? > > Thanks, > Sanne > _______________________________________________ > hibernate-dev mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/hibernate-dev > _______________________________________________ hibernate-dev mailing list [email protected] https://lists.jboss.org/mailman/listinfo/hibernate-dev
