Hi all,

I am using OJB 0.9.7 in C/S mode.

Is it possible to retrieve the value of the primary key of an object after
an insert ?

In this code, the value of the primary key is allways 0.

Have you an idea ?

                        broker.beginTransaction();      
                                
                                
                                Client objClient = new Client();
                                         objClient.setLogin("Login 1" );
                                         objClient.setNom("Nom 1" );
                                         objClient.setPrenom("Prenom 1");
                                         objClient.setPassword("Password
1");
                        
                                
                                broker.store(objClient);
                                
                                                                
                                log.info("Identifiant : " +
objClient.getId()); // Identifiant : 0
                                
                
                        broker.commitTransaction();

Reply via email to