Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #4280
| From | Biagio <software@notario.it> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Hibernate, iReport and annotation |
| Date | 2011-05-19 00:01 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <1a15b8f2-ecb9-40b1-97f3-5a9bbf62c82e@gh5g2000vbb.googlegroups.com> (permalink) |
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
Back to comp.lang.java.programmer | Previous | Next | Find similar
Hibernate, iReport and annotation Biagio <software@notario.it> - 2011-05-19 00:01 -0700
csiph-web