I use ClassMetadata to determine the structure of a sleeping POJO.
I need to determine if the collection is OneToMany or ManyToMany. Where is this information? Can I get to it without using reflection? See my code below.
ClassMetadata cmd=sf.getClassMetadata(o.getClass());
for(String propertyName:cmd.getPropertyNames()){
if (cmd.getPropertyType(propertyName).isCollectionType() && cmd.??())
}
All I need is a method to tell me if this is a ManyTo____ relationship. I see getPropertyLaziness (), but this does not always guarantee the type of the collection. Any ideas?
User1 source
share