Bug in the DAO.create method when there is a NOT NULL Foreign Key.
------------------------------------------------------------------
Key: SPRING-189
URL: http://jira.andromda.org/browse/SPRING-189
Project: Spring Cartridge
Type: Bug
Versions: 3.1, 3.2-RC1, 3.2-RC2
Reporter: Erik Kimmel
Assigned to: Chad Brandon
The problem occures when you have an entity associated with an other with a
1--------* cardinality (ie A can have * B and B must have exactly one A)
When generating hibernate pojos with andromda, this constraint is perfectly
implemented in hibernate and turned into a not null foreign key in the database.
When generating spring's DAO there is a problem with one of the create methods.
Indeed, there is one create method which passes only the not null attributes,
including the foreign key, and another create method which passes all
attributes EXCEPT the not null foreign keys.
So to correct this logic bug, the second create method must include all
attributes plus not null attributes.
The velocity templates use
#foreach($attribute in $attributes) => for all attributes (required and not
required)
#foreach($property in $requiredProperties) => for all required attributes and
all required association
with each of the loops for one create method.
When we use the create method with only the attributes, it causes an
org.hibernate.PropertyValueException.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.andromda.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642