Possible for POJO to have a set of children with only one table?

I have a situation that I'd like to model with Hibernate, but I'm not sure how to proceed.
I've got two objects: Filter and Criterion. Filter has a java.util.Set of Criterion children.
I currently have a schema with two tables: FILTERS and CRITERIA. The FILTERS table has nothing more than a primary key. CRITERIA has a foreign key relationship with FILTERS. I have a FilterDAO that will query the FILTERS table and bring back a Filter object that will use the one-to-many, parent-child relationship between the two tables to populate the Set.
A DBA here has pointed out that the FILTERS table is anemic - it has nothing more than a primary key. She suggested that I eliminate it and go directly against the CRITERIA table to populate that Set.
I'm so used to thinking about these things in terms of primary/foreign key relationships that I'm not seeing how to accomplish this with Hibernate. Is it a mere <set> declaration that populates the child java.util.Set<Criterion>? The WHERE clause would have to include a filter type. Is that where the JOIN has to come? Is the two table schema absolutely necessary, or can I get away without it?
Hibernate allows the object model to be more fine-grained than the schema. The classic example is a PERSON table that has address information it in. I can model this on the object side using Person and Address classes and ask Hibernate to fetch the Address state as a component. Is this the same situation as my Filter and Criterion?
Sorry if I sound confused, or if the question rambles. I guess I don't understand Hibernate well, because any time I get off the beaten path I fall into a hole.
%

Well, you're more advanced than me with Hibernate. I'd be very surprised if that were true, DrClap. 8)
I can't even get one-to-many relationships working the
way I'd like, every time I think I have it right
(i.e. just the same as the examples) it gives me some
guff about backreferences not existing.I'm finding Hibernate to be a bit difficult, especially when I don't have control over the schema. Our DBAs don't seem to follow all the "best practices" that Hibernate recommends.
So my advice might not be the best. But if you don't
have the Filters table, but you still need to get all
the Criterions with "filter key" = x, then isn't that
just a Query? Sure, you get the data back as a List,
but you can wrap that in a Set pretty easily.I've gone back to the DBA and concluded that we have to have a FILTERS table (there's a FILTER_TYPE descriptor field that I've added). It's back in, so the 1:m with CRITERIA should work fine.
But it begs the question: Does Hibernate and O/R mapping demand at least one table per object?
If I look in "Hibernate In Action" on page 92, it says "A major objective of the Hibernate project is support for fine grained object models" - more classes than tables. There should be an adjective "persistent" applied to classes in that phrase, because I can have many more classes that are not persisted.
So I take this to mean that the limit is one persistent class per table, but never less. True?
%

Similar Messages

  • I have an iPhone 4s that is no longer active on my account. I recently upgraded it after completing a 2-year contract. Is it still possible for me to have the iPhone 4s unlocked even though it is no longer active on my account?

    I have an iPhone 4s that is no longer active on my account. I recently upgraded it after completing a 2-year contract. Is it still possible for me to have the iPhone 4s unlocked even though it is no longer active on my account?

        Great question missmar23. You can contact our Global Support department at 1-800-711-8300 to discuss the details for your device.
    KinquanaH_VZW
    Follow us on Twitter @vzwsupport

  • I have 160gb of music on my Classic, 6th Gen (I think) I've just bought it. Is it possible for it to play my songs in a random order, one or two from different albums?

    I have 160gb of music on my Classic, 6th Gen (I think) I've just bought it. Is it possible for it to play my songs in a random order, one or two from different albums?

    To add to what Stonerock has mentioned, you can either create Playlists in your iTunes Library, containing exactly what you want, and then Sync them to your iPod, or you can use the iPod Classic's On-The-Go feature.
    Reading between the lines, I'm going to assume for now that you want to be able to create your preferred listening list while "out and about" - so not near your iTunes library. (You have posted in iPod Classic, after all.) You can do this with the On-The-Go Playlist.
    Look in the Playlists menu on the iPod. It probably contains the Recently Added, Recently Played and other pre-made Playlists that you see in your iTunes Library. At the bottom of the Playlists list, is the On-The-Go showing 0 Songs. Scroll down to it and press the Select (centre) button. The screen will give you instruction on adding songs to the On-The-Go Playlist.
    Basically, if you press-and-hold the Select (centre) button, while highlighting a song, the song title will blink as it is added to the On-The-Go Playlist. Try it, then go back to Playlists/On-The-Go and notice that it will now say 1 Song. (Note, you cannot add a "now playing" song to the On-The-Go Playlist.) Repeat this for every song you want to have in the list. You can also look in the Albums menu, highlight the album title and press-and-hold that to add the complete album to your On-The-Go Playlists with one press. So if you add the two albums to your On-The-Go Playlist, you can then listen to just those two albums.
    To shuffle the songs, turn on Shuffle on your iPod. Either, go into Settings/Shuffle and press the Select button to toggle between Off/Songs/Albums, or on the Now Playing screen, press the Select button three times to reach the Shuffle option, where you use the scroll wheel to move between Off/Songs/Albums, press the Select button to activate it.
    Having added songs to the On-The-Go Playlist, go into it and notice the list of songs and options to Save Playlist (New Playlist 1) or Clear Playlist. If you use Sync to manage your iPod (and that really is the best way by the way), the next Sync will transfer any unsaved On-The-Go and any New Playlist Xs that you have, back to your iTunes Library. You can even remove any song from the current On-The-Go Playlist by highlighting it (in the On-The-Go, obviously) and press-and-holding the Select button.
    If you need assistance in creating a Playlist in your iTunes Library, please ask.

  • Is it possible for me to have CC on two computers at once with my current licensing? I would like to have it on my desktop and my laptop.

    Is it possible for me to have CC on two computers at once with my current licensing? I would like to have it on my desktop and my laptop.

    Each CC allows you to activate it two times, it can be on the same computer or different.
    So you can install &a activate it on two computers but as End user license agreement you can not work on them simultaneously.
    http://www.adobe.com/legal/licenses-terms.html
    Creative Cloud Help | Creative Cloud / Common Questions
    http://helpx.adobe.com/creative-cloud/faq.html
    Regards
    Rajshree

  • HT4972 My IPad 2, IPhone 3GS ans iPod  no longer work with apple TV, I have 2 apple TV in my house and for he last 3 weeks the iPod was the only one we could use for appleTV now none of them works, the apple TV icon does not show up any more. Re-startedev

    My IPad 2, IPhone 3GS ans iPod  no longer work with apple TV, I have 2 apple TV in my house and for he last 3 weeks the iPod was the only one we could use for appleTV now none of them works, the apple TV icon does not show up any more. Re-started everything.

    Ok thank you so much, for your timely response.
    RESPONSES:
    1)   When I set up my iMac, I did not transfer any data directly from my windows PC.  I simply used the same iTunes login and account.  I have access to all of the files via the "Purchased" section of the iTunes store.  If I click "Download Previous Purchases"  text, I can download ALL of the purchases I have ever made.
    2)   I have the Apple TV 2, so good news, question answered.  I thought maybe it was the Apple TV 1, but it is the Black model, so bam.  Good response for you.  Well the whole damned reply is an awesome response, just pointing out that one piece of awesome.  I stated that it was an Apple TV 2, and yet you were still good enough to figure I could be mistaken, and provide me with knowleedge just incase.
    QUESTIONS:
    3)   So can my iMac not stream the data directly from itunes, without download?  Apple TV can, but perhaps that is something among many things that maker it unique, and awesome.
    SERIOUSLY.... THANK YOU... 
    I work in the computer support section for the Military.  The only problem is we use Windows , lol.  Well that and i've been gone for nearly 6 months on recover.  I go back next month though I hope.  But working in that field gives me the abilty to judge responses that run inside the same vein.  Your response was so awesome that I half thought I might have written it myself. 

  • How do I remove one failing hard drive from raid set and replace with new one

    Last Friday apparently one of my raid drives started failing.
    As I mentioned on this forum I started getting continous beeping.
    I was finally able to get the raid working at a degraded level.  I ordered a replacement hard drive which is arriving today.
    (In the meantime I made twice daily backups of my work.....)
    Below was the message I got from the browser based raid software:
    Blahblah 09    1000.2GB   RaidSet Member SamSung HD103SJ
    Blahblah 10    1000.2GB     Free                 SamSung HD103SJ
    Blahblah 11    1000.2GB   RaidSet Member SamSung HD103SJ
    Blahblah 12    1000.2GB   RaidSet Member SamSung HD103SJ
    (See this earlier thread if you wish!)
    http://forums.adobe.com/thread/727867?tstart=0
    At one point when I did the checked the browser interface I saw the message Failed and Degraded
    As I said, I was able to work over the weekend on the degraded system.
    This morning I got the beeping again and did the rescue and now I am running a "full raid" without the notice that one raid was "Free".
    In any case, the new hard drive is arriving today.
    What steps should I take to incorporate the new drive into the raid system.
    I have one OS drive
    and 4 tb raid drives.   One needs to be replaced with the new one that I am getting today.
    Thanks
    Rowby

    Harm,
    Regarding your comment:
    Re: How do I remove one failing hard drive from raid set and replace with new one
    Please tell me how to read the serial number from an individual drive rather easily, without un-installing them:
    If you select the proper drive to change out, you only need to remove one drive and look at its serial number...
    Step 1: Identify bad drive serial number using Areca's tools
    Step 2: Turn off the computer
    Step 3: Remove what you think is the bad drive based on following your numbered cable method, marked hot-swap bays, whatever
    Step 4: Verify that the serial number matches the "bad drive" serial number from step 1; if it does great, proceed; if it does not match, go back to step 3
    Step 5: Change out the CORRECT drive - that's the bottom line for this whole procedure
    Cheers,
    Jim

  • Is it possible to sync two different iphones and an ipad on only one computer?

    Is it possible to sync two different iphones and an ipad on only one computer??
    My husband has an iphone 4 &amp; ipad. I have an iphone 4S. We both use the same  itunes account. We are having trouble w/ all of our contacts/calendars &amp; info getting all mixed up. We want to both use the same itunes account &amp; apple id so that we dont have to separatley repurchase everything. Can anyone help us w/ this issue? Are we obligated to buy another computer so that we each have one--or is there some way around it? Thanks!!

    http://support.apple.com/kb/HT1495

  • I have lost the remote that was paired. I bought another remote, but the procedure to pair the new one does not work. I suspect the the AT will work with only one remote at-a-time and i have to unpaid the first before pairing the second. How do I unpair?

    I have lost the remote that was paired. I bought another remote, but the procedure to pair the new one does not work. I suspect the the AT will work with only one remote at-a-time and i have to unpair the first before pairing the second. If this is true, how do I unpair? If not, what can I do?

    I was premature in posting the question. I found the answer in andother posting, and it was successful.
    Thanks, and sorry for the false alarm.

  • I have OS 10.4.11 with only 512 MB of memory and am trying to download Snow Leopard 10.6.3, it requires 1GB ram  please help.

    I have OS 10.4.11 with only 512 MB of memory and am trying to download Snow Leopard 10.6.3, it requires 1GB ram  please help.

    See Here for Installing RAM...
    MacBook  http://support.apple.com/kb/HT1651
    Be sure to get the correct matching RAM for your Computer

  • I bought a MAC for the first time and plugged my Itouch into it to download my music on it, but is says The iPod "Rick's IPOD" is synced with another iTunes library. An iPod can be synced with only one iTunes library at a time. What should I do?

    I bought a MAC for the first time and plugged my Itouch into it to download my music on it, but is says The iPod “Rick's IPOD” is synced with another iTunes library. An iPod can be synced with only one iTunes library at a time. What should I do?

    Same as you would if you bought a pc; copy everything from your old computer to your new one.  Then you can just sync everything from the new computer, as you did with the old one.

  • Is it possible for someone to scan someone else's card with Apple Pay?

    Hi All,
    Can't find a concrete answer on this, but maybe someone here knows.
    Is it possible for someone to scan someone else's card into Apple Pay?
    My fear is now that apple pay is out there, picture this:
    Someone goes and buys an "Unlocked iPhone" with cash from a apple store.  So now its not locked or setup to anyone or any carrier.
    That same person works in a restaurant.  Takes your card at checkout and walks off to ring up the bill.  Instead, they scan your card and enter it into Apple Pay on this new unlocked device.
    They now have your card, verified the security code on the card, entered your name, and then (on wi fi) it authenticates and sets itself up.
    They then give you back your card, you leave.
    After their shift, they go and pay $1000 on your card , then delete it, and next day, they come back and do it all over again.
    Not saying this is feasible, but what is stopping someone from doing that?  Today, they need your billing info if they do, which they wouldn't have, but this seems to be very quick to authenticate and allow that device access to spend. 
    Just wondering if Apple would be asking for authentication via apple ID, or something else to prevent fraudulent scanning of cards.
    Any thoughts?

    This was posted a little bit after your query.
    Note: This article is misleading in that the "security issue" wasn't really about Apple Pay...
    http://consumerist.com/2014/10/24/apple-pay-lets-man-scan-use-wifes-citi-credit- card-without-additional-verification/
    To summarize, your bank will usually send a code to your phone number or email to authorize the card.

  • Why do I not have access to all the features of my Canon MG5320 printer in all applications which use a printer? The printer has two paper paths. The rear path is used for photo paper and other specialty papers. this is only one "unavailable".

    I have an iMac late 2012 with OSX 10.8.
    The MG5320 has two paper feed paths; one at the rear for photo paper, brochure paper, and other specialty papers and a tray for regular 8½x11 paper. It also can print on CDs and DVDs and has an automatic duplexer. Canon provides a utility for printing on the CDs and DVDs and also for printing photos and other specialty items. This is available in Mac format also. I installed the most recent drivers and utilities.
    I also have a HP IBM Compatible computer on which the above printer as well as an Epson are installed. Every option of each printer is available in every software application that has need for a printer.
    The Mac printer dialog varies from one application to another. The only applications that list the option for selecting paper quality which includes photo paper are Office for Mac, Pages, and Numbers. Not likely that I would be using any of these for photo printing. Auto duplexing, however, is not available here or in any other applications.
    The print dialog in Aperture, Photoshop Elements for Mac, ACDSee for Mac, or iPhoto provide the choice of numerous sizes of paper but no option for paper quality. Therefore, I attempted to use the print utility supplied by Canon and updated by Apple for printing some photos. The photos are selected in this utility. When the print command was given I was shown a message that the printer was being reset. It then began printing a spreadsheet, which was not even open, from the front tray on regular paper in fast draft quality.
    It is essential that the rear feed be available for printing photos. The printer will not accept photo paper from the front tray. The greater proportion of my printing is photos or other specialty items all of which use paper that must be fed from the rear feed.
    An acquaintence who considers himself to be somewhat of a Mac expert insists that the printer options that I require are available and all I need to do is look for them. The print dialog should be clear enough that "looking for options" is not a necessity. Even so, I have dilligently searched every variation of the Mac print dialog on my iMac and only the office type applications named above included anything other than the basic printer functions.
    I have also searched numerous locations online without finding a solution. I did, however, find that printing and printing problems seem to be common with several versions of the Mac OS and Mac computers in general.
    I would appreciate it if someone could provide me with a solution. I have no desire to upgrade my Windows OS to Windows 8 which is perhaps suitable for "smart" phones but not desktop computers. However, because of the printing issue I have temporarily put my iMac aside and reverted to using my PC with Windows Vista.
    Help!!

    This is a user forum I feel you need to deal with Adobe customer services or support chat did not work in you case.

  • HT1212 I have followed the instructions for "if you have never synced your decice with itunes" and my computer is telling me the device has been restored, however I still don't know how to unlock my phone??

    Having followed the instructions for "if you have never synced your device to itunes" and my computer displayed the message that the device has been restored, my phone is still saying its disabled and I should connect to itunes. What do I do now??

    Put the iPhone into Recovery Mode and then try the Restore again:
    http://support.apple.com/kb/ht1808
    If that still doesn't work, as a last resort try DFU mode:
    http://www.iclarified.com/entry/index.php?enid=1034
    If that still fails, you'll probably need to go to an Apple Store or call Apple Support for further assistance.
    Regards.

  • The 16G IPOD catalog entry should have in bold THIS THING HAS ONLY ONE CAMERA.  I bought one for my dad thinking it was same as the last one i bought.  my fault, but also theirs.

    I just ordered a new 16G iPod touch for my dad.  the bigger models said they had an hd camera, so i assumed this one did not BUT AT LEAST HAD A REAR FACING CAMERA.
    So it arrives and he says it only has one camera and I say of course it has two cameras.
    it turns out just a front-facing camera (so i guess thats what Facetime camera meant).
    so now he wants to return it
    be careful ordering. my fault, but also theirs.  it's like selling a car without a windshield.  their should be a giant sign that says, this thing has only one windshield

    Disagree for three reasons:
    1) this is a KEY feature that was removed from prior models.  removing something that cutomers depend upon requires more than burying in a cryptic spec.
    2) even spec does not use clear generic terms like "front-facing camera" "rear-facing camera" or "has one camera" - instead it used Apple-terms like Facetime camera and isite camera, which on a casual glance appears like just upgrade/downgrade camera version.  16g model says facetime camera, and cell next to it it says isite camera (instead of also showing both models have facetime camera on the same row) and that's not a proper comparison grid, comparing  apples to apples, so to speak...
    3) you presume every person that orders finds this page (which i contend is not clear).  i don't want to spend an hour learning what apple-jargon translates to "this model has only  one camera"
    No reply needed.  Just posting for awareness.  I am guessing there will be more dissatisfaction and returns for this product, so just giving you feedback.

  • Is it possible to set a laf to only one component in the application?

    I'm developing a GUI and wanted to know if it is possible to set a particular laf to one of the guis components, thanks a lot.

    I believe that the LAF of a component is determined by the current LAF when the component is created. So I think you can create and display you GUI normally. Then switch to your other LAF to create your component and then switch back to the default..

Maybe you are looking for