Many-to-one | one-to-many

Hi, I am pretty new to berkeley db je. I am trying to devise a good strategy for the following....note these are obviously generic examples. We read the data out of oracle into objects, and wish to use je as a front end cache.
class foo {
long foo_id;
int somedata;
class bar {
long bar_id;
int somedata;
class foobar {
long foo_id;
long bar_id;
int somedata;
foobar is an association between foo and bar. a single foo can be related to many foobars. a single bar can be related to many foobars.
I create a primary database in berkeley for foo and a primary database in berkeley for bar, both using the id as the key.
I create a primary database in berkeley for foobar using foo id as the key. I want to create a secondary database in berkeley for foobar using bar id as the key, but I cannot, b/c the primary database must not support duplicates -- but this breaks the one (foo) to many (foobar) relationship.
What is the best db strategy using je to accomplish what i'm trying to do?
Thanks in advance,
Davis

Hello.
as I still did not solve my problem, I will try to reformulate my question I want to make request EJB3 QL with joint.
here my tables:
    CREATE TABLE `umlssnmi` (
  `AUIS` varchar(20) NOT NULL default '',
  `CUI` varchar(20) NOT NULL default '',
  `CODE` varchar(20) NOT NULL default '',
  `TTY` varchar(5) NOT NULL default '',
  `STR` varchar(255) NOT NULL default '',
  `HIER` varchar(255) NOT NULL default '',
  `PROF` tinyint(2) NOT NULL default '0',
  `AXE` char(1) NOT NULL default 'D',
  PRIMARY KEY  (`AUIS`),
  KEY `CODE` (`CODE`),
  KEY `TTY` (`TTY`),
  KEY `CUI` (`CUI`),
  KEY `AXE` (`AXE`)
) TYPE=MyISAM;
CREATE TABLE `whoart` (
  `AUIW` varchar(10) NOT NULL default '',
  `CODE` varchar(10) NOT NULL default '',
  `STR` varchar(255) NOT NULL default '',
  `FSTR` varchar(255) NOT NULL default '',
  `SOC` varchar(5) NOT NULL default '',
  `SEMTYPE` varchar(5) NOT NULL default '',
  `SRC` enum('WA','CIM') NOT NULL default 'WA',
  PRIMARY KEY  (`AUIW`),
  KEY `SOC` (`SOC`),
  KEY `CODE` (`CODE`)
) TYPE=MyISAM;Knowing that I have the following table which has like clès primary both clès primary of the tables the preceding one.
    CREATE TABLE `wasnmi` (
  `AUIW` varchar(20) NOT NULL default '',
  `AUIS` varchar(20) NOT NULL default '',
  `MODIF` varchar(10) default NULL,
  `SRC` enum('S','MW','MS','MA') NOT NULL default 'S',
  PRIMARY KEY  (`AUIW`,`AUIS`),
  KEY `MOD` (`SRC`),
  KEY `MODIF` (`MODIF`)
) TYPE=MyISAM;
knowing that cardinality between these tables and ManyToMany, my question and to know if so that I can make a join
between my tables I must create tables intermédiates which contain that the primary keys like umlssnmi_wasnmi kind
and whoart_wasnmi for example, and to make @JoinTable; or the table "wasnmi" will join the tables.
I tried to implement :
For table WHOART:
    public class TermSource implements Serializable {
@OneToMany (mappedBy="auiw")
    private Collection<TermProjPK> termProjPks;
    public Collection<TermProjPK> getTermProjPks() {
        return termProjPks;
    public void setTermProjPks(Collection<TermProjPK> termProjPks) {
        this.termProjPks = termProjPks;
}For UMLSSNMI table:
public class SnomedInter implements Serializable {
@OneToMany (mappedBy="auis")
    private Collection<TermProjPK> termProjPks;
    public Collection<TermProjPK> getTermProjPks() {
        return termProjPks;
    public void setTermProjPks(Collection<TermProjPK> termProjPks) {
        this.termProjPks = termProjPks;
}The TermProjPK class which contains the primary keys of table WASNMI:
    @Embeddable
public class TermProjPK implements Serializable {
@ManyToOne
    @JoinColumn(name = "AUIW", nullable = false)
    private String auiw;
    private Collection<TermSource> termSources;
    public Collection<TermSource> getTermSources() {
        return termSources;
    public void setTermSources(Collection<TermSource> termSources) {
        this.termSources = termSources;
@ManyToOne
    @JoinColumn(name = "AUIS", nullable = false)
    private String auis;
    private Collection<SnomedInter> snomedInters;
    public Collection<SnomedInter> getSnomedInters() {
        return snomedInters;
    public void setSnomedInters(Collection<SnomedInter> snomedInters) {
        this.snomedInters = snomedInters;
}For WASNMI table:
    public class TermProj implements Serializable {   
    @EmbeddedId
    protected TermProjPK termProjPK;
    @Column(name = "MODIF")
    private String modif;
    @Column(name = "SRC", nullable = false)
    private String src;
}That does not function, because I do not know how I can reach the fields ` MODIF' and ` SRC' of the table ` WASNMI' starting from TermSource object.
Somebody already made there?. :banghead: I thank you in advance

Similar Messages

  • Print One Report to many printers !!! URGENT

    Hi..
    I want to tell me how can I print a report from Forms to 3 printers?One report but 3 different
    printers.PLS give me full details.
    Note : 1 printer local and others on network.
    thanks Alot

    Hi,
    please read about teh Reports distribution lists (bursting output) and how to use them.
    Thi this a feature in Reports 6i that allows a Reports output to be sent to many destinations the same time.
    Frank

  • One Apple ID for many phones. How to stop all phones downloading the same app?

    Hi everyone,
    In advance, I'd like to thank you for taking your time to read my question and helping me.
    Currently, many members of my family have iPhones, ranging from 4 to 5, and for the sake of convenience, I set them all up using my Apple ID. Recently, each time one of us downloads an app, all the other phones automatically download them too. Is there a way to prevent that from happening? I'd like to keep the phones all on the same ID, so is there a setting that I change so that our phones will not receive each other's downloads?
    Thank you all again.

    Click here and use the instructions to turn automatic downloads off.
    (80615)

  • My wife and I have made many purchases over several years on seperate accounts, how could we join them into one account, without losing everything?

    My wife and I have made many purchases over several years on seperate accounts, how could we join them into one account, without losing everything? We both use Iphone 5's and share an Imac at home.

    Purchases using one Apple ID cannot be merged or transferred to another Apple ID. Purchases are forever tied to that Apple ID used. You have to decide which Apple you want to use for purchases and stick to that Apple ID so that you can share: Settings > iTunes & App Stores > Apple ID : > use the same Apple ID here to share purchases.

  • HT5622 How many family members, computers, iPods,iPad,IDs can you have on one iTunes account?

    I'm just trying to sort out some iTunes I'd issues.  Does anyone know how many total iPad iPods can be used with one Apple ID?  Or how many apple  IDs your can have with one iTunes account? Or does each person need there own Apple ID or Apple account? Thanks

    You can't have multiple IDs on one account, but you can use multiple IDs for different purposes on the same device.
    Just use the one AppleID for iTunes and the AppStore so you can all share your music and app purchases. Then each person should have their own individual AppleID with associated iCloud account for mail, contacts, calendars, iMessage and FaceTime.
    You don't have to use the same AppleID for all services.

  • How many different Apple TVs can I share one iTunes Store account with?

    I currently have one AppleTV at my home, and one at my mothers home. We both share the same iTunes Store account, therefore we share the movies that each other purchase. I am interested in getting my father and my aunt and Apple TV as well, I want them to also be able to use my iTunes Store account. That way, if say my father and I both want to watch the same movie, we can split the cost.
    I also currently own an iPhone, and an iPad. I'm going to be getting my mother and father iPads as well. I want them to be able to use my iTunes Store account on those devices as well, and be able to stream movies on them.
    I know it says that your iTunes Store account can only be associated with 10 devices, but I'm wondering where Apple TVs fit into that stance. It's probably a stupid question, but I was just curious if the fact that it is iCloud changes anything.
    Essentially, I'm wondering if four Apple TVs, three iPads, one iPhone, and my one desktop computer can all stream my iCloud movie content, simultaneously. I doubt there will ever be more than two or three going simultaneously, but I just want to know the limitations before I buy these gifts for my family members and run into an unpleasant surprise.
    Thank you for your time,
    Charles

    as many as you can other computers with itunes accessing the shared ituned lib
    likely the limitation is the network bandwidth more then number of connected devices

  • How many iPads can you setup on one iTunes account for a school?

    How many iPads can you setup on one iTunes account for a school?
    What is the best system?  We have 30 iPads.

    That would be fine.

  • How many users can you have on one account ?

    Hi,
    I have just created a ID with Adobe Reader for a group to use files stored in cloud. I would like to know how many users can access the account at one time via, mobile devices, ipad, desktops ?

    I don't know if there is a limit; you do mean the free https://cloud.acrobat.com/ ?
    I will move your post to the Acrobat.com forum, where someone hopefully can give you a definitive answer.

  • How many computers can you authorize with one serial number?

    Hey guys.
    I'm thinking about buying a 2nd Mac, but I'm just curious how many total computers you have authorize Logic studio on at one time (my guess would be 3 but I hope more).
    Please let me know if you can.
    Thanks,
    Nathan

    I'll copy my post from the other thread:
    I don't know for the others but in my retail package ((not upgrade) I found two serial numbers. Though I haven't got time yet to try the second serial number on my MacBook, my logic says that with two different serials I could run both macs simultaneously and be on the network. But, my logic fails so often so it's better to shut my mouth, install Logic on MacBook and come back here again.

  • How many Ipods can you use with one Itunes account?

    How many iPods can you use/sync with one iTunes account?

    PT wrote:
    Macistotle wrote:
    Unless you have DRM still haunting your tunes ... Then you can only use those songs on 5 devices. Otherwise, connect as many as you like (as stated above).
    No, you can sync your DRM tracks to an unlimited number of iPods (but only authorized to play on 5 different computers/user accounts)
    Patrick
    So I can sync two iPods to my iTunes account and sync the same digital copy movies that come with some o' my DVDs to both ipods? Do movies make a difference really, DRM-Wise? Thanks in advance.

  • How many laptops can I install on with only one lightroom 6 license? (not cc version)

    I read from somewhere that one creative cloud  account can be used on two different devices, but what about the lightroom 6 version?
    If I pay $149 for lightroom 6, how many laptops can I install on? I now have one windows laptop and one mac.
    Thanks for helping.

    I selected yours as the correct answer because of the webpage you provided, but I cannot understand that what "only use it on one computer at a time".
    If the software is for offline use, how does it know if I'm running it on another computer?

  • How many machines can I install on with one Mountain Lion download?

    I want to upgrade to Mountain Lion, but I have both an iMac and a MacBook Pro.  Do I have to buy two Mountain Lion downloads - one for each, or can I somehow download twice after paying once?
    Judy

    Actually, having made the same claim a couple of days ago and being proven completely wrong, I have a certain responsibility to correct you by mentioning that there is no limit to how many machines ML can be installed on, as long as you own or control those machines.
    See section 2B(i): http://images.apple.com/legal/sla/docs/OSX108.pdf

  • I have 3 older ext. hard drives that I've utilized many times. Today while searching for old files, one of the three is no longer recognized by my PowerMac.  Any suggestions?

    I have 3 older ext. hard drives that I've utilized many times. Today while searching for old files, one of the three is no longer recognized by my PowerMac. The drive is not listed in Disk Utility.  Any suggestions?

    Is the computer in you equipment line:
    Dual Core Intel Xenon
    (which is not a PowerMac but a Mac Pro) the one you are asking about, or do you have an older PowerMac?
    If a Mac Pro, their forums are here:
    Mac Pro
    and, as Mac Pros have a totally different architecture from the pre-2005 Macs this forum covers, you may not have the same issues that can affect the older models. If someone didn't notice your equipment line, you could get advice that doesn't apply.
    If you really have a pre-2005 PowerMac, read on.
    If the stubborn external is USB and does not have its own power brick (i.e., it gets power only from the computer's UBS ports--"bus powered"), it may not be getting enough power. As electric motors age, they can demand more power than when new, and the power available on any USB port is limited.
    The typical workabouts to making a computer recognize an aging, bus-powered USB drive are:
    Get a powered USB hub (has its own power brick
    Get a "Y" USB cable: 1 Meter USB 2.0 A to 5 Pin Mini B Cable - Auxiliary USB "Y" Power Design for external hard drives.
    The second gets power from two USB ports on the computer and often that's enough.
    Remember that the USB ports on your keyboard seldom provide enough power even for a thumb drive, so be sure to use the USB ports on the back of the computer.

  • I have itunes directory on an external hard drive and want to direct a new installation of itunes on windows 8 to use it. I tried holding down ctrl and clicking itunes and after many tries got it to work one time. When I went back in later it had reverted

    I have itunes directory on an external hard drive and want to direct a new installation of itunes on windows 8 to use it. I tried holding down ctrl and clicking itunes and after many tries got it to work one time. When I went back in later it had reverted back to a blank version of itunes and I cant get ctrl to work again. Any other ideas?

    This is sometimes caused by a problem with the iTunesPrefs.xml file, normally found at C:\Users\<User>\AppData\Local\Apple Computer\iTunes\iTunesPrefs.xml. Try dragging this to the desktop and trying again.
    Alternatively the problem may be that you have McAfee AV and it is preventing iTunes from updating the same file and thus causing the problem. See Why does iTunes delete my itunesprefs.xml? for details.
    tt2

  • When I go to a website, it takes me to a different one. No matter how many times I open it, it takes me to random sites.

    If I open a page in a tab it will take me to a completely different site, and no matter how many times I try to close and open a new one, it keeps going to different sites. It also happens when I type the website into the address bar, it still takes me to a random site. Is it something with my computer, or is it Firefox, and if it is a problem with Firefox, how do I fix it?

    Sounds like Malware on your PC.
    Install, update, and run these programs in this order. '''''(Not all programs detect the same Malware.)''''' They are all free for personal use, but some have limited functionality in the "free mode" - but those are features you really don't need to find and remove the problem that you have.<br />
    ''Note: If your Malware infection is bad enough and you are mis-directed to URL's other than what is posted, you may have to use a different PC to download these programs and use a USB stick to transfer them to the afflicted PC.''
    Malwarebytes' Anti-Malware - [http://www.malwarebytes.org/mbam.php] <br />
    SuperAntispyware - [http://www.superantispyware.com/] <br />
    AdAware - [http://www.lavasoftusa.com/software/adaware/] <br />
    Spybot Search & Destroy - [http://www.safer-networking.org/en/index.html] <br />
    Windows Defender: Home Page - [http://www.microsoft.com/windows/products/winfamily/defender/default.mspx]
    If these don't find it or can't clear it, post in one of these forums for specialized malware removal help: <br />
    [http://www.spywarewarrior.com/index.php] <br />
    [http://forum.aumha.org/] <br />
    [http://www.spywareinfoforum.com/] <br />
    [http://bleepingcomputer.com]
    Also, the '''''More system details...''''' to the right of your posting shows that you have a few Plugins that need to be updated. See the Mozilla Plugin Check page. <br />
    http://www.mozilla.com/en-US/plugincheck/

  • Songs disappear from itunes library - and from the harddrive - by itself. One song here and there, not entire albums. Have been surfing on the web, and can see that many people have this problem. What is the solution?

    I'm deeply worried. About to digitalize my entire CD collection, but can't continue until this problem is solved, or i'll risk slowly loosing my music. Song by song. Discovered the problem while browsing the Itunes library, when I realised that for example song number 2 and 11 was missing from one album, and 4 and 7 from another album. Very strange. When browsing the when I found lots of people experiencing the same. I'm using the 2011 Macbook Pro, and the Itunes library is on the Macbook Pro harddrive.
    Hope someone can help....

    just want to add that i use Itunes 10.4.1. But I can see that users have problems with many versions.
    I have an ipod shuffle that i connect once and a while. But the songs that are dissappearing are not the ones on the ipod as far as i can see...

Maybe you are looking for

  • I have no idea how to get rid of a question folder! Help!

    I've had this problem for months now. I'd buy a new laptop but I need the stuff on my hard drive. It started when my safari froze. I tried to close to close the program but then my entire computer froze. So, I had to shut down the laptop. When I went

  • Using jpegEncoder object and filesystem

    Hi, I also posted this in the Flex general forum, but it seems to be more AIR related since it deals with saving to the local disk. I am trying to create a simple AIR application that creates a thumbnail from an image component and saves it as a jpeg

  • Extended Withholding Tax Remittance challan

    Hi, I am unable to generate remittance challan for ext WHT. Can anyone tell me the steps for configuring the same. I would also like to know the process flow of remittance challan and then bank challan and the reflection of the same in reports. I wou

  • T5220 and Solaris 10 U6 -  Jumpstart problem

    Hi Server T5220 booting and installing (Sol 10u6) from DVD without any problem. But when I try to install server via net I have problem. I prepared install server according doc (Solaris 10 8/07 Installation Guide: Network-Based Installation) Install

  • Cisco Meeting Place Express 2.1.1.2 and not working anymore

    Hello, we currently have cisco meeting place express 2.1.1.2; however are now having issues with it.  We are unable to dial to the internal extension that was previously working to login to the meetings and only get a busy signal everytime. Furthermo