aspose file tools*
The moose likes Object Relational Mapping and the fly likes can you have one-to-many join without using identifier column? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "can you have one-to-many join without using identifier column?" Watch "can you have one-to-many join without using identifier column?" New topic
Author

can you have one-to-many join without using identifier column?

Ogi K
Greenhorn

Joined: Sep 17, 2004
Posts: 10
I a <one-to-many> mapping element, the Hibernate docs says that you specify the column on the CHILD table to be joined with the ID column of the parent table. Is it really possible that you can't join on any other column on the PARENT table, other then the ID column?

<set name="bars">
<key column="foo_id"/>
<one-to-many class="org.hibernate.Bar"/>
</set>

The foo_id is the column on the child table. How about the column on the parent table, Foo?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

"okavazovic"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ogi K
Greenhorn

Joined: Sep 17, 2004
Posts: 10
okavazovic, is my first initial "o" and last name "kavazovic." This is complicit with the naming rules...
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

There are two fields in the profile. One for first name and one for last name. We'd prefer having your full first name, and full last name seperated into those two fields.

If you really have to have just your initial in the first name, that can slide, although it really isn't too personal. We are a really friendly place here and don't try to hide anything.

Thanks and have fun.

Mark
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
IIRC, when I signed up, the Naming Policy explicitly mentioned that you need two names, typically "first" and "last" names, separated by a space. However, I don't see that it is mentioned in the current version of the Policy. It only says you need to use your "real name" (or something that looks like it could be). What I'm saying is that okavazovic is correct that his/her name conforms to the Policy as it is stated, even if it might not follow the spirit of the Policy. Maybe the Policy should be modified slightly to explicitly state that two names are required.

Of course, this probably isn't the thread to make sure this suggestion is seen, so where should I put it?

Layne


Java API Documentation
The Java Tutorial
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

Thanks Layne for your suggestions.

You can even use initials for the first name if you like."


This means that you can keep the O as your first name.

I understand that in some cultures there is no such thing as "first name and last name" - there is just one name. If you are one of these people, I would like to humbly ask you to sacrifice a piece of your culture to help me build this culture. In the past, permitting single names has inspired less wholesome "creative" aliases. The job of keeping names professional grew exponentially. The result is that exceptions to the naming rule are no longer permitted.


This paragraph definitely infers the use of TWO NAMES, first and last.

Layne, if you want to keep arguing about semantics, go ahead, but the actual rule is two names, first and alst. That is what we as bartenders are told to enforce, through the owner of this website. Paul Wheaton. If you have problems you can discuss it in the JavaRanch forum, or directly to Paul. I can assure you will not get far on this type of argument.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can you have one-to-many join without using identifier column?