[Hibernate-devel] Multi Table Support

2002-07-16 Thread Urberg, John
I'm starting a new application I was hoping to start using Hibernate on.
Sure enough, the first object I need to map is a "Narrow View" I'm creating
for a list.  It needs to join four tables (2 are the same table).  

The SQL would look something like this:

select recipient.firstname, recipient.lastname, message.date,
message.subject, sender.firstname, sender.lastname
   from message, user sender, message_box, user receipient
 where recipient.userid = ?
and message_box.userid = recipient.userid
and message_box.type = 1
and message.id = message_box.message_id
and sender.id = message.senderid;

I'd like the results to map to:

class MessageListView {
Name recipientName;
Date date;
String subject;
Name senderName;
}

What would be involved in adding support for this in Hibernate?  I don't
need update capablities (at least not yet :) ).

Thanks,
John


---
This sf.net email is sponsored by: Jabber - The world's fastest growing 
real-time communications platform! Don't just IM. Build it in! 
http://www.jabber.com/osdn/xim
___
Hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



RE: [Hibernate-devel] JBoss MBean

2002-07-16 Thread Gavin_King/Cirrus%CIRRUS

>Only if everything is in one big EJB jar file.  If they are split between
>seperate EJB jar files, then there is still a problem.
>
>If one was to put mappings in seperate files for each class (like the
>eg/Foo.hbm.xml and eg/Bar.hbm.xml example in the docs), you could wait to
>load the mapping for a class until the class was first accessed.  That
>might fix the problem.

Remember that Hibernate will let you have multiple instances of
SessionFactory. It would seem sensible to have a different SessionFactory
for each EJB jar.

So, drawing up a little requirements list, we need a JMX interface to
Hibernate that lets us:

1. manipulate all properties dynamically at runtime
2. configure multiple SessionFactory instances with specified mappings
3. start and stop the Hibernate "service" (ie. register and deregister the
SessionFactories in JNDI)
4. actually build the SessionFactory when it is first used

issues:

1. might require some modification to how certain properties are currently
managed by Hibernate (the system-level properties).
4. will require some kind of trickery with a delegating class since the
javax.naming.event package has no objectLookedUp() event.

Now, is the best way to support multiple SessionFactories to allow
multiple instances of the MBean, or should a single MBean manage
all the factories?

Can anyone think of any other issues/requirements?

P.S. I would like this MBean to be generic - useable by other JMX
applications apart from JBoss. (I think it is, anyway.)

John, may I add your class to a new package cirrus.hibernate.jmx
in CVS?



---
This sf.net email is sponsored by: Jabber - The world's fastest growing 
real-time communications platform! Don't just IM. Build it in! 
http://www.jabber.com/osdn/xim
___
Hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel