Announcement Announcement Module
Collapse
No announcement yet.
Saving object with composite PK Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Saving object with composite PK

    I have used DBRE and a TObject has been created with a TObjectPK as composite primary key.

    When I fill the TObject fields and try to save it, although every field is correctly filled, an exception is raised indicating I have not assigned the userId (I think it is related to the field of TObjectPK but I see no relationship in the code between both classes):

    Internal Exception: org.postgresql.util.PSQLException: ERROR: el valor null para la columna «id_usuario» viola la restricción not null
    Error Code: 0
    Call: INSERT INTO public.t_evnto_usuario (fin_juego, inicio_juego, id_evento, id_usuario) VALUES (?, ?, ?, ?)
    bind => [4 parameters bound]
    Query: InsertObjectQuery(TEventoUsuario[id=<null>,idEvento=La vuelta al mundo en 10 volcanes,idUsuario=gianpaolo,inicioJuego=java.euti l.GregorianCalendar[.......])
    What changes I need from the default mapping for avoiding the creation of an TObjectPK to save and TObject?

    Thanks!
Working...
X