|
How do I define the mapping of a unidirectional one-to-one
relationship?
I am using one table to store binary information (Blobs).
I would like to not use one table per usage of blob. For example,
three different entity types have images associated with them. I would
like to define a one-to-one relationship from each of these to a
BlobEntityBean. The relationship has to be unidirectional, because I don't
want the BlobEntity to know how it's being used.
This does not work:
/**
* @ejb:relation name="item-graphic" * role-name="one-item-has-one-graphic" * target-ejb="Blob" * target-role-name="one-graphic-per-item" * * @weblogic:column-map * foreign-key-column="BLOBID" * key-column="BLOBID" * * @ejb:interface-method view-type="local" */ public abstract BlobLocal getGraphic(); The error from the ejbc compiler is:
ERROR: Error from ejbc: Error while reading
'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was:
In relationship 'item-graphic', role 'one-graphic-per-item', invalid column 'BLOBID', a column-map element contains an invalid key-column. The key-column is not defined in the related bean or it's not recognized because of case mismatch. Thanks,
Joe
|
