Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
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 ?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ecpfriends ecpfriends" please check your private messages.
 
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 :?:
 
Rancher
Posts: 43016
76
  • 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.
 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic