permaculture playing cards*
The moose likes Object Relational Mapping and the fly likes Persist Object in Data Base Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Persist Object in Data Base" Watch "Persist Object in Data Base" New topic
Author

Persist Object in Data Base

SeetaramRao Rayarao
Greenhorn

Joined: Mar 30, 2007
Posts: 3
Please let me know any related info to slove my problem.

I want to persist Object into database. That typically contains Hashtables, Vectors.
Here is the my class definition :

Class : NAME
Instance variables are :
String name; (Ex: Hyd-Shelf)
String moType; (Ex: Shelf,card,ring etc)
String neName; (Ex : 10.29.128.160)

Class : AMO
NAME key;
Vector parents;
Hashtable data;
Vector children

I need to store AMO objects and each AMO object is identified by key (NAME).
As of now, we are storing them in hash tables like this :
--------Shelf (moType of AMO class )-------+
|
+ 10.29.128.160
+ 10.29.128.
+ 10.29.129.11----+
|
-Hyd_bad_Shelf
- Sec-Shelf
1. Here key as "moType" to get value as all hashtables.
2. Here key as "neName" to get values as Hashtable
3. At last give key as "name" to get AMO object

Thanks in advance..
Seetaram
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Sounds like you are looking for something like Hibernate. Have you had a look at it?

(NB: why are you using Vectors and Hashtables?)


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
SeetaramRao Rayarao
Greenhorn

Joined: Mar 30, 2007
Posts: 3
Here my class contains data as hastable to store some network element information.
Some AMOs are act as parents and childers, to maintian whoe are the parents of this AMO . I need to persist this data.. hiw can I do that? I heard about Hibernet. I need to store vectors and hastbales in database.
 
jQuery in Action, 2nd edition
 
subject: Persist Object in Data Base
 
Similar Threads
vector vs hashtable
How to avoid persisting a child object, which is already there in database?
Sorting of hashtables in a vector
Searching within a vector...
Created blob cloumn for @OneToOne relation on gettermethod