Hi,

I'm trying to create a record using POJOs.
For that purpose I have the following piece of code:

> /**
>
>  * Creates a record from a POJO.
>
>  * 
>
>  * @param pojo
>
>  *            POJO to use for record.
>
>  * @return record
>
>  */
>
> @SuppressWarnings({ "unchecked" })
>
> private <R extends Record> R newRecord(T entity) {
>
> R record = (R) getFactory().newRecord(getTable(), entity);
>
> return record;
>
> }
>
>
The POJOs I have are generated by codegen, sadly enough using this code 
together with one of the POJOs results in the following exception being 
thrown:

> Caused by: org.jooq.exception.DataTypeException: Cannot convert from 0201 
>> (class java.lang.String) to class nl.abbabab.tables.records.EmployeeRecord
>
>         at org.jooq.tools.Convert$ConvertAll.fail(Convert.java:610) 
>> ~[jooq-2.5.0-SNAPSHOT.jar:na]
>
>         at org.jooq.tools.Convert$ConvertAll.from(Convert.java:564) 
>> ~[jooq-2.5.0-SNAPSHOT.jar:na]
>
>         at org.jooq.tools.Convert.convert0(Convert.java:208) 
>> ~[jooq-2.5.0-SNAPSHOT.jar:na]
>
>         at org.jooq.tools.Convert.convert(Convert.java:200) 
>> ~[jooq-2.5.0-SNAPSHOT.jar:na]
>
>         at org.jooq.tools.Convert.convert(Convert.java:259) 
>> ~[jooq-2.5.0-SNAPSHOT.jar:na]
>
>         at org.jooq.impl.AbstractRecord.getValue(AbstractRecord.java:569) 
>> ~[jooq-2.5.0-SNAPSHOT.jar:na]
>
>  
I'm really at a loss here as to what is causing it..
If anyone could tell me where to look to resolve this problem I would 
appreciate it.

Reply via email to