• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Repeated column in mapping for entity

 
nikunj shingala
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi... All

I am using hibernate for connectivity and i want to one table field user multiple property my table is here......

Time_sheet
ts_id integer
ts_start_time varchar
ts_end_time varchar
ts_break0_time varchar

My hbm.xml file is ...

<hibernate-mapping>
<class name="User.TimeSheet" table="time_sheet">
<id name="ts_id" column="ts_id">
<generator class="increment"/>
</id>
<property name="starttime" column="ts_start_time"/>
<property name="endtime" column="ts_end_time"/>
<property name="break0" column="ts_break_time"/>
<property name="starttime1" column="ts_start_time"/> //without this line run and store data but i want different property and set into same column so how???
</class>
</hibernate-mapping>



When run that time Repeated column in mapping for entity...

So please help me give me idea........


 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can reuse a column but only one property can be read/write, ther other duplicates must be read only. Use the attrubutes insert="false" and update="false" on the duplicates.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic