gosha
December 11, 2018, 2:59pm
1
Hello, guys. Can someone help me. I want to create dynamic native sql builder. But i really can’t find, where hibernate holds db column names for attributes.
Thank you.
P.S. i use 5.2 hibernate. And solutions from other topic( https://stackoverflow.com/questions/46335682/how-to-get-column-names-of-jpa-entity ) don’t seem to work
gosha
December 11, 2018, 4:19pm
2
Ok. i found.
((AbstractEntityPersister)((MetamodelImplementor) entityManager.getEntityManagerFactory().unwrap(
SessionFactory.class).getMetamodel()).entityPersister(Reference.class))
.getPropertyColumnNames(“viewName”)
1 Like
vlad
December 11, 2018, 4:22pm
3
Check out this article as well.
1 Like