Hi Alex,

thanks for your reply.

Actually maybe I've overseen something, but as I read in the
article "Advanced Object-Relational mapping" I thought I have
to do some modifications within orion-ejb-jar.xml directly
which resulted in a lot of error messages.

It would be great if you could point me to some documentation
about what I have to do for a reference mapping as well
as for collections.
Or may be you can give me an example.

TIA
Joerg





-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]Im Auftrag von Alex
Paransky
Gesendet: Montag, 30. April 2001 20:05
An: Orion-Interest
Betreff: RE: Advanced OR mapping


I have been able to do amazing things with Orion's OR mapping.  What
specific problem are you having?  As you have described:

Product -> ProductType
Product -> Supplier -> Country
Product -> Packing Unit
Attribute -> AttributeType
Media -> MediaType
Price -> Currency
Price -> ClientType
Price -> SalesTax


Are all unidirectional relationships and are supported directly by Orion.
The finders such as findProductsBy(ProductType),
findProductsBySupplier(Supplier) and findProductsBy(PackingUnit) are
directly supported by orion using EJB-QL (supplier = ?1, for example).

Product -> Attribute(s)
Product -> Price(s)
Product -> Media(s)
Product -> AccessoryProduct(s) (Product and AccessoryProduct as two
different ejbs)

is a 1-n relationship, and is also directly supported by Orion (in
ejb-jar.xml).

I belive all of these are supported by Orion, and you can write finder
methods for any of these using orion-ejb-jar.xml.  Please note that some of
the more complicated finder methods are NOT supported through ejb-jar.xml
(because ORION does not implement full EJB-QL, however, you can always use
orion-ejb-jar.xml to do such a find).

Here is an example of a more complicated finder that I have manged to get
working:

<finder-method query="SELECT i.* FROM model_entity_Interest i,
symbiosis_model_entity_Node n WHERE i.nodeEntityId = n.id AND n.id = (SELECT
nn.parentNodeId FROM model_entity_interest ii, symbiosis_model_entity_Node
nn WHERE ii.nodeEntityId = nn.id AND ii.id = $1)" partial="false">
  <!-- Generated SQL: "SELECT i.* FROM model_entity_Interest i,
symbiosis_model_entity_Node n WHERE i.nodeEntityId = n.id AND n.id = (SELECT
nn.parentNodeId FROM model_entity_interest ii, symbiosis_model_entity_Node
nn WHERE ii.nodeEntityId = nn.id AND ii.id = ?)" -->
  <method>
    <ejb-name>com.indnet.symbiosis.model.entity.Interest</ejb-name>
    <method-name>findParentByChild</method-name>
    <method-params>

<method-param>com.indnet.symbiosis.model.entity.interest.InterestEntity</met
hod-param>
    </method-params>
  </method>
</finder-method>

This method will find a parent for a child in a tree (circular relationship
through external nodes).

-AP_






-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Joerg
Weishaupt
Sent: Sunday, April 29, 2001 10:42 AM
To: Orion-Interest
Subject: Advanced OR mapping


Hi,

I'm having some problems with the OR mapping, especially for
entity bean reference mappings.
Although I've gone thru the "Advanced Object-Relational mapping"
topic on orionsuppurt.com, I'm unable to transfer this to our
object model, i.e.:

EJB Product has references to
  - ProductType
  - Supplier which references to
      - Country
  - PackingUnit
and also has Collections of
  - Attributes which references to
      - AttributeType
  - Prices which references to
      - Currency
      - ClientType
      - SalesTax
  - Medias which references to
      - MediaType
  - AccessoryProducts which are of the same type as the Product itself.

So it's quite complicated and maybe someone can give me some
directions of what to do.
For me it's very important to see, whether for this model
Orion CMP works better (in regard to performance) than the
existing BMP, as I've seen that it's faster for simple EJB's

TIA
Joerg



Reply via email to