I am using VP. I am interested in modelling classes in UML in order to generate the java and database code with the persistence layer.
I had a problem with listing (select *) all the items from a table named Service which had one to one association with an other table named Core with a foreign key (idCore).
But I execute the code I had this error :
com.google.gwt.user.server.rpc.UnexpectedException: Service method ‘public abstract java.util.ArrayList com.amea.client.GetServiceListService.getListService()’ threw an unexpected exception: org.hibernate.HibernateException: More than one row with the given identifier was found: 4, for class: com.amea.server.db.Service
here is a description of the 2 tables :
TABLE Service (idService SERIAL NOT NULL, nameService varchar(55), idCore int4 NOT NULL, PRIMARY KEY (idService));
TABLE Core (idCore SERIAL NOT NULL, core varchar(55), PRIMARY KEY (idCore));
ALTER TABLE Service ADD CONSTRAINT FKService18038 FOREIGN KEY (idCore) REFERENCES Core (idCore);
the content of Service :
idservice | nameService | idCore
273 | name1 | 4
274 | name2 | 5
276 | name3 | 4
Thanks in advance for helping me !
Problem Solved : I had a error in the model it was not a one to one relation but many to one thx