These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Which tool generates composite classes?
PostPosted: Tue Oct 17, 2006 6:22 pm 
Newbie

Joined: Tue Oct 17, 2006 6:10 pm
Posts: 5
Hey,

I tired to generate NHibernate classes from a simple schema with Codus. All works fine, but I can't specify _composite_ objects, only classes with keys. And hey, that's bad!

I.e.: I have an AUTO table with AutoID key, and an USER table with the UserID key and the AutoID foreign key.

How can I generate an User class that aggregates the Auto class? Operating with primary/foreign keys and not with composite object it's lame, I think...


Which tool can create better class hierarchy?

Thanx,

boj


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 12:42 am 
Contributor
Contributor

Joined: Sat Sep 24, 2005 11:25 am
Posts: 198
Um... no?

Working with composite keys is going to make your life much harder than it should.
You have a primary key already, why do you need another one?
Define a many to one relation from User to Auto, and you get a nice way to move between the two.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 5:23 am 
Newbie

Joined: Tue Oct 17, 2006 6:10 pm
Posts: 5
Okay, maybe my english is wrong...I try again:) I think composite keys and composite objects (object compositions) are different.

With this schema, the generator builds this:

Code:
class Auto
{
     private int autoID;
     ...
}

class User
{
      private int userID;
      private int autiID;
}


Relations are definied in the schema too, so why not:

Code:
class Auto
{
      private int autoID;
}

class User
{
       private int userID;

       public Auto auto; /* This is the main difference! */
}


?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 10:09 am 
Newbie

Joined: Tue Oct 17, 2006 6:10 pm
Posts: 5
Another way:

Whitch tool can generate one-to-one or many-to-one associations in classes?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.