Hello,
I use 3.2.5.ga with dynamic models.
For a many-to-one association between the examples invoice and customer I would like to access the customer-attribute with two ways:
1. over the entire customer-entity. Like "Customer customer = invoice.get("INV_CUST");"
2. only the value of the foreign-key column (O_CUST_ID) without loading the customer-entity internal. Like "long customerId = invoice.get("INV_CUST");"
I tried this:
Code:
<class entity-name="INVOICE">
...
<many-to-one name="INV_CUST" entity-name="CUSTOMER">
<column name="O_CUST_ID" />
</many-to-one>
<property name="INV_CUST_KEY" type="long">
<formula>O_CUST_ID</formula>
</property>
...
</class>
but the attribute INV_CUST_KEY is read-only, so I need to have a customer-object to set the association.
Is there a way to have both possibilities with only one attribute?
regards