[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3181?page=c...
]
Heinz Huber commented on HHH-3181:
----------------------------------
The aim is to have a main object that retains it's values. It's targeted only at
code columns.
The correspondig association MUST NOT be mapped with update or merge cascade.
The problem comes from a legacy database which is accessed (and modified) by a lot of
different programs. And for performance reasons (duh) there is no referential integrity.
Therefore I have objects that have no corresponding entry in the code table. Nevertheless,
those objects MUST NOT loose the current values.
Problem with current Hibernate options:
exception - I can't load those objects.
ignore - The objects loose their code values.
Legacy databases: Advanced handling of missing foreign key values
-----------------------------------------------------------------
Key: HHH-3181
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3181
Project: Hibernate3
Issue Type: New Feature
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6
Oracle 10i (irrelevant)
Reporter: Heinz Huber
Attachments: not-found-keep.zip
"keep" as valid value for attribute not-found of many-to-one/many.
Effect: If the referenced object can't be found, a dummy object with the given key is
constructed.
Example: Account.currency contains the value XYZ. This currency can't be found in the
corresponding code table. After loading the account contains a currency object XYZ
nontheless.
Extent:
src/org/hibernate/hibernate-mapping-3.0.dtd
src/org/hibernate/cfg/HbmBinder.java
src/org/hibernate/engine/ForeignKeys.java
src/org/hibernate/mapping/ManyToOne.java
src/org/hibernate/mapping/OneToMany.java
src/org/hibernate/type/EntityType.java
src/org/hibernate/type/ManyToOneType.java
src/org/hibernate/type/OneToOneType.java
src/org/hibernate/type/TypeFactory.java
There are some TODOs left:
- The handling of proxies should be improved.
- Currently works only per target entity (see comment in test).
But it works for
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira