Adding/removing many-to-many associations with intersection tables

Hello,
I am using Jdeveloper 11g with ADFBC.
I have some many to many associations in my application. For example User and Category are associated and there is an intersection entity (UserCategory - Columns are UserId, CategoryId) to save these associations.
What is the correct method for adding or removing categories assigned to user?
Thanks.
Edited by: Deniz Gulmez on 01-Nov-2009 03:25

I found an example for Jdeveloper 10g, which is discussed [ADF] Adding/deleting entries in a many-to-many relationship
In that example, many-to-many association is defined as two 1-to-many associations. Actually i've been searching since last week for an example which is made with many-to-many associations but no help. I will change my Model structure if it is not an efficient way to define many-to-many associations with intersection tables.
I wonder if it is possible to write some methods like :
addCategoryToUser(String userId, String categoryId)
removeCategoryToUser(String userId, String categoryId)
addCategories(String userId, List categoryIds)
vs.
Of course i am able to do these by creating a new Row in UserCategoryView (Intersection view), setting it's attributes and saving. Or the opposite, finding the row in intersection table and deleting it.
For example:
public void removeCategoryFromUser(String userId, String categoryId){
ViewObjectImpl vo = this.getUserCategories1();
vo.setWhereClause("USER_ID = :userId AND CATEGORY_ID = :categoryId");
vo.defineNamedWhereClauseParam("userId", null, null);
vo.defineNamedWhereClauseParam("categoryId", null, null);
vo.setNamedWhereClauseParam("userId", userId);
vo.setNamedWhereClauseParam("categoryId", categoryId);
vo.executeQuery();
Row row = vo.first();
row.remove();
I wonder if there is a more efficient way. Any samples would be appreciated.
Edited by: Deniz Gulmez on 01-Nov-2009 05:49

Similar Messages

  • There are too many PIN changes associated with this account (Error ID: 30801)

    how to solve this error on app world "There are too many PIN changes associated with this account (Error ID: 30801)" can anyone advice because I follow all the steps to solve it and no one answer me
    I call the customer care using the free number then I call my provider to redirect me to blackberry customer care and no one help me
    so is there any link can show me all the PIN which is assign to my account and manage them
    Please Advice

    Hi and Welcome to the Community!
    Here is a KB that discusses that error:
    KB25553 "There are too many PIN changes associated with this account (Error ID: 30801)" is encountered when attempting to login to BlackBerry App World
    As you see, the way to resolve it is clear, and you seem to have reached some folks in your attempts that were not able to resolve it. Nevertheless, you should not allow them to fob you off...insist that the KB instructs the resolution path and insist that they make good on that.
    aleyadma wrote:
    so is there any link can show me all the PIN which is assign to my account and manage them
    No.
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • HT1369 Ipod touch not being recognized by itunes (but is registering as an external drive by the computer itself) have updated and reinstalled itunes, stopped/started apple mobile device and removed and mobile programs associated with my non apple cellpho

    Ipod touch not being recognized by itunes (but is registering as an external drive by the computer itself) have updated and reinstalled itunes, stopped/started apple mobile device and removed any mobile programs associated with my non apple cellphone. This seems to have started happening after the last Itunes update I did as I was able to put music on my ipod touch a month or so ago. Is there some way to go back to an older version of itunes? I really have no idea what else to do since I followed every step on the trouble shooting page for windows 8.

    I had this problem too and my roommate solved it!
    Go to 'Settings'
    'Music'
    Scroll to the bottom and enter your password to log onto your home sharing
    Then connect to iTunes and sync!

  • Segmens associated with the table

    Hi,
    in 10g R2 , in OEM grid (or DB control) how can I see the segmens associated with a table ?
    Thank you.

    user522961 wrote:
    thank Viendra, but as a dba I should know also use OEM grid, should'nt I ?
    how can I see the segmens associated with a table ?Well, as a dba , you must know what Segment or Extent basically mean as well! Where do you think that this information would be stored and why? What does it mean even by "segments associated with a table" ? If you had said extents, it would had made some sense but IMHO, what you said isn't an appropriate statement.
    For GUI, either DBC or GC( both are same when you come to the Administration page), search for tables and that's all about it.
    HTH
    Aman....

  • I need to merge my apple id's or remove an email's association with it.

    My dad and I have been using the same iTunes account for years as I was too young to have one of my own. Now that I am 18 and old enough to have my own card my dad wants to give me control of our iTunes account because I was the one who purchased all the content on it. But it's not as simple as me taking the password and changing it or something because its his email associated with the account and mine is associated with another apple id--I needed one to FaceTime him-- so my question is this: how can I either get my email off my account and as the only one on his or merge the two accounts and remove the email. How can I do this?

    You cannot merge the accounts.  Sorry.
    Contact itunes support and ask for assistance.

  • Links associated with a table of names/ids

    Is there a better way to do this in faces?
    My page has a table of names, I wish to associate a modify/delete actions with each one, allowing the user to just click say the modify link on one and end up in a page to modify that entry. I ended up generate the links as something like:
    <table>
    <tr>
    <h:form>
    <input name="scoutId" type="hidden" value="${scoutBean.scoutId}"/>
    <h:commandLink action="#{scoutListActionBean.doModify}" value="Modify Scout"/>
    </h:form>
    </td>
    <td>
    <h:form>
    <input name="scoutId" type="hidden" value="${scoutBean.scoutId}"/>
    <h:commandLink action="#{scoutListActionBean.doRemove}" value="Remove Scout"/>
    </h:form>
    </tr>
    </table>
    Then in my action routine, I find the value associated with the request paramter "scoutId" to prepopulate the next modify/delete page.
    This seemed pretty clumsy to me, anybody got a better way?

    Yes. Try DBA_TRIGGER_COLS (or the USER, ALL variants)
    APC

  • Create a BC with intersection table as base table.???

    Hi Axel,
    U have replied that for MVG with M:M create a new BC with the intersection table as the basetable.

    Hi Axel,
    Thank u for ur information its more useful also. Iwant to know one morething .will make u clear about the situation. I need to create an MVG taking Campaign and Offer BCs having M:M link between them. did i need to create an MVG Applet in Offer BC or in Action Employee? Intersection table comes into picture when i need to create a MVG in M:M link without using association applet.
    Regards,
    devu

  • Sun java Creator, Table component vanishes when associating with the table

    I am trying to develop JSF page with a table component and associating a table (users) to the table component.
    I have created datasource and i can see the data in the SQL editor in Sun Java Creator.
    But when i try to associate the table component with the table(users).
    I table component vanishes.
    I dont understand what is the problem.
    Can anybody help me.

    The default theme is localized. If you look at <Creator-install>/rave2.0/modules/ext/locale
    you should see the localized default theme jars. Not sure which locale you are. You can put your localized jar here. Add the localized jar to your web application via library manager for it to be included in the deployed war file
    - Winston
    http://blogs.sun.com/winston

  • There are too many PIN changes associated with this account (Error ID: 30801)" is encountered when attempting to login to BlackBerry App World

    I have just been given a PlayBook and tried to download an App and ot this error, help, what can I do?
    Thanks
    Mark

    Hi Mark,
    You need to set up a new BlackBerry ID on your PlayBook.
    If you bring up the options screen, then you may be able change it in the BlackBerry I'd option pane.
    If you don't have the option, you need to reset (wipe) the PlayBook. There's an option called security wipe. Follow it through, and once it has restarted you can create a new BlackBerryID and start from scratch.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!

  • How To Remove PHP Extension File Association With Internet Explorer

    When I select a PHP file to open it is redirected to be downloaded and opened (or I can choose to save) in Internet Explorer.  I need to test the file in different browsers.  How can I remove this automatic association?
    I've tried selecting a php file from Windows Explorer and selecting a different browser with no success.  I recently bought a new computer with Windows 8.  It's a big jump from my old one which used XP where there was no problem opening files with
    a php extension.
    Pat

    it sounds like you have a file association for .php, and, that you don't want to have one, so the original default behaviour would instead be preferable?
    This discussion, although for Win7, may be helpful:
    (the discussion occurs between "camelgrass" and "Brink")
    http://www.sevenforums.com/tutorials/19449-default-file-type-associations-restore.html#post259052
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Remove my apple id associated with my macbook air

    I am going to be selling my mac book air and I need to un-associate my apple id with the computer.  In iTunes you can simply "de-authorize" the computer, but in the mac app store there is no such thing as to de-authorizing the computer.  How do I un-associate my apple id from the mac app store?

    You should return the MBA to its factory condition before selling it. Doing so will remove all of your private information and remove any content that you purchased from the iTunes and Mac App stores.  That content is not yours to transfer to someone else it is solely licensed to your use. Erase the SSD and reinstall the basic OS from the install disks that shipped with the MBA. If the MBA came preinstalled with Mac OS X Lion, restart while pressing and holding Command + R to restore to the factory settimg.

  • How to remove wrong thumbnail picture associated with MP3/WMA file?

    Win7 associates those little thumbnail sized pictures to some mp3/wma files I have (inside Music library), but some some pictures are wrong.
    How to "dissociate" those wrong pictures?
    Furthermore, Win7 seems to fill in informations to music files but once again, some are wrong.  How could I stop it to act "too smart"?

    Hi,
    If you are using Windows Media Player to run these files by default, the problem occurs because the Windows Media Player library database has become
    corrupted.
    First, you may check if it is run by Windows Media Player by default. If not, please change it:
    Change which programs Windows uses by default
    To resolve this problem, clear the Windows Media Player database. To do this, follow these steps:
    1. Exit Windows Media Player.
    2. Click Start, click Run, type %LOCALAPPDATA%\Microsoft\Media Player, and then click OK.
    3. Select all the files in the folder, and then click Delete on the File menu.
    Note: You do not have to delete the folders that are in this folder.
     4. Restart Windows Media Player.
    Note: Windows Media Player automatically rebuilds the database.
    If this does not resolve the problem, clear the Windows Media Player database cache files. To do this, follow these steps:
       1. Exit Windows Media Player.
       2. Click Start, click Run, type %LOCALAPPDATA%\Microsoft, and then click OK.
       3. Select the Media Player folder, and then click Delete on the File menu.
       4. Restart Windows Media Player.
    Windows Media
    Player supports other options that control the updating and overwriting of related media information. If you want to receive media information from the Internet but control how your files are updated:
    1.   
    Click
    Organize, and then click Options.
    2.   
    Click the Library tab, and then select the
    Retrieve additional information from the Internet check box.
    3.   
    Select either
    Only add missing information or Overwrite all media information, and then click
    OK.
    More information:
    Add or change album
    art in Windows Media Player
    Regards,
    Sabrina
    TechNet Subscriber Support
    in forum.
    If you have any feedback on our support, please contact
    [email protected]
    This posting is provided "AS IS" with no warranties or guarantees, and confers no rights. |Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
    This can be beneficial to other community members reading the thread.

  • Query to determined what tables are associated with parent table

    Hello -
    how would I query the data dictionary to determine what tables are referenced by a parent table via Pk/FK relationship?
    Thanks in advance!
    Mike

    Hi,
    Try this:
    UNDEFINE table
    UNDEFINE owner
    ACCEPT owner CHAR PROMPT 'Enter Owner: '
    ACCEPT table CHAR PROMPT 'Enter Table: '
    COLUMN y new_value sid NOPRINT
    SELECT name||'_'||TO_CHAR(sysdate, 'ddmonyy_hh24miss') y FROM v$database;
    SPOOL constraints_&owner..&table..&sid..txt
    SELECT a.constraint_name constraint, DECODE(a.constraint_type,
                                                                  'C', 'Check',
                                                                  'P', 'Primary Key',
                                                                  'U', 'Unique Key',
                                                                  'R', 'Referential Integrity',
                                                                  'V', 'With Check Option',
                                                                  'O', 'With Read Only') constraint_type,
           a.index_name, a.owner||'.'||a.table_name table, a.status,
           DECODE(a.r_owner||'.'||a.r_constraint_name,'.',null,a.r_owner||'.'||a.r_constraint_name) rconstraint,
           f.constraint_name fconstraint, DECODE(f.owner||'.'||f.table_name,'.',null,f.owner||'.'||f.table_name) ftable,
           f.status fstatus
    FROM dba_constraints a, dba_constraints f
    WHERE a.owner = f.r_owner(+) AND
          a.constraint_name = f.r_constraint_name(+) AND
          a.owner LIKE UPPER('&owner') AND
          a.table_name LIKE UPPER('&tabla')
    ORDER BY 3,1;
    SELECT constraint_name constraint, owner||'.'||table_name||'.'||column_name column, position
    FROM dba_cons_columns
    WHERE owner LIKE UPPER('&owner') AND
          table_name LIKE UPPER('&tabla')
    ORDER BY 1,2;
    SPOOL OFF
    UNDEFINE table
    UNDEFINE owner
    PROMPT
    PROMPT ******************************************** DEPENDENCIES ************************************************************
    PROMPT
    UNDEFINE object
    UNDEFINE owner
    UNDEFINE type
    ACCEPT owner CHAR PROMPT 'Enter Owner: '
    ACCEPT object CHAR PROMPT 'Enter Object: '
    ACCEPT type CHAR PROMPT 'Enter Type: '
    COLUMN REFERENCED_LINK_NAME FORMAT a10
    PROMPT ******************************************** OBJECTS WITH DIRECT REFERENCE
    SELECT owner||'.'||name object, type , referenced_owner||'.'||referenced_name robject, referenced_type rtype,                    dependency_type, referenced_link_name
    FROM dba_dependencies
    WHERE owner LIKE UPPER('&owner') AND
          name LIKE UPPER('&object');
    execute deptree_fill('&type','&owner','&object');
    PROMPT ********************************************  DEPENDENCIES TREE
    SELECT nested_level, schema||'.'||name object, type, seq#
    FROM deptree
    ORDER BY seq#;
    UNDEFINE object
    UNDEFINE owner
    UNDEFINE typeCheers,
    Francisco Munoz Alvarez
    http://www.oraclenz.com

  • How to retreive dynamicly  the name of  a trigger associated with a table

    Hi,
    Comming from Ms-Access and SQL Server, i use triggers (build by omwb) to get automaticaly a new value to primary keyes (during the insert phase).
    Is it possible to retreive by sql, schema... the name of a trigger associate to a specific col in a specific table ?
    Regards.

    Hi,
    Comming from Ms-Access and SQL Server, i use triggers (build by omwb) to get automaticaly a new value to primary keyes (during the insert phase).
    Is it possible to retreive by sql, schema... the name of a trigger associate to a specific col in a specific table ?
    Regards. For update triggers try this:
         select trigger_name from all_trigger_cols
         where
              table_owner = 'DEMO' and
              table_name = 'DEMO_BILLING' and
              column_name = 'PAID' and
              column_list = 'YES';
    For insert triggers you can refer to all_triggers.
    Regards,
    Robin.
    Robin Bothwell
    Software Developer
    Compuware/Numega
    1-800-462-7740x16609
    <http://www.compuware.com/products/devpartner/db/visualstudio.htm>

  • How to find the Infoset associated with a table

    Which table in SAP R/3 4.6c stores the table used in Infoset.
    Eg: would like to see table : MSEG used in which Infoset.
    I would like to know the Joins used in Infoset
    Table : AQGSCAT give only the Main table used in the Infoset.
    But, I would like to know where and all MSEG is used

    Hi,
    1. BW infoset is a join between two ODS, so, there is no table.
    2. BW infoset is not the same than R/3 infoset. You won't find it in SQ02
    go throgh the below the link,
    http://help.sap.com/saphelp_bw33/helpdata/en/ed/084e3ce0f9fe3fe10000000a114084/content.htm
    Hareesh

Maybe you are looking for

  • Error in Bulk Report Generation using SSIS and SSRS 2008 R2

    Hello, upon having solved development issues via this forum I am facing problem in practice. Namely, there are suppose to be created  200 .PDF files. I am facing "strange" outcome because, sometimes I am getting all the files created, sometimes less

  • I want to launch a Bo report whith a URL and render it back to the web page

    I want to launch a Bo report whith a URL and render it back to the web pages in HTML format? And the report have parameters as well. Exampel: If a have report in InfoView that i want to se in my web page i just click a link button with my URL. And i

  • Bought cc and now the trial of photoshop is about to expire, can't register

    bought cc and now trial of photoshop is about to run out , can't register

  • RMI Server : GUI

    Is it possible to have the Server side be a GUI application? All of the examples I have seen are just command line applications. I tried creating a GUI in my Server class but it seems to never create the gui. Does anybody know what I am doing wrong?

  • Macbook battery query

    new macbook....after a full charge......will be usable for like 4 to 5 horus. right? this is not too good is it? i know if i turn bluetooth off, it saves power. but still...... can you buy third party batteries which work for like LOTS MORE hours? ch