How can I establish many to many unidirectional relationship?

Hi, EJB Fans!
I am an ejb fan too.
This time I am learn ejb2.0 and find very funny in cmr. I think it is a good idea and can do manythings we cann't do or difficult with ejb1.1.
But in many to many relationship, I don't know how to give my tables to entity A and entity B. How can I define tables to make A contains related Bs' information? And so do B. But i think make this table is difficult, because we don't know exactly how many should contains? And this is an examples:
Difine entity A as User, and B as roles such as Administration, user, power user, as we often used in network. A user can have many roles, and roles can allocated to many roles.
Another examples is entity A as person, and B as Department. B container A, and A can join many department as he or she can.
B can find A(s) with which clues?? Methods like this java.util.Collection getAs()
, this collection how can ejb container caculate it out?
It is very myth, even wonderful!
I love java and more like ejbs.

No body reply.
My question is silly or my english is very bad.
Sorry I am chinese-speaking programmer.

Similar Messages

  • How can I open many files in one window?

    how can I open many files in one window?

    Well when i do that, the fonts kinda stays whereas the size of the poster shrinks.
    But thanks for the help

  • How can I treat many tables with one handler(?) ?

    Hello~
    I am applying BDB to my embbeded system not rich in resource.
    Some *.db files are called frequently.
    But, Opening a *.db file [db_create(&dbp, NULL, 0) AND dbp->open] takes a long time in BDB
    So, I loaded this functions onto a booting module to call opening functions just one time.
    And all D/B handlers(?) are loaded in all run time
    But, a D/B handler takes about 360Kbytes. And there are too many *.db files(10) where a table is
    How can I treat many tables with one handler(?) ?
    Or
    If you have the most efficient way to call openning functions just one time, please tell me
    Thank you

    Hello,
    Opening the database handles is expensive due to
    opening a file on disk. Is it possible for the application
    to use in-memory dbs? Otherwise is there a way for the application
    to cache the DB handles and reduce the overhead associated with
    opening and closing them?
    Thank you,
    Sandra

  • Weblogic-cmp-rdbms-jar.xml for One-To-Many unidirectional relationship

    hi,
    I am trying to create a simple cmp One-To-Many unidirectional relationship and deploy the same in weblogic. Can someone help me with the weblogic-cmp-rdbms-jar.xml. Am attaching the weblogic-cmp-rdbms-jar. xml tht i am using as also the corresponding ejb-jar.xml. Pls. note tht i want a unidirectional relationship here. one i am tryng However i get this error:
    Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was: Role 'Supplier supplies Products' of relationship 'Product Supplier' contains an invalid key-column value of 'productID'. The key-column must specify a primary key column in the related bean. However, there is no primary key column named 'productID' defined in the related bean 'ProductEJB' or else 'productID' is not being recognized due to case mismatch. My weblogic-cmp-rdbms-jar
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB RDBMS Persistence//EN' 'http://www.bea.com/servers/wls810/dtd/weblogic-rdbms-jar.dtd'>
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
         <ejb-name>SupplierEJB</ejb-name>
         <data-source-name>RJDataSource</data-source-name>
         <table-map>
               <table-name>AA_Supplier</table-name>
               <field-map>
                     <cmp-field>supplierID</cmp-field>
                     <dbms-column>supplierID</dbms-column>
               </field-map>
               <field-map>
                    <cmp-field>name</cmp-field>
                    <dbms-column>name</dbms-column>
               </field-map>
         </table-map>
    </weblogic-rdbms-bean>
    <weblogic-rdbms-bean>
           <ejb-name>ProductEJB</ejb-name>
           <data-source-name>RJDataSource</data-source-name>
           <table-map>
                 <table-name>AA_Product</table-name>
                 <field-map>
                      <cmp-field>productID</cmp-field>
                      <dbms-column>productid</dbms-column>
                 </field-map>
                 <field-map>
                      <cmp-field>description</cmp-field>
                      <dbms-column>description</dbms-column>
                 </field-map>
                 <field-map>
                      <cmp-field>basePrice</cmp-field>
                      <dbms-column>baseprice</dbms-column>
                 </field-map>
                <field-map>
                      <cmp-field>name</cmp-field>
                      <dbms-column>name</dbms-column>
                 </field-map>
                 <field-map>
                     <cmp-field>supplierID</cmp-field>
                       <dbms-column>supplierID</dbms-column>
                 </field-map>
            </table-map>
    </weblogic-rdbms-bean>
    <weblogic-rdbms-relation>
         <relation-name>Product Supplier</relation-name>
         <weblogic-relationship-role>
              <relationship-role-name>Supplier supplies Products</relationship-role-name>
              <relationship-role-map>
                   <column-map>
                        <foreign-key-column>supplierID</foreign-key-column>
                        <key-column>productID</key-column>
                   </column-map>
              </relationship-role-map>
         </weblogic-relationship-role>
         <weblogic-relationship-role>
              <relationship-role-name>Product supplied by Supplier</relationship-role-name>
              <relationship-role-map>
              <column-map>
                   <foreign-key-column>products</foreign-key-column>
                   <key-column>supplierID</key-column>
              </column-map>
              </relationship-role-map>
         </weblogic-relationship-role>
    </weblogic-rdbms-relation>
    </weblogic-rdbms-jar> My ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
         <enterprise-beans>
         <entity>
              <ejb-name>SupplierEJB</ejb-name>
              <home>com.tpt.practice.entityBeans.cmp.product.relationship.SupplierHome</home>
              <remote>com.tpt.practice.entityBeans.cmp.product.relationship.Supplier</remote>
              <ejb-class>com.tpt.practice.entityBeans.cmp.product.relationship.SupplierEJB</ejb-class>
              <persistence-type>Container</persistence-type>
              <prim-key-class>java.lang.String</prim-key-class>
              <reentrant>False</reentrant>
              <cmp-version>2.x</cmp-version>
              <abstract-schema-name>AA_Supplier</abstract-schema-name>
              <cmp-field>
                   <field-name>supplierID</field-name>
              </cmp-field>
              <cmp-field>
                   <field-name>name</field-name>
              </cmp-field>
              <primkey-field>supplierID</primkey-field>
              <ejb-ref>
                        <ejb-ref-name>ProducEJB</ejb-ref-name>
                        <ejb-ref-type>Entity</ejb-ref-type>
                        <home>com.tpt.practice.entityBeans.cmp.product.ProductHome</home>
                        <remote>com.tpt.practice.entityBeans.cmp.product.Product</remote>
                        <ejb-link>ProductEJB#ProductEJB.jar</ejb-link>
              </ejb-ref>
              <query>
                   <query-method>
                        <method-name>findByName</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>
                        <![CDATA[SELECT OBJECT(a) FROM AA_Supplier AS a WHERE a.name =
                        ?1]]>
                   </ejb-ql>
              </query>
              <query>
                   <query-method>
                        <method-name>findAllSuppliers</method-name>
                        <method-params>
                        </method-params>
                   </query-method>
                   <ejb-ql>
                        <![CDATA[SELECT OBJECT(a) FROM AA_Supplier AS a WHERE a.supplierID
                        IS NOT NULL]]>
                   </ejb-ql>
              </query>
         </entity>
         <entity>
              <ejb-name>ProductEJB</ejb-name>
              <home>com.tpt.practice.entityBeans.cmp.product.relationship.ProductHome</home>
              <remote>com.tpt.practice.entityBeans.cmp.product.relationship.Product</remote>
              <local-home>com.tpt.practice.entityBeans.cmp.product.relationship.ProductLocalHome</local-home>
              <local>com.tpt.practice.entityBeans.cmp.product.relationship.ProductLocal</local>
              <ejb-class>com.tpt.practice.entityBeans.cmp.product.relationship.ProductEJB</ejb-class>
              <persistence-type>Container</persistence-type>
              <prim-key-class>com.tpt.practice.entityBeans.cmp.product.relationship.ProductPK</prim-key-class>
              <reentrant>False</reentrant>
              <cmp-version>2.x</cmp-version>
              <abstract-schema-name>AA_Product</abstract-schema-name>
              <cmp-field>
                   <field-name>productID</field-name>
              </cmp-field>
              <cmp-field>
                   <field-name>name</field-name>
              </cmp-field>
              <cmp-field>
                   <field-name>description</field-name>
              </cmp-field>
              <cmp-field>
                   <field-name>basePrice</field-name>
              </cmp-field>
              <cmp-field>
                   <field-name>supplierID</field-name>
              </cmp-field>
              <primkey-field>productID</primkey-field>
              <query>
                   <query-method>
                        <method-name>findByName</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>
                        <![CDATA[SELECT OBJECT(a) FROM AA_Product AS a WHERE a.name =
                        ?1]]>
                   </ejb-ql>
              </query>
              <query>
                   <query-method>
                        <method-name>findByDescription</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>
                        <![CDATA[SELECT OBJECT(a) FROM AA_Product AS a WHERE a.description
                        = ?1]]>
                   </ejb-ql>
              </query>
              <query>
                   <query-method>
                        <method-name>findByBasePrice</method-name>
                        <method-params>
                             <method-param>double</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>
                        <![CDATA[SELECT OBJECT(a) FROM AA_Product AS a WHERE a.basePrice =
                        ?1]]>
                   </ejb-ql>
              </query>
              <query>
                   <query-method>
                        <method-name>findExpensiveProducts</method-name>
                        <method-params>
                             <method-param>double</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>
                        <![CDATA[SELECT OBJECT(a) FROM AA_Product AS a WHERE a.basePrice >
                        ?1]]>
                   </ejb-ql>
              </query>
              <query>
                   <query-method>
                        <method-name>findCheapProducts</method-name>
                        <method-params>
                             <method-param>double</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>
                        <![CDATA[SELECT OBJECT(a) FROM AA_Product AS a WHERE a.basePrice <
                        ?1]]>
                   </ejb-ql>
              </query>
              <query>
                   <query-method>
                        <method-name>findAllProducts</method-name>
                        <method-params>
                        </method-params>
                   </query-method>
                   <ejb-ql>
                        <![CDATA[SELECT OBJECT(a) FROM AA_Product AS a WHERE a.productID
                        IS NOT NULL]]>
                   </ejb-ql>
              </query>
         </entity>
         </enterprise-beans>
         <relationships>
         <ejb-relation>
              <ejb-relation-name>Product Supplier</ejb-relation-name>
              <ejb-relationship-role>
                   <ejb-relationship-role-name>Supplier supplies Products</ejb-relationship-role-name>
                   <multiplicity>One</multiplicity>
                   <relationship-role-source>
                        <ejb-name>SupplierEJB</ejb-name>
                   </relationship-role-source>
                   <cmr-field>
                        <cmr-field-name>products</cmr-field-name>
                        <cmr-field-type>java.util.Collection</cmr-field-type>
                   </cmr-field>
              </ejb-relationship-role>
              <ejb-relationship-role>
                   <ejb-relationship-role-name>Product supplied by Supplier</ejb-relationship-role-name>
                   <multiplicity>Many</multiplicity>
                   <relationship-role-source>
                        <ejb-name>ProductEJB</ejb-name>
                   </relationship-role-source>
              </ejb-relationship-role>
         </ejb-relation>
         </relationships>
         <assembly-descriptor>
              <container-transaction>
              <method>
                   <ejb-name>SupplierEJB</ejb-name>
                   <method-intf>Remote</method-intf>
                   <method-name>*</method-name>
              </method>
              <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>

    I think u r some confusion with productID and SuppliedID . primary key of one column( productId ) can be a foreign key of other table colum( SuppliedID). but foreign key( SuppliedID) can not be a primary key of second table .u declared SuppliedId as primary key . so ur mapping is incorrect.

  • How can I establish bluetooth connection with my iPhone so I can share and modify my iPhone's contact list on my macbook?

    How can I establish bluetooth connection with my iPhone so I can share and modify my iPhone's contact list on my macbook?

    The Mac and iPhone sync with iTunes though the charge cable that is included with the iPhone. Through this, you can sync your calendars and contacts.
    Bluetooth is an impractical sync scheme as the time it would take to say transfer your song catalog could be longer than your phone contract. I suppose it is entirely possible to implement with hacks and jailbreaking, but I am fairly sure it is beyond the rules here to discuss such activities.
    You may wan tto ask this same question in the iPhone section of the comminitie here. There may be some workarounds for just contacts.

  • How can I flip many slides in Photoshop Elements 12 ?

    How can I flip a large number of slides that have been scanned the wrong way up ?
    I can do them one at a time, but this gets tedious.  I have over 1,000 !

    You can have options of creating greeting cards, photobook, photo collage rather than having an option of mural. You can use different templates layouts of the application to create a mural like creation.
    Thanks.

  • How can I establish a line length (72 chars) and get TB to wordwrap at that length?

    I would like to establish a line length for email that I compose or receive. How can I do that? How can I get TB to wordwrap at that length and not some shorter length?

    I did that - and found several items for wrap.
    All except the one noted - mailnews.wraplength - have a status of default, type boolean and value false.
    mail.compose.wrap_to_window_width
    mail.wrap_long_lines
    plain_text.wrap_long_lines
    view_source.wrap_long_lines
    mailnews.wraplength
    status: default
    type: integer
    value: 72
    I promised to be careful, so a last check here - can I change that value to 80 or 50 or something other than 72 without messing up Thunderbird?
    Thanks,
    Terry_S

  • E4200 - How can I establish a 450M connection?

    I'm using WUSB600N, and E4200 now. I read that E4200 supports max 450M speed, how can I realize it?
    thanks,

    Check out the following thread for more information about connecting to the E4200 at 450Mbps:
    http://homecommunity.cisco.com/t5/Wireless-Routers/E4200-How-do-you-connect-at-450Mbps/m-p/376169#M1...

  • How can I convert many .png's to graphic symbols at once in Flash CS6?

    So, just as the subject says, how do I convert a ton (like over 2,000) .pngs quickly and easily to graphic symbols?
    I really dont want to have to drag each one to the stage, hit f8,  and name it, for each one.
    I understand that, back in the CS3 days (im using CS6), it would autonatically generate them when you imported them to the library, is there a setting that I can turn on to have this happen?
    Thank you for your time,
    Obsidn

    Select the directory with your pngs in it.
    Right-click>Browse with Adobe Bridge
    Select your pngs
    Tools>Photoshop>Load to photoshop layers (not sure how many layers this can handle--you may wind up having to do this in batches)
    Save your new psd
    In Flash, create a new symbol with a blank timeline
    Ctrl-R, navigate to the psd you made earlier
    Select all the Photoshop layers
    Check "create MovieClips for these layers."
    Convert layers to keyframes or flash layers (not important, since you probaby don't need to keep this symbol)
    OK
    You'll have Movie Clips, not Graphic Symbols, but maybe you can write or find a JSFL to convert them and then you can block select them, click the Properties button, and change the type from MovieClip to Graphc.

  • How can I play many swf files back to back in AS3

    I have many swf files
    fileA.swf , fileB.swf, fileC.swf
    I want to play them from a MainFile.swf  back to back, fileA.swf , then fileB.swf then fileC.swf ...then to remove them and have the MainFile.swf only.
    How is this done in AS3.
    can anyone send me the code needed to do this. i don't know AS3 very well. I know how to do this in AS2 , i used to put code loadmovie in each files last frame that loaded the next file to a mc object in the mainfile.
    I would apprciate to have all the code appear only in the main file without haveing to code each seperate swf file.

    You should work out how to do it with just one file first in AS3.  The approach to doing many sequencially would be similar to what you did in AS2... the simplest way being to add a command at the end of each swf to trigger the main file to remove it and add the next swf.  I don't know of any way to detect the end of an swf... it has to tell you it's done.
    In AS3 you use the Loader class to load swf and image files.  You use the addChild family of methods to place things on the stage, and you use the removeChild family to get them out of the picture.

  • How can I send many invoice documents to one customer in SAP B1?

    Hi
    Now I can send e-mail through sap b1 to customer by using outlook_integration add-on.
    But I want send many invoices to a customer in one email.
    Can I do it in sap b1?
    Thank u
    Theerawat

    Hi Julie, will this work for electronic invoices also used in Mexico?
    Regards

  • How can I merge many short sound files into 1 file?

    Hello I have a bunch of 1 or 2 second long mp3 files that I'd like to merge together to make just 1 file.
    Is there a way to do it in iTunes? I know you can merge tracks when importing Audio CDs but I'm not sure how to do it with files already on the computer.
    Any suggestions?
    Thanks!

    Thanks Chris I'll check it out. Meantime I found Audio Hijack and that worked fine for capturing the system audio as the mp3's played in iTunes.
    The trial version adds noise after you've been recording for 10 minutes but that's no prob. 'cuz I only needed it for about 5 minutes at a time.

  • How can I connect many client in  one server ?

    Hello, My name is Fabio, i live in Brazil.
    I need that two or more conect the ane server socket.
    Who can help me ?

    Hello, My name is Fabio, i live in Brazil.
    I need that two or more conect the ane server
    socket.
    Who can help me ?Do you mean the common idiom?
    // server code
    while (true){
      Socket s = serverSocket.accept();
      new Thread(new ClientHandler(s)).start();
    class ClientHandler implements Runnable{
      Socket soc;
      public ClientHandler(Socket so){
        soc = so;
      public void run(){
        // do io using soc's io streams
    }

  • How can I rename many files at the same time?

    Hello!
    I have a bunch of PDF files (2 thousand at least) that I need to transfer to another Mac but since it's running OS 9.2 it won't accept the files because the names are too long, therefore, I need a quick way to change all such files into a shorter name but maintaining some of the serial numbers each file name has (i.e., not changing all to the same name but just taking off the first or last 5 characters for example), is there a way to do this sort of thing with OS 10.3.9 or 10.5.2?
    Best!
    Danny

    Look at this shareware. http://www.jonn8.com/ntf/ It's a batch renaming app, but I'm not sure it will do exactly what you want. However, it does have a 7 day free trial.
    If you do a Google serach using +batch file rename mac+ you can review a lot more apps.
     Cheers, Tom

  • How can I export many short videos from one project?

    We had an awards ceremony, and the entirety of the program was filmed and is now saved on my computer as one large, continuous file.  I would like to edit it down to only the acceptance speechers (there are about 10 or so) and export them to MPEGs to share online.  Is there a way I can do this from within one project or do I need to start over every time, editing each speech out individually and then exporting?
    Let me know if my phrasing was unclear.  Thanks for helping!

    bcoughlin33
    I would offer the principles involved in the following blog post for handling the task that you describe.
    http://www.atr935.blogspot.com/2013/06/pe11-project-assets-organization-for.html
    This involves trimming of the source (in Project Media area) in Preview Windows with the program's Set In Set Out points and the saving the trims as subclips in the Project Media and/or trims dragged to the Timeline.
    If interested, please let me know if you need clarification on anything written.
    We will be watching for your progress.
    Thank you.
    ATR

Maybe you are looking for

  • How to replace single quote with double quote

    hai all, i have a problem, i am trying insert a string containing single quote into ms-access database. it is giving error. how can i avoid this .if i replace a single quote in the text with double quote it will defenitely insert into database. in ja

  • 7650 scanner not working on windows 8.1 64 bit Dell

    I have downloaded the 8.1 64 bit software/drivers for the 7650 I have downloaded hp print doctor hp print dr runs it's diagnostic and quits at the driver scan and refers me to hp support. I have newly installed the software  unplugged and turned off

  • Time Capsule with a different DNS?

    Hi there. First time on the community. I've seen this question has been asked, but the posts are very old now. I'd like to present a scenario to you and to hear if this is possible or not. I would like to have my internet modem/fiberbox connected to

  • Placing OS image and Data image on right partition

    Hi , We are facing issue in placing right image at the right partition.  We have OS image and data image. We are formatting and partitioning HDD as 40% (OSDisk) and remaining 100% as (Data). Both paritioons are active and selected as primary.  Then i

  • Inserting photos in video

    How can I insert a photo (or photos) in the middle of a video strip in Imovie 11 (9.0.4), leaving the audio intact while the pictures "play", then be able to return to view the rest of the filmstrip? When I drag a photo to the filmstrip, I indicate t