-->
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.  [ 1 post ] 
Author Message
 Post subject: singleton database state class
PostPosted: Mon Mar 23, 2009 1:51 pm 
Newbie

Joined: Mon Mar 23, 2009 1:42 pm
Posts: 2
Hi all,

This might be a weird question, but after mapping all my database tables into persistent classes, I would like to create a singleton class (it has only one possible instance) that reflects the state of the database.

For instance, if I have a table for clients, the "state class" would have a method getClients() that returns a list with the clients.

Therefore i might write (as if it was an association)

State.getClients().add(new Client(...))

instead of

session.save(new Client(...))

Is this possible with Hibernate?

I hope to have made my idea clear. Probably this is not possible at all or it does not make sense.
Many thanks,
hugo


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.