From: <leg...@at...> - 2004-02-09 13:20:38
|
The following comment has been added to this issue: Author: Cameron Braid Created: Mon, 9 Feb 2004 7:19 AM Body: Have any plans been finalized ? I don't mind either way.. Our current soloution is a hibernate source hack to create a PersistentStringEnum class, and this sux when upgrading to newer hibernate versions. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-27 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-27 Summary: Persistent String Enum Type: Patch Status: Open Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Assignee: Gavin King Reporter: Max Rydahl Andersen Created: Sat, 3 May 2003 10:15 AM Updated: Mon, 9 Feb 2004 7:19 AM Description: Persistent String Enum 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. http://sourceforge.net/tracker/index.php?func=detail&aid=684810&group_id=40712&atid=428711 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 Add a Comment: --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |