wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Need example how to Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Need example how to "hibernate" a JTree" Watch "Need example how to "hibernate" a JTree" New topic
Author

Need example how to "hibernate" a JTree

Torsten Schindler
Greenhorn

Joined: Aug 18, 2004
Posts: 13
Hi *,

Status: hibernate newbie.

Does anyone has an example for me how to map a JTree with hibernate?
Maybe with Xdoclet comments

Best,

Torsten
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

It depends entirely what's in your JTree (since you obviously can't map a JTree itself - since its obviously a GUI component). I would guess that the model you use would map to objects with lots of "child" relationships. But not knowing your model, thats as far as I can guess.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Torsten Schindler
Greenhorn

Joined: Aug 18, 2004
Posts: 13
Of course, the JTree is GUI component.
As you said:
The data one would like to make persistent is the model behind the model
behind the tree:

Something like this:

public class MyTreeModel
extends DefaultTreeModel {
// How to make the parent/child relations in a DefaultTreeModel persistent?
...
}
public abstract class MyTreeNode
extends DefaultMutableTreeNode {
...
}
public ConcreteTreeNode1
extends MyTreeNode {
...
}
public ConcreteTreeNode2
extends MyTreeNode {
...
}

Any ideas?

Best,

Torsten
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need example how to "hibernate" a JTree