Hibernate, iReport and annotation

Discussion in 'Java' started by Biagio, May 19, 2011.

  1. Biagio

    Biagio Guest

    Hi,
    I have a blocking problem, most likely I'm missing something.

    I have two tables in my database: "Customers" and "Person"
    The two tables are related to the field 'codPerson'.

    The table Person has two fields:
    codPerson | desPerson

    My problem is as follows. Everything works fine when the row in
    Customers have a value for field 'codPerson' (not empty or not null).
    However, if a customer related field is empty (because optional) shows
    me the error.

    When I use a list with iReport to read one of the fields in the table
    "Person" The application shows
    the following error:

    net.sf.jasperreports.engine.JRException: Error retrieving field value
    from bean: desPerson

    This is my code in Customers annotation:

    @ ManyToOne ()
    @ NotFound (action = NotFoundAction.IGNORE)
    @ JoinColumn (name = "codPerson", unique = true, nullable = true,
    Insertable = false, updatable = false)
    private Person person;

    Again, if all the records in the table Customers have field codPerson
    valued the query works very fine.

    I would like in the query result field 'desReferente' remain empty for
    optional value

    Now I do not know if I have to change the configuration of Hibernate,
    or if I have to manually create the list adding each row.

    Can anyone help me?

    I'm sorry for my english.

    Thanks

    Biagio
     
    Biagio, May 19, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Francesco

    iReport problems

    Francesco, Sep 11, 2006, in forum: Java
    Replies:
    1
    Views:
    5,070
    Byapti
    Jul 31, 2007
  2. sahm
    Replies:
    2
    Views:
    917
  3. Juan Sebastian Arbona

    Reportes de Manera Practica - iReport

    Juan Sebastian Arbona, Dec 15, 2007, in forum: Java
    Replies:
    0
    Views:
    537
    Juan Sebastian Arbona
    Dec 15, 2007
  4. Biagio
    Replies:
    9
    Views:
    6,684
    Travers Naran
    Jan 1, 2011
  5. Biagio

    Netbeans ireport hibernate

    Biagio, Jan 3, 2011, in forum: Java
    Replies:
    0
    Views:
    784
    Biagio
    Jan 3, 2011
Loading...

Share This Page