-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Timestamp problem
PostPosted: Tue Feb 15, 2005 8:19 am 
Beginner
Beginner

Joined: Tue Feb 15, 2005 8:14 am
Posts: 32
Hi, just started to use hibernate.

I have a problem with a field with type timestamp.

I use a DB2 database.

I get this error :

Caused by: net.sf.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of dk.te.deb.pojo.Player.draft_date
at net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:68)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:229)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2224)
at net.sf.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:319)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:309)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)

my setter method lookes like this :

/**
* @hibernate.property
* column="DRAFT_DATE"
* type="timestamp"
* not-null="false"
* unique="false"
* insert="true"
* update="true"
*
* @return Returns the draft_date.
*/
public Timestamp getDraft_date() {
return draft_date;
}
/**
* @param draft_date The draft_date to set.
*/
public void setDraft_date(Timestamp draft_date) {
this.draft_date = draft_date;
}

the Timestamp is a java.sql.Timestamp.

The sql that is genereated to create the table is :

create table PLAYER (
PLAYER_ID bigint not null generated by default as identity,
draft_date timestamp not null,
TEAM_ID bigint,
ANNUAL_SALARY float,
FIRST_NAME varchar(20) not null,
JERSEY_NUMBER integer not null,
LAST_NAME varchar(20) not null,
primary key (PLAYER_ID)
);


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.