This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Mapping Tables  RSS feed

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have 2 tables that have a one to many relationship. 1 table has the main data with a PK, One table has detials that contains the fk. The the details tables has a relationship to a look up table using a type field. The lookup table has an order field, type field and a description field. What I'd like to do is to order the main table by the order field in the lookup table for one of the properties in the main table mapping file. Is it possible to do this and if so, how? Any help is greatly appreciate.
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which ORM tool are you using?
 
Lisa Carter
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about that I'm using hibernate 3.0
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Liza,
sorry but I did not understand as well. You speak about two tables and in your text you have 1+1+ a referencing table.
May be you should detail your question like:
table a (
id int,
someText varchar(255),
primary key(id)
)
table b(
id int,
foreign_key_to_a int,
...

You may have a look in the Hibernate reference as well. There are quite some examples.

Best Regards Sebastian
 
Liar, liar, pants on fire! refreshing plug:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!