Hibernate (JPA) Entity with Static collection as a member

Posted by Kyle Partridge on Stack Overflow See other posts from Stack Overflow or by Kyle Partridge
Published on 2010-06-10T23:30:52Z Indexed on 2010/06/11 0:02 UTC
Read the original article Hit count: 147

Filed under:
|

Is it possible to have a static collection as a member of a hibernate entity?

Say I have an object Question:

public class Question {
    private String category;

    ...
}

Would it be possible to populate a static Set<String> that is a distinct set of all categories in the Database? I know I could just query this, but I was wondering if there was a more elegant solution, as it seems like something that other people may have come across.

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate