-->
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.  [ 6 posts ] 
Author Message
 Post subject: Hibernate and jgoodies binding API
PostPosted: Sat Feb 19, 2005 1:30 am 
Newbie

Joined: Sat Feb 19, 2005 1:03 am
Posts: 2
Location: Sacramento CA
I would like to use Hibernate with the jgoodies swing binding API.

The jgoodies binding API requires all your POJO classes to extend their abstract class com/jgoodies/binding/beans/Model. This abstract class doesn't have any fields that are related to the fields in the concrete POJO classes or fields in any database tables.

Does anyone have any suggestions how to map the fields in the POJOs that extend the jgoodies Model class? Like maybe some way to ignore the Model class all together?

Does anyone have any experience using the jgoodies binding API with Hibernate?

Does anyone have any experience with using some other swing binding API with Hibernate?

TIA for any clues/suggestions!


Hibernate version:
Hibernate 2.1.7

Full stack trace of any exception that occurs:
java.lang.NoClassDefFoundError: com/jgoodies/binding/beans/Model
(more...)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 19, 2005 9:27 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
try spring RCP (www.springframework.org)

regards


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 19, 2005 2:55 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I don't really see your problem.
What you have is your domain model extending a base class Model. Just ignore that information and map you "real" domain model classes (and pout the Model class in your CP).
Hibernate doesn't care about your superclasses in the xml mapping.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 19, 2005 4:03 pm 
Newbie

Joined: Sat Feb 19, 2005 1:03 am
Posts: 2
Location: Sacramento CA
emmanuel,

You where absolutely correct. The issue was yet another classpath issue.

I use JBuilder and I forgot that it doesn't build an updated classpath unless you close and reopen the run window after making changes to the classpath.

Thanks for pointing out the obvious!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 20, 2005 5:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Hi SwingCoder,

AFAIK it should not be necessary/recommended to let your domain objects extend the ValueModel in jgoodies binding. What you do insted is to have standard javabean PropertyChangeEvents for your domainmodel and uses the BeanAdapter/PropertyAdapter to manage all the other stuff.

just my 2 cents
max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: A Solution
PostPosted: Sat Aug 06, 2005 9:09 pm 
Senior
Senior

Joined: Tue Mar 09, 2004 2:38 pm
Posts: 141
Location: Lowell, MA USA
Swing Coder,

Your POJOs don't need to extends Model, however, your POJOs DO need to support bound properties using JavaBean conventions. What JGoodies looks for when binding your POJOs to components, is these 2 methods:
    addPropertyChangeListener
    removePropertyChangeListener

Additionally, your setter methods should fire property change events when the values change.

I too was faced with a similar problem and I did not want to have to update 29 classes to support bound propertie, nor did I see much value in writing a proxy class to support the bound properties requirement. So, using JBoss AOP, I created an aspect that would do it for me. I have a somewhat lengthly post on my blog on the topic here:

http://www.damnhandy.com/?page_id=17

So far, it works great but still needs a few tweaks here and there. Hope this helps.

Ryan-


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.