For everyone's reference, on p.407 of JPA Pro , xmlmapping,
The corresponding orm.xml is:
My correction is:
The corresponding orm.xml is:
If I don't specify CITY in the attribute override, the Employee.findAll query cannot find t0.City from EMP class.
The exception is:
Call: SELECT t0.ID, t0.TYPE, t1.EMP_ID, t0.NAME, t0.STARTDATE, t0.CITY, t1.PROV, t0.STREET, t1.PCODE, t0.DEPT, t0.MGR, t0.DAILYRATE, t0.TERM, t0.HOURLYRATE, t0.VACATION, t0.PENSION, t0.SALARY FROM xmlMappings.EMP t0, xmlMappings.EMP_ADDRESS t1 WHERE (t1.EMP_ID = t0.ID)
Query: ReadAllQuery(name="Employee.findAll" referenceClass=Employee sql="SELECT t0.ID, t0.TYPE, t1.EMP_ID, t0.NAME, t0.STARTDATE, t0.CITY, t1.PROV, t0.STREET, t1.PCODE, t0.DEPT, t0.MGR, t0.DAILYRATE, t0.TERM, t0.HOURLYRATE, t0.VACATION, t0.PENSION, t0.SALARY FROM xmlMappings.EMP t0, xmlMappings.EMP_ADDRESS t1 WHERE (t1.EMP_ID = t0.ID)")
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 't0.CITY' in 'field list'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)