I took it as more a question about recursive relationships, than many-to-many as the title suggested.
On Thu, Mar 2, 2017 at 9:53 PM, Óscar Bou - GOVERTIS <[email protected]> wrote: > Hi L Eder, > > You can find some code templates for both Eclipse and IntelliJ [1] that > include the proper DataNucleus annotations to define a m-n relationship. > > On this case, DN supports many options [2]. > > I would recommend the one using a Set, which details the following example: > > > public class Product > { > ... > > @Persistent(table="PRODUCTS_SUPPLIERS") > @Join(column="PRODUCT_ID") > @Element(column="SUPPLIER_ID") > Set<Supplier> suppliers; > } > > public class Supplier > { > ... > > @Persistent(mappedBy="suppliers") > Set<Products> products; > } > > > > > > HTH, > > Oscar > > > > > [1] https://isis.apache.org/guides/dg.html#2.-using-an-ide > [2] http://www.datanucleus.org/products/accessplatform/ > jdo/orm/many_to_many.html#set > > > > El 1 mar 2017, a las 22:30, Stephen Cameron <[email protected]> > escribió: > > Hi, if you can make a Product a kind of Component (via inheritance) that > works quite nicely in Isis, then a Product is composed of a list of > Components (some being other Products) and Isis will display each them as > their true type (either a Product or a Component). > > > > > On Thu, Mar 2, 2017 at 7:21 AM, L Eder <[email protected]> wrote: > > Hi members: > > I have two entities - Product, Component. > > A product is made of a list of components, each one with its > respective quantities. > At the same time a same component is use in different products. > > It is sort of a bill of materials, but as a simple, one-level. > > Anyone could suggest a way to implement such an association in Isis? > > Thanks in advance, Eder > > > > Óscar Bou Bou > Socio - IT & GRC Management Services Director > m: +34 620 267 520 <+34%20620%2026%2075%2020> > s: <http://www.govertis.com>www.govertis.com e: [email protected] > > LinkedIn: https://www.linkedin.com/in/oscarbou > Twitter: @oscarbou <https://twitter.com/oscarbou> > > > > Este mensaje y los ficheros anexos son confidenciales. Los mismos > contienen información reservada que no puede ser difundida. Si usted ha > recibido este correo por error, tenga la amabilidad de eliminarlo de su > sistema y avisar al remitente mediante reenvío a su dirección electrónica; > no deberá copiar el mensaje ni divulgar su contenido a ninguna persona. > > Su dirección de correo electrónico junto a sus datos personales constan en > un fichero titularidad de GOVERTIS ADVISORY SERVICES, S.L. cuya finalidad > es la de mantener el contacto con Ud. Si quiere saber de qué información > disponemos de Ud., modificarla, y en su caso, cancelarla, puede hacerlo > enviando un escrito al efecto, acompañado de una fotocopia de su D.N.I. a > la siguiente dirección: GOVERTIS ADVISORY SERVICES, S.L. Avda Cortes > Valencianas, 58 – 8º - 6ª. 46015 - Valencia, y Paseo de la Castellana, > 153, 28045 - MADRID. Asimismo, es su responsabilidad comprobar que este > mensaje o sus archivos adjuntos no contengan virus informáticos, y en caso > que los tuvieran eliminarlos. > >
