Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Repeated column in mapping for entity

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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........


 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic