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
|