PersistentEnum « Data Type « JPA Q&A





1. Using a PersistentEnum    forum.hibernate.org

Newbie Joined: Thu Sep 04, 2003 10:05 am Posts: 3 Hello, I'm hoping that someone can give me an example of using Hibernate's PersistentEnum within a persistent class. I have the following class which implements the PersistentEnum interface: Code: package eg; import net.sf.hibernate.PersistentEnum; public class MembershipLevel implements PersistentEnum { private final int level; private MembershipLevel(int ...

2. PersistentEnum and Immutable Classes in Architecture    forum.hibernate.org

Hello, Working on our project, which uses Hibernate for O/R mapping, I came across the following idea : Context : Almost any real-life application has objects that represents enumerations, things like statusses, currencies, languages, etc.. ( == *low* number of objects that never change on-line) Currently hibernate can support this in one of two ways : PersistentEnums, or as a fully ...

3. typesafe enum not implementing PersistentEnum    forum.hibernate.org

The great thing about hibernate is that persistent classes do not need to implement special interfaces for persistence...except for Persistent Enum Type (see hibernate doc 4.2.3). Imagine I have an "Address" object. One of the fields is "Continent". Continent is a typesafe enumeration ={africa, europe,...} An address can be serialized and sent from the server to a swing client. So the ...

4. HQL and PersistentEnum problem    forum.hibernate.org

5. Set with elements of type PersistentEnum    forum.hibernate.org

I want to do a mapping like: where MyEnum implements PersistentEnum and is modeled like the example in the ref manual. Assuming that the rules for inside a collection also applies to inside a collection, will I get issues when using the MyEnum class in different sets in different classes due to ...

6. PersistentEnum replacement    forum.hibernate.org

7. PersistentEnum scheduled for deprecation in 2.2 ?    forum.hibernate.org

I'm about to move all my enums to a custom UserType. I just wanted to check in and make sure this is going to be the recommended approach with future versions of hibernate 2.2+ -- particularly with the addition of Enums in Java 1.5? If a new mechanism is being contemplated to interact with enums in Java 1.5, we will probably ...

8. PersistentEnum deprecated, advices??    forum.hibernate.org

9. PersistentEnum migration    forum.hibernate.org

Thank you for your reply. I hear what your saying... but that's very undesirable, because the parameters isn't dynamic: It's always the same for that query, and therefore dosn't need to be bound at runtime. The other option is to move the 'value' of the enum into the query itself, but this is also undesirable because it breaks the pure object ...





10. Collection of PersistentEnum?    forum.hibernate.org

I'm having a problem trying to map a persistent enumeration into a collection using Hibernate 2.1.7, and I haven't been able to find any examples that would help me out. Thought I'd ask about it here. I have a class that represents a User and I need to associate with that user a collection of Privileges. The Privileges are currently defined ...