From: <leg...@at...> - 2003-12-16 07:41:08
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-554 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-554 Summary: <dynamic-component> return null Type: Improvement Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 final Assignee: Reporter: J.A. Gonzalez Created: Tue, 16 Dec 2003 1:40 AM Updated: Tue, 16 Dec 2003 1:40 AM Environment: j2sdk1.4.2_01, MS SQL 2000, Windows 2000 SP4 Description: If all attributes of a dynamic component are NULL in database, the persistance class returns a NULL Map. If one of dynamic attributes is NOT NULL, the the class returns a Map containing all specified propertys. These propertys with null values returns NULL and the set attribute contains the correct value. Improvement: Return allways a MAP and never NULL. Return the map with all keys set and NULL values as Object if the attribute is NUll in database. Sorry, my english insn't really good. I hope you understand what i wrote. The mapping file: <class table="user" name="user.User" lazy="false"> <id unsaved-value="0" column="id" type="int" name="id"> <generator class="identity"/> </id> <property type="boolean" column="selectable" name="selectable"/> <.. more properties ....> <dynamic-component name="userAttributes" > <property type="string" column="location" name="location"/> <property type="string" column="company" name="company"/> <property type="string" column="emailaddress" name="emailAddress"/> <property type="string" column="address" name="address"/> <property type="string" column="faxnumber" name="faxNumber"/> <property type="string" column="phonenumber" name="phoneNumber"/> <property type="string" column="zipcode" name="zipCode"/> <property type="string" column="personalnumber" name="personalNumber"/> <property type="string" column="employeenumber" name="employeeNumber"/> <property type="string" column="mobilephonenumber" name="mobilePhoneNumber"/> <property type="string" column="department" name="department"/> </dynamic-component> </class> The java class: public class User { private Map userAttributes; public User() { userAttributes = new HashMap(); } <...... more getters and setters ......> public Map getUserAttributes() { return userAttributes; } public void setUserAttributes(Map map) { userAttributes = map; } --------------------------------------------------------------------- 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 |