Discussion:
[Middlegen-user] Composite FK
D***@cexp.com
2003-10-22 15:18:24 UTC
Permalink
I have a composite FK and would like Middlegen to generate finders for them.

I have specified:

<finders>
<and>
<indexed/>
<fk/>
</and>
</finders>

...however, the result is as below (I get finders for the indexed columns,
but not for the FK (parentKey1, parentKey2).

Any ideas?

Don Shade


* @ejb.finder
* signature="java.util.Collection findByParentKey1(java.lang.String
parentKey1)"
* result-type-mapping="Local"
* method-intf="LocalHome"
* query="SELECT DISTINCT OBJECT(o) FROM Child o WHERE o.parentKey1 = ?1"
* description="PARENT_KEY_1 is indexed."
*
* @ejb.finder
* signature="java.util.Collection findByParentKey2(java.lang.String
parentKey2)"
* result-type-mapping="Local"
* method-intf="LocalHome"
* query="SELECT DISTINCT OBJECT(o) FROM Child o WHERE o.parentKey2 = ?1"
* description="PARENT_KEY_2 is indexed."
Eivind Waaler
2003-10-23 13:10:04 UTC
Permalink
You could try using merge files for specifying the finders you need:

http://boss.bekk.no/boss/middlegen/plugins/cmp20.html
(bottom of page)

.eivind
Post by D***@cexp.com
I have a composite FK and would like Middlegen to generate finders for them.
<finders>
<and>
<indexed/>
<fk/>
</and>
</finders>
...however, the result is as below (I get finders for the indexed columns,
but not for the FK (parentKey1, parentKey2).
Any ideas?
Don Shade
* signature="java.util.Collection findByParentKey1(java.lang.String
parentKey1)"
* result-type-mapping="Local"
* method-intf="LocalHome"
* query="SELECT DISTINCT OBJECT(o) FROM Child o WHERE o.parentKey1 = ?1"
* description="PARENT_KEY_1 is indexed."
*
* signature="java.util.Collection findByParentKey2(java.lang.String
parentKey2)"
* result-type-mapping="Local"
* method-intf="LocalHome"
* query="SELECT DISTINCT OBJECT(o) FROM Child o WHERE o.parentKey2 = ?1"
* description="PARENT_KEY_2 is indexed."
-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...