Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 22:30 Go to next message
salah oukoud is currently offline salah oukoudFriend
Messages: 1
Registered: March 2013
Junior Member

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

        } catch (Exception e) {
Re: validate unique column before commit [message #1027063 is a reply to message #1023670] Tue, 26 March 2013 14:13 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What is your problem/question?

James : Wiki : Book : Blog : Twitter
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: Sun Jun 24 17:15:47 GMT 2018

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

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

Back to the top