Well, since the singleton is one object per application, and the database is for a single application, then you can really get away without storing the id for the singleton at all. The ApplicationPropertyManager is really just a DAO facade to your Hibernate queries so you can look up all all the properties in the system or directly by their name, or however you would like to query them.
If you need to have system properties for multiple application groups, then you can do can either add an ApplicationGroup object (and table), or you can simply make ApplicationProperty have a parent() that points to another ApplicationProperty (and this table closes on itself rather than pointing to a second table). Closure is a good design.
There are lots of ways to do this really. Hope that helps and ask if you have any more questions.
Regards,
Ken Egervari
|