Hi,
im using Hibernate 3/Spring 2 and Postgres 8.2
Im trying to map an existig table with a column of char(10). Im working on it since yesterday morning, but i cant find the right mapping-configuration. I thought Hibernate would return a Character[] from a char(x>1), but it seams this was a mistake... Ive tried different datatypes but nothing worked, maybe the error lies somewhere else. hope you guys can help me out with this:
Code:create table foobar(... birthdate character(10)...);Code:<property name="birthdate" type="character" > <column name="birthdate" length="10"/> </property>Code:public Character[] getBirthdate() { return _birthdate; } public void setBirthdate(Character[] birthdate) { this._birthdate = birthdate; }Code:org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of dao.impl.HibernateUbAccountDAOImpl.birthdate at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:104) at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337) at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200) at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854) at org.hibernate.loader.Loader.doQuery(Loader.java:729) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.loadEntity(Loader.java:1860) .... Caused by: java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ....


Reply With Quote

: