Roel De Nijs wrote:
Samdani masum wrote:But one thing ,you mark that customerVM is entity class . but CustomerVM is not entity class. it has no relation in db table Customer .
CustomerVM is definitely an entity class as it's marked with the @Entity annotation
Roel De Nijs wrote:CustomerVM is an entity, so you should definitely read the 184.108.40.206 Returning Managed Entities from Native Queries section in the JPA 2.1 Specification. Especially this part is related to your issueSo you are not selecting all columns mapped in the entity, so the results are undefined. And it seems EclipseLink simply returns the results whereas Hibernate throws a runtime exception. Both are valid implementations of the JPA 2.1 specification.
JSR 338: Java Persistence API Version 2.1, 220.127.116.11 Returning Managed Entities from Native Queries wrote:When an entity is to be returned from a native query, the SQL statement should select all of the columns that are mapped to the entity object. This should include foreign key columns to related entities. The results obtained when insufficient data is available are undefined.
Roel De Nijs wrote:And what about changing your native query to
Roel De Nijs wrote:
Samdani masum wrote:But same code working in JPA2.1 with Eclipselink orm all version. i have to use hibernate so, how to solve it hibernate
Error : column "contactid" found
Try setting the Hibernate dialect to the MySQL dialect by adding this line to the persistence.xml file
Manjunatha Devraja wrote:Hi,
i'm currently working in maintenance project in Bangalore. but i want to enhance my java development skills.
so i'm looking for part time java development work. and also you don't have to pay for my work.
just i want to learn java hands on project development. i have 3.5 years of experience now.
please let me know if there is anyone who can help me on this.
if this is not the right forum to ask let me know where should i ask.
Thanks in advance