Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » validate unique column before commit(validate unique column before commit)
validate unique column before commit [message #1023670] Sun, 24 March 2013 18:30 Go to next message
Eclipse UserFriend
hello

i want to validate my entity in persiste function, before commit transaction!

can you help me please !

code :
try {
            EntityManagerFactory emf = Persistence.createEntityManagerFactory("Certif_Resid_DAO");
            ProfessionJpaController controller = new ProfessionJpaController(emf);
            Profession profession = new Profession("titi"); // "titi" :name of profession with name is unique
            
            controller.create(profession); //insert into entitymanager
            controller.create(profession); // here insert will be throw an exception before commit to database
            
            assertTrue(true);

        } catch (Exception e) {
            fail(e.getMessage());
        }
Re: validate unique column before commit [message #1027063 is a reply to message #1023670] Tue, 26 March 2013 10:13 Go to previous message
Eclipse UserFriend
What is your problem/question?
Previous Topic:metamodel with two data sources using annotations
Next Topic:Aggregated objects cannot be written/deleted/queried independently from their owners
Goto Forum:
  


Current Time: Fri Jul 25 16:57:56 EDT 2025

Powered by FUDForum. Page generated in 0.03273 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top