I am using a table generator for managing the ids of a particular entity, in part because I need to be able to periodically query what the next id will be. The generator works perfectly and the table is created and updated correctly, but I am not clear on how to actually query that table. Since it is not mapped to anything (or if it is, I don't understand the mapping between it and its 'parent' entity), do I have to do the query using raw SQL instead of the Hibernate API or HQL? If so, what is the current preferred way to create such a query?
|