jpa troubleshooting etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
jpa troubleshooting etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

11 Şubat 2010 Perşembe

trouble in persisting type List <String> in jpa

Trying to persist an attribute with type List causes trouble in jpa.
here is a link: http://stackoverflow.com/questions/287201/how-to-persist-a-property-of-type-liststringin-jpa
the solution is changing from List to String with separated values with delimiter..
the explanation by Bill James at Nov 13 '08 at 15:34 (the above link) seems good..

18 Ekim 2009 Pazar

Could not execute JDBC batch update

the error Could not execute JDBC batch update comes out when the entities are as follows and you are trying to save the parent entity:

parent entity
  @OneToMany(cascade = CascadeType.ALL)
   @JoinTable(name = "TBL_INCIDENT_ABSEVIDGRP", joinColumns = {
        @JoinColumn(name = "FLD_INCIDENT_ID")
    },
    inverseJoinColumns = {
        @JoinColumn(name = "FLD_ABSEVIDGRP_ID")
    })
private List childList = new ArrayList();

child entity
    @ManyToOne
    @JoinTable(name = "TBL_INCIDENT_ABSEVIDGRP", joinColumns = {
        @JoinColumn(name = "FLD_ABSEVIDGRP_ID")
    },
    inverseJoinColumns = {
        @JoinColumn(name = "FLD_INCIDENT_ID")
    })
private Parent parent;

the error is solved by commenting out the green and bold code portion..
the lack of red code portion leads to the following error while saving the parent entity:
Error while commiting the transaction
javax.persistence.RollbackException: Error while commiting the transaction
        at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:71)
...
Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: Child Entity