Hi Friends,
I am trying to retrieve address's objects using a hibernate query but there occuring an exception.
Following is the detail:
i have defined a field "ownerType" in a java class which is mapped with database:
Code:
private String ownerType=null;
public String getOwnerType() {
return ownerType;
}
public void setOwnerType(String ownerType) {
this.ownerType = ownerType;
}
Following is the mapping entry:
Code:
<property name="ownerType" column="OWNERTYPE" type="java.lang.String"/>
And the exception occuring for this field is:
Quote:
Hibernate: /* load com.raisonne.billsmart.userobjects.AddressPO */ select addresspo0_.ADDRESSID as ADDRESSID2_0_, addresspo0_.TINNUMBER as TINNUMBER2_0_, addresspo0_.TITLEKEY as TITLEKEY2_0_, addresspo0_.FIRSTNAME as FIRSTNAME2_0_, addresspo0_.LASTNAME as LASTNAME2_0_, addresspo0_.STREET as STREET2_0_, addresspo0_.STRSUPPL1 as STRSUPPL7_2_0_, addresspo0_.POSTALCODE as POSTALCODE2_0_, addresspo0_.COUNTRY as COUNTRY2_0_, addresspo0_.REGION as REGION2_0_, addresspo0_.TELEPHONENUMBER as TELEPHO11_2_0_, addresspo0_.FAXNUMBER as FAXNUMBER2_0_, addresspo0_.MOBILE as MOBILE2_0_, addresspo0_.CITY as CITY2_0_, addresspo0_.ADDRESSTYPE as ADDRESS16_2_0_, addresspo0_.OWNERTYPE1 as OWNERTYPE18_2_0_, addresspo0_.DATEOFCREATION as DATEOFC17_2_0_ from address addresspo0_ where addresspo0_.ADDRESSID=?
22:47:11,562 WARN org.hibernate.util.JDBCExceptionReporter {1}:71 -SQL Error: 1054, SQLState: 42S22
22:47:11,562ERROR org.hibernate.util.JDBCExceptionReporter {1}:72 -Unknown column 'addresspo0_.OWNERTYPE' in 'field list'
22:47:11,578 INFO org.hibernate.event.def.DefaultLoadEventListener {1}:95 -Error performing load command
org.hibernate.exception.SQLGrammarException: could not load an entity: [com.raisonne.billsmart.userobjects.AddressPO#2]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1799)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:47)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:41)