Get column name in jpa

Posted by German on Stack Overflow See other posts from Stack Overflow or by German
Published on 2010-05-27T13:21:34Z Indexed on 2010/05/27 21:51 UTC
Read the original article Hit count: 211

Filed under:

Hi all,

I have a query factory that takes a column name as an attribute in order to search for that column. Right now I'm passing the name of the column as a string, so it's kind of hardcoded. If the name of the column changes in the entity's annotation, that "hidden dependency" breaks up.

Is there a way in jpa to retrieve the real name of the column and have it available at compile time, so I can use it in queries?

© Stack Overflow or respective owner

Related posts about jpa