What's wrong with this code?
 
        db.begin();
        Nation nation = new Nation();
        while(enum.hasMoreElements()) {
          String lang = (String)enum.nextElement();
          NationDescription desc = new NationDescription();
          desc.setLanguage(lang);
          desc.setNation(nation);
          desc.setName("No desc");
          nation.addNationDescription(desc);
          db.create(desc);
        }
        db.create(nation);
        db.commit();
        db.close();
 
This always creates 2 nations on DB and 2xlangnumber nationdescriptions (I tried with 2 languages and with 3).
In the examples I found I don't have to db.create(desc). But if I remove that NationDescriptions will not be created.
Sorry for bad english :)
Thx
Francesco

Reply via email to