• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • 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.....
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic