Feature Requests item #684810, was opened at 2003-02-12 05:39 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=684810&group_id=40712
Category: None Group: None Status: Open >Priority: 8 Submitted By: Stefano Travelli (stefanotravelli) Assigned to: Nobody/Anonymous (nobody) Summary: Persistent String Enum Initial Comment: PersistentEnum type is a very userfull feature, but in the legacy data world it happens that some enumerations are stored in "char" columns instead of integer and, as far as I understood, I can map a persistent enumeration only with integer. Mapping my existing data I found several char(2) fields that would be nice to map with an enumeration. I tried to write a patch in order to manage such fields introducing a new Hibernate type PersistentStringEnumType and an interface PersistentStringEnum that one can use as the existing PersistenEnum interface. Please, find the modified classes (TypeFactory, MappingByReflection, Hibernate) and the new one (PersistentStringEnum, PersistentEnum) in the attached zip (for Hibernate 1.2) (BTW: Does someone know a simple way to make a patch against CVS?) It also contains a test case for the feature. The test sources explain how to use it. The lenght of the field must be declared in the mapping through the attribute in the <property> tag. I would be nice if we could set it somewhere in the class that define the PersistentStringEnum, but I can't realize if it's possible. stefano ---------------------------------------------------------------------- >Comment By: Gavin King (oneovthafew) Date: 2003-02-12 13:05 Message: Logged In: YES user_id=384580 Thanks; I have been thinking that this would be a nice thing for a while. Use cvs diff to make a patch (you need some extra options to diff, but I forget exactly which ones now...) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=684810&group_id=40712 ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel