• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JPA strange error.

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

I can't resolve this problem:

The type [interface java.util.List] for the attribute [zamowieniaList] on the entity class [class projekttest.Klienci] is not a valid type for a serialized mapping. The attribute type must implement the Serializable interface.




Adnotations:






Could anyone help me?

Regards
 
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mar Kis..

How about if you configure your mapping like this below?..





Please reconfirm the result either error or success..
Thanks..
 
Marek Kisiel
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for advice, but it changes nothing. I am getting still the same exception without remove @Basic(optional = false).
However if I remove @Basic(optional = false) I have another exception:

Exception Description: [class projekttest.Klienci] uses a non-entity [class projekttest.Zamowienia] as target entity in the relationship attribute [private java.util.List projekttest.Klienci.zamowieniaList].



But I am sure that Zamowienia class is a entity, It was generated but netbeans and has a adnotation:

@Entity
@Table(name = "zamowienia")
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about this?..

@OneToMany(cascade = CascadeType.ALL, mappedBy = "klient", targetEntity=Klienci.class)
private List<Zamowienia> zamowieniaList=new ArrayList<Zamowienia>();

Thanks..
 
Marek Kisiel
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing still works
I'll try to do it once again without auto-generator.
Thank you again.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In //Zamowienia.java try with this...
@Id
@Column(name="ID")
public Long getId(){
return this.id;
}
public void setId(Long id){
this.id=id;
}

Please tell me if you get the same exception.....
 
What are you doing? You are supposed to be reading this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic