Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reg : two hbm file for one java class...........

 
Barry Van
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have 2 tables 'A'table, 'B'table, having both same columns.
My question is.. can i use one java file "setter/getter" for both tables like writing 2 hbm files for one java file? is it possible , or ?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ecpfriends ecpfriends" please check your private messages.
 
Reehan Lalkhanwar
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, its possible.
But why would you have two tables with similar design?
 
Barry Van
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
requirement like this one for insert and other for retrieved
can you tell me the code? please?
 
Reehan Lalkhanwar
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I pictured you were referring that the two tables: A & B, had similar structure. So you plan to map them in two HBM files.
Then you would be writing just one core mapping class where you would have to declare the variables mapped in the .hbm files along with setter/getter.
Doesn't that mean you would be writing two similar HBM files with same variable names, as the same would be declared in the core class :!:
So what code would you need :?:
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ecpfriends ecpfriends", please do not ignore requests from moderators. Accounts without valid display names are generally closed quickly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic