Ensure the target object is annotated with @Entity, is in the same jar file as the persistence.xml, is listed with the correct package in the persistence.xml, and that you have correctly deployed your application.
If still having issues include the fullexception stack trace and source of the class and persistence.xml.
Sonia please post you entity classes entirely and also the part of code where you make the insertion. It will be easier for us and for you to see exactly instead of making assumption of what your problem is.
The above indicates that the Customer and Phones needs to be joined by CUSTOMER_ID, in that case the PHONE_ID column in Customer is redundant.
Please try with
@JoinColumn(name="PHONE_ID", insertable = false, updatable = false)
Cheers, Joy [SCJP 1.4, SCBCD 5.0]
get high on alcohol, algorithm or both
but after making changes in the customers and orders class if i try to run the program i get the following error
[class customerrecords.Customers] uses a non-entity [class customerrecords.Countries] as target entity in the relationship attribute [private customerrecords.Countries customerrecords.Customers.countryId].
Seriously Rick? Seriously? You might as well just read this tiny ad: