Re: [hibernate-dev] [ORM] Do we have a way to check if an object is an entity?

2019-04-25 Thread Steve Ebersole
That's going to depend on which "bootstrap" they use. JPA defines 2 which it terms "SE" and "EE". Not sure this will work in all EE bootstrap environments, but you have: PersistenceProviderResolver resolver = PersistenceProviderResolverHolder.getPersistenceProviderResolver(); List

Re: [hibernate-dev] [ORM] Do we have a way to check if an object is an entity?

2019-04-25 Thread Guillaume Smet
On Thu, Apr 25, 2019 at 8:05 PM Steve Ebersole wrote: > EMF + Metamodel are standard JPA contracts: > > > try { > emf.getMetamodel().managedType( theClass ); > } > catch ( IllegalArgumentException e ) { > // JPA defined exception if the passed class is not a managed type > } > >

Re: [hibernate-dev] [ORM] Do we have a way to check if an object is an entity?

2019-04-25 Thread Steve Ebersole
EMF + Metamodel are standard JPA contracts: try { emf.getMetamodel().managedType( theClass ); } catch ( IllegalArgumentException e ) { // JPA defined exception if the passed class is not a managed type } Again, that will (should) work on any provider On Thu, Apr 25, 2019 at

[hibernate-dev] [ORM] Do we have a way to check if an object is an entity?

2019-04-25 Thread Guillaume Smet
Hi, In Hibernate Validator, we have a TraversableResolver which avoids to validate the uninitialized properties of an entity. This is done in