Am I using the MANY_TO_MANY relation correctly?

Hi
thank you for reading my post. I am trying to write a sample code for many to many relation. so far I get to the point that I should do the following tasks:
1- define Tasks Entity with the following definition for many to many relation
@SecondaryKey(relate = Relationship.MANY_TO_MANY,
    relatedEntity = Worker.class)
    private Set<String> workers;2- define the Worker entity with the following definition for many to many relation
@SecondaryKey(relate = Relationship.MANY_TO_MANY,
    relatedEntity = Task.class)
    private Set<String> tasks;Assuming that the above way of defining the relation is correct, can you please let me know whether the following statement are correct:
- When I need to store a Task entity, its workers field is null until I create all workers entity and then I should update the Task entity with a Set object containing all workers primary key.
- When I need to store a Worker entity, its tasks field is null until I create all tasks entity and then I should update the Worker entity with a Set object containing all tasks primary key.
Is it possible to use other collections instead of Set?
Thanks

Assuming that the above way of defining the relation is correct, It's not, you only need one of those secondary keys, not both. See examples/persist/PersonExample.java and the Many-to-Many Relationships section in the javadoc for the SecondaryIndex class.
can you please let me know whether the following statement are correct:- When I need to store a Task entity, its workers field is null until I create all workers entity and then I should update the Task entity with a Set object containing all workers primary key.
- When I need to store a Worker entity, its tasks field is null until I create all tasks entity and then I should update the Worker entity with a Set object containing all tasks primary key.
Is it possible to use other collections instead of Set?>
Please see the javadoc.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Using SUMIFS on iPad Numbers has anyone had trouble using the keypad relational symbols in the "conditions" field?

    The iPad Numbers has a very nice data entry keyboard for expressing conditions.  They have the usual =, <, > but also have the single symbol version of >=, <= and <> (as an equals with a slash through it), however, if you try to use these keypad keys in the conditions field of the SUMIFS, it returns a syntax error.  After seeing some examples of Numbers '09 I discovered I had to express a relation inside double quotes, " ", which means the text keyboard is displayed and the very nice data entry keyboard is gone along with the nice symbols.  Has anyone seen this and am I doing something wrong or is this another bug?  Thanks.

    The xxxIF functions have (for as long as I have used them) required a text string as the argument unless it was equal to a value of a cell, with no logical operators. so it is not something new, its been that way for decades and I personally think Apple might have done it differently if they didnt have to maintain compatiability with older spreadsheet programs.
    i.e. not a bug, ensures backward compatability.
    Jason

  • Can I use Canon DPP as the external editor in Aperture 3 so I can use the lens distortion correction?

    I'd like to use Aperture as my standard RAW converter and export to DPP if necessary. Has anyone tried it?

    No, I don't believe so.  DPP is a RAW converter, like Aperture, and you usually can't mix and match those.

  • Why isn't my query using the index?

    I have a query that inserts values for engines in a grid; it uses a static date table to determine the day in week, or
    week in year (depending on different standards, the DBA can configure this table to their business's likings). I have
    two indexes on this table:
    create table d_date (
         date_key number(5) not null,
         sql_calendar_date timestamp(3) null,
         year_id number(5) null,
         month_id number(3) null,
         day_id number(3) null,
         year_end_biz_date timestamp(3) null,
         qtr_end_biz_date timestamp(3) null,
         month_end_biz_date timestamp(3) null,
         week_end_biz_date timestamp(3) null,
         quarter_id number(3) null,
         week_id number(3) null,
         day_in_year number(5) null,
         day_in_month number(3) null,
         day_in_week number(3) null,
         month_name char(3) null,
         day_in_week_name char(3) null,
         month_type_code char(1) null,
         week_type_code char(1) null,
         date_type_code char(1) null,
         weekend_flag char(1) null,
         holiday_flag char(1) null,
         from_datetime timestamp(3) null,
         to_datetime timestamp(3) null,
         current_flag char(1) null,
         constraint d_date_pkey primary key (date_key)
         ) tablespace dim;
    create index d_date_dy on d_date(year_id, day_in_year) tablespace_dim_idx;
    create index d_date_ww on d_date(year_id, week_id) tablespace_dim_idx;Now, when I run a query to insert the week id into a table based on two values, the year_key and day_in_year_key,
    it should use the d_date_dy index correct?
    Here is what the query looks like:
    INSERT INTO F_ENGINE (YEAR_KEY,MONTH_KEY,WEEK_IN_YEAR_KEY,DAY_IN_YEAR_KEY,DAY_IN_MONTH_KEY,HOUR_IN_DAY_KEY, Q_HOUR_IN_DAY_KEY,
      GRID_KEY,ENGINE_KEY,TIME_STAMP,ENGINE_CPU_UTIL,ENGINE_CPU_GRID_UTIL,MEMORY_TOTAL_BYTE, MEMORY_FREE_BYTE,DISK_FREE_MEGABYTE,
      PROCESS_COUNT,ENGINE_ID,GRID_ID,GRID_NAME,BATCH_ID,RECORD_VIEWABLE_F)
    SELECT EXTRACT(YEAR FROM START_DATETIME),EXTRACT(MONTH FROM START_DATETIME), DD.WEEK_ID,
      TO_NUMBER(TO_CHAR(START_DATETIME, 'DDD')), EXTRACT(DAY FROM START_DATETIME),EXTRACT(HOUR FROM START_DATETIME),
      FLOOR(EXTRACT(MINUTE FROM START_DATETIME)/15)*15,DG.GRID_KEY,DE.ENGINE_KEY, START_DATETIME,CPU_UTIL,DS_CPU,MEMORY,
      FREE_MEMORY,FREE_DISK,PROCESSES,ID,PE.GRID,DG.GRID_NAME,:B1 ,1
    FROM P_ENGINE PE, D_GRID DG, D_ENGINE DE, D_DATE DD
    WHERE PE.GRID = DG.GRID_ID AND DG.CURRENT_FLAG = 'Y' AND PE.ID = DE.ENGINE_ID AND DE.GRID_KEY = DG.GRID_KEY AND
      DE.CURRENT_FLAG = 'Y' AND PE.BATCH_ID = :B1 AND DD.YEAR_ID = EXTRACT(YEAR FROM START_DATETIME) AND
    DD.DAY_IN_YEAR = TO_NUMBER(TO_CHAR(START_DATETIME,'DDD'))
    ORDER BY EXTRACT(YEAR FROM START_DATETIME),EXTRACT(MONTH FROM START_DATETIME),
      EXTRACT(DAY FROM START_DATETIME),EXTRACT(HOUR FROM START_DATETIME),FLOOR(EXTRACT(MINUTE FROM START_DATETIME)/15)*15,
      DG.GRID_KEY,DE.ENGINE_KEY
    Here is the explain plan:
    Operation Object Object Type Order Rows Size (KB) Cost Time (sec) CPU Cost I/O Cost
    INSERT STATEMENT
    SORT ORDER BY
         HASH JOIN
           HASH JOIN
             HASH JOIN
              TABLE ACCESS FULL D_GRID TABLE 1 2 0.316 3 1 36887 3
              TABLE ACCESS FULL D_ENGINE TABLE 2 10 0.410 3 1 42607 3
             PARTITION LIST SINGLE   5 1434 344.496 9 1 2176890 9
              TABLE ACCESS FULL P_ENGINE TABLE 4 1434 344.496 9 1 2176890 9
                TABLE ACCESS FULL D_DATE TABLE 7 7445 283.550 19 1 3274515 18Now it is obviously not using the index for the d_date table since it is doing a full table access.
    Does this have something to do with the fact that I am using extract(), to_number(), to_char() functions in my WHERE clause that it is not allowing the use of the index?
    Any help would be greatly appreciated. Thanks.
    -Tim

    It's difficult to tell just from this. For one thing, you didn't post your query using the forum format tags, so it's hard to read and you didn't post your Oracle version.
    In the query, you don't always prefix columns with the table alias. That makes it impossible for us (and maintainers of this code) to know at a glance which table a column is in.
    It's possible that performing functions on a column will disable the index. Do your other tables have indexes? Do you have updated statistics on all the tables?
    The main reason the optimizer will not use an index is because it thinks it cheaper not to.

  • How to use the TreeControl's active item indent level

    I am trying to query the indent level of an item in a TreeControl when I double-click the item.  I have an event structure that captures the double-click event.  In the handler, I read the Active Item:Indent Level property but it returns an error:
    Error 1135 occurred at Property Node (arg 1) in Viewer Main.vi
    Possible reason(s):
    LabVIEW:  The tree control's active item is not valid for this property.
    Property Name: Active Item:Indent Level
    Does anyone have code to show how to access the indent level for the Active Item?
    Thanks,
    -cb

    smercurio_fc,
    I may not be using the control properties correctly.  The help for Active Item:Indent Level indicates that it will return the Item Indent value for the active selected tree item.  The indent level indicates the depth in the tree at which the item exists.  For instance, a value of 2 indicates that the item is a Child of a Child of a Root node.  When I try to access the property, I get an error.  I have attached a simple VI (8.2.1) that shows the error and the basics of how I was trying to use it.  Can you point out my error or provide a corrected VI? 
    Thank you,
    -cb
    Attachments:
    Get tree control active item indent.vi ‏22 KB

  • How do I activate the "Find Related..." function by right clicking on a message?

    I was able to right click on a message and use the "Find Related...." function to find all messages within the same subject string so I can file all related messages to the folders accordingly. After I re-install my Outlook 2010, when I right
    click on a message, I can still see the "Find Related..." function, but it's shaded now (i.e. meaning that I cannot use it). How do I re-activate this function when I do the right click?

    Hello Fyma_Master,
    Most probably you have configured am IMAP account in Outlook. Am I right?
    Anyway, as a workaround you can try to open a message and then located the "related" control in the ribbon:
    I have found a similar forum thread
    Find Related Messages Option Grayed Out in Shortcut Menu (Outlook 2010) .
    Finally, I'd recommend asking such questions in the
    Outlook IT Pro Discussions forum instead. The current forum is for developers.

  • 'You Are Not Using The Correct Type of Phone Cord' Error

    Having a issue with my fax on my HP Officejet Pro 8500 wireless.  Tried to send a fax, it  received a send error.  I ran fax test and it came back with "You are not using the correct type of phone cord".  Nothing has changed since I last fax'd but I check the lines and connection, everything appears ok.  Phone jack is connected to 1-line and Officejet '2-ext' is connected to the phone.  I use a dedicated phone # and the Officejet is set to auto answer.   I can call out and receive calls on the phone connect to the Officejet.  My assumption is that since I can use the phone without issue there is nothing wrong with the phone line.  Any ideas?
    This question was solved.
    View Solution.

    I was having the same problem.  I'm using a the 2 wire phone cord provided with the printer and still getting this error.  Turns out that it related to have a phone extension plugged into the printer.  If I unplug the telephone form the extension jack on the back of the printer, then the fax test passes.   I was even using a 2 wire cord on the phone extension but it seems that simply having a telephone plugged into the extension jack will cause this error. 
    Run the test without a telephone plugged into the printer's extension jack and you should be fine.
    Worked for me!

  • My 3GS will not accept my correct password and user name to start using the Cloud.  It just spins while "verifying."

    My 3GS will not accept my correct password and user name to start using the Cloud.  It just spins while "verifying." How can I make it stop so I can activate iCloud ?

    try using @me.com instead of your service address, i mean hotmail or yahoo or else, thanks.

  • I used the wrong password for my belkin wifi. Now that I know the correct password I can not get pass the unable to connect or join message. I have turned off all the options such as wifi and join and also put my touch to sleep.. but nothing seems to work

    I used the wrong password to join my new belkin wifi. Now that I have the correct password, I can not get the to the join screen with the space to type in the password. I continue to get the unable to join message.  I have put the touch to sleep and I have turned on and off the wifi and join options on the Network screen page.  Does anyone know how to get pass this block of the wrong password to a new page that will allow me to type in the correct password.  I see there is a option that asks if I want to reset the network settings.. is that what I should do? and what does it erase when I do that?  Thanks for any input anyone has.

    Yes.  Reset network settings. Head to Settings -> General -> Reset and tap Reset Network Settings.
    B-rock

  • I can't activate my iPad and I'm sure i am using the correct apple id and password but when i press net it says it cannot be used to unlock this iPad

    i can't activate my iPad and I'm sure i am using the correct apple id and password but when i press net it says it cannot be used to unlock this

    You can try to figure out which Apple ID/email address and/or password you used to activate it by going to http://iforgot.apple.com
    If you can't, you'll need to contact Apple Account Security with your proof of purchase. 

  • I did everything lllaass suggested and removed most of the itunes related components, but when I tried to remove itunes, I got the message, "The feature you are trying to use is on a network resource that is unavailable" so I was not able to uninstall it.

    I did everything lllaass suggested and removed most of the itunes related components, but when I tried to remove itunes, I got the message, "The feature you are trying to use is on a network resource that is unavailable" so I was not able to uninstall it.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page).
    http://majorgeeks.com/download.php?det=4459
    Here's a screenshot showing the particular links on the page that you should be clicking:
    After clicking one of the circled links, you should be taken to another page, and after a few seconds you should see a download dialog appear for the msicuu2.exe file. Here's a screenshot of what it looks like for me in Firefox:
    Choose to Save the file. If the dialog box does not appear for you, click the link on the page that says "CLICK HERE IF IT DOES NOT". Here's a screenshot of the page with the relevant link circled:
    When the dialog appears, choose to save the file.
    (2) Go to the Downloads area for your Web browser. Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • I have a jetpack, and when I try to "connect" to my ipad or phone, it keeps telling me I am not using the correct password.  I have tried everything.  I even changed the password, nothing is working.  Both are 4G, my ipad is an Air and my phone is a Iphon

    I have a jetpack, and when I try to "connect" to my ipad or phone, it keeps telling me I am not using the correct password.  I have tried everything.  I even changed the password, nothing is working.  Both are 4G, my ipad is an Air and my phone is a Iphone 5.  I can get connected to other wifi on these features but not with my jetpack.  Please help, I need to use this feature soon.  Thank you so much

    Chances are you mis-typed a character in the Wifi password and the devices saved that information.  Now whenever you try to connect the device refers to the wrong password and the Jetpack does not accept your connection.  Tell your devices to forget the wireless connection and start over.
    Once you enter the proper WiFi credentials the Jetpack will allow you to connect.

  • I changed the name of my apple id and now I can't use the app store on my phone correctly because it's using my apple id's old name. I signed out and in on itunes and synced my iphone. Still doesn't work. Help please?

    I changed the name of my apple id and now I can't use the app store on my phone correctly because it's using my apple id's old name. I signed out and in on itunes and synced my iphone. Still doesn't work. Help please?

    Settings>Store...tap the ID shown...sign out...sign back in with the ID you want to use.
    Note: Apps are forever tied to the Apple ID used to originally obtain them. They cannot be updated using any other Apple ID other than the one they were originally obtained with.

  • I have never been able to use the Macmail feature.  Running OSX 10.4.11, and the problems appear to be related to the fact that I originally registered my computer with apple, I subsequently changed my e-mail address.  Have since upgraded the e-mail addre

    I have never been able to use the Macmail feature.  Running OSX 10.4.11, and the problems appear to be related to the fact that when I originally registered my computer with apple, I used an old e-mail address which is now defunct.  Have since upgraded the e-mail address in account manger, but it still locks me out and rejects my user name and password when I try to log in.  It seems it established an account for me automatically when I first fired the beast up, but now the Macmail program is uncooperative with me.  Any assistance would be much appreciated, Thanks

    Hi rbcjoker76, and a warm welcome to the forums!
    Sounds like some needed System Fonts wre replaced by bad ones. Y also have Font Book in Applications for validating fonts & checking for duplicates.
    Required Fonts from 10.3, much the same in 10.4...
    http://support.apple.com/kb/HT2444?viewlocale=en_US
    You may have to get Pacifist...
    http://www.charlessoft.com/
    then intall the Fonts what you need from your Install Disk.
    Or do a relatively painless Archive & Install, which gives you a new/old OS, but can preserve all your files, pics, music, settings, etc., as long as you have plenty of free disk space and no Disk corruption, and is relatively quick & painless...
    http://docs.info.apple.com/article.html?artnum=107120
    Just be sure to select Preserve Users & Settings.

  • I just purchased a movie from the iTunes store using iTunes ver. 11.0. The movie downloaded correctly is there on my hard drive but does appear in the iTunes library. How do I get it to appear in the iTunes Movie Library?

    I just purchased a movie from the iTunes store using iTunes ver. 11.0. The movie downloaded correctly is there on my hard drive but does appear in the iTunes library. How do I get it to appear in the iTunes Movie Library?

    Try Handbrake (http://handbrake.fr/), it's good and free

Maybe you are looking for

  • Layout issue - More than one table sections on report?

    Hello all I am wondering if any of you know if there is a way to have more than one table or table field on a report. I'm asking this because I'd like to include a large number of fields in one report, but then that makes the report hard to read (eve

  • Open/Save Dialogue Behavior

    Can someone help me understand Pages' behavior when opening/saving documents? Here's the scenario: -From Pages' File menu I select Open. A Finder window opens to the desktop (why the desktop?). Then I navigate to the document I want, edit as needed,

  • How do i get the songs i purchased off of my phone back onto it after restoring it?

    i had to get a new iphone4, before going to the store i updated and saved all my stuff onto my computer. i came home to restore it, none of my songs were on my phone. i got my songs back onto my phone after i plugged it in again. now, none of the son

  • "Save As" Folder pathname in action not stable

    I am facing a problem with an action that used to work in the past before I moved to a Mac and PS CC. Basically, my action processes a pciture in different ways and saves each version in different folders within a main folder on the desktop. The acti

  • USER (ospid: 2268): terminating the instance due to error 12853

    Good morning all. I have a tricky situation going on around here.... My Oracle DB was working fine till 5 minutes ago. Once we bounced the server, It stopped working. Here are some details: ORACLE RDBMS Version: 11.1.0.6.0 C:\Documents and Settings\A