This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need example how to "hibernate" a JTree

 
Torsten Schindler
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Torsten Schindler
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic