hello,
Thank you very much for these replies.
Quote:
it's not possible to ask Hibernate to use getInstance(). I guess what you have is a special one-line table containing your "singleton" object data, isn't it ?
Yeah that could be a part of the solution. In fact, this singleton represents a parameter table in the database. This means I just need one instance of this class. But then I would have to design a table with only one line and only one colum (ID)... Not really meaningful...
Quote:
I've written a generic UserType, together with some helpers it can solve this problem.
http://www.codeproject.com/useritems/SingletonUtil.asp
I will look at this, it seems to be very interesting.
By the way I have a question which seems to relate to the same topic :
If I have a class which doesn't contain any attribute, it justs contains one or many persistant lists to other classes. Then I will have a table with only one ID column in the database, which is not really meaningful too...
Is it possible to avoid this ?
Thanks