From: <leg...@at...> - 2003-06-03 00:18:26
|
Message: The following issue has been closed. Resolver: Gavin King Date: Mon, 2 Jun 2003 7:17 PM I have added a dynamic-insert attribute to all class mappings that removes null fields from the INSERT. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-93 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-93 Summary: Ability to specify fields to insert (dynamic-insert) Type: New Feature Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.0 final Versions: 2.1 2.0 final Assignee: Gavin King Reporter: Chris Winters Created: Wed, 21 May 2003 8:52 AM Updated: Mon, 2 Jun 2003 7:17 PM Environment: n/a Description: It would be useful to specify the fields to use for an INSERT, similar 'dynamic-update' and the Interceptor method (findDirty) for doing this with updates, although unlike 'dynamic-update' I don't think there's a way for Hibernate to do this itself. The Interceptor would probably be the only means for specifying the fields. Here's an application: our database has a good deal of application logic in defaults, check constraints and triggers. We'd like to be able to look at an object before it's INSERTed, check a list of fields (which the object can tell us -- it doesn't need to be in the mapping) to see if they're null and if so DO NOT include them in the INSERT. The database will then set the fields properly and the app will be happy. I haven't looked into the code to see how this would affect object synchronization -- we'll need to refetch after the INSERT to ensure the object and database are in the same state, and I don't know if this is already done. --------------------------------------------------------------------- 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/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |