sql - Hibernate : insert="false" update="false" column used in hibernate generated select query -
i have table called loadout , doesn't have column called productname. hibernate xml has because need fetch table display purposes.
the loadout.hbm.xml has property called productname, insert="false"
, update="false".
when session.merge()
being called, hibernate calls select query , during query following error issued.
hibernate: select loadout0_.id id225_0_, loadout0_.name name225_0_, loadout0_.product_id product3_225_0_, loadout0_.location_id location4_225_0_, loadout0_.loadout_loading_time_id loadout5_225_0_, loadout0_.time_slots time6_225_0_, loadout0_.product_name product7_225_0_ ethanol.loadout loadout0_ loadout0_.id=?
2015-07-14 19:28:31,410 warn [org.hibernate.util.jdbcexceptionreporter] >sql error: 904, sqlstate: 42000 2015-07-14 19:28:31,410 error [org.hibernate.util.jdbcexceptionreporter] ora-00904: "loadout0_"."product_name": invalid identifier
2015-07-14 19:28:31,412 error [shipxpress.ethanol.server.location.web.locationloadoutsupport] org.hibernate.exception.sq lgrammarexception: not load entity: [shipxpress.ethanol.server.scheduling.domain.loadout#27]
this hbm config file.
<id name="id" column="id"> <generator class="sequence"> <param name="sequence">ethanol.loadout_seq</param> </generator> </id> <property name="name" column="name" /> <property name="productid" column="product_id" /> <property name="locationid" column="location_id" /> <property name="loadoutloadingtimeid" column="loadout_loading_time_id" /> <property name="timeslots" column="time_slots" update="false" insert="false" /> <!-- following property causing issue --> <property name="productname" column="product_name" update="false" insert="false" />
sql of table
create table "ethanol"."loadout" ( "id" number, "name" varchar2(100 byte), "product_id" number, "location_id" number, "loadout_loading_time_id" number ); alter table "ethanol"."loadout" add primary key ("id");
Comments
Post a Comment