简体   繁体   中英

JPA Entity not having the column from the table but query based on the non existing column in the entity

I have an entity called Person which represent person_tb person_tb has 10 fields that includes zip and country . But these columns are not specified in the Person entity. The entity contains only 8 columns out of 10 columns in the actual table.

Can I still run the query against person entity referring to the non-existing fields (but existing in the actual table)? (I am assuming its not possible)

If the above is not possible, can I write native query based on the missing fields in the entity?

是的-您可以为此使用本机SQL查询

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM