hello,
I get this exception:
Code:
org.hibernate.exception.ConstraintViolationException: could not insert: [de.bhc.pepa.Report]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
[...]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.SQLException: Attempt to insert null into a non-nullable column: column: ID table: REPORTS in statement [insert into reports (id, dirname, project_id, zaehler) values (null, ?, ?, ?)]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
... 38 more
for this class:
Code:
@Entity
@Table(name="reports")
public class Report implements ToolTipProvider, Modifiable{
@Id
@GeneratedValue
protected Long id;
@Column
private Integer zaehler;
[...]
This only happens in old Databases which contained an old (and completely
different) version of "Report" (same name!). I checked that these older
Databases do not have any Report-Instances, and the list of fields from the
new "Report" habe been appended to the list of fields in the old "reports"
table:
Code:
Reports:
ID
CREATION_DATE
DESCRIPTION
MODIFICATION_DATE
NAME
OWNER
_PROJECT_ID
// following are the new fields:
DIRNAME
ZAEHLER
PROJECT_ID
Is there a way to fix this other than renaming the new "Report" class?
Can we make hibernate forget about these old classes?
Thanks a lot in advance!