[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.jsr220-orm] Re: Could not determine type for: [...], for columns: [...]

Hi Mathias,

I doubt this is a bug.

This is a standard Hibernate mapping exception that usually happens when you
have a non-primitive attribute in your class that has not been properly
mapped.   I bet this has to do with another class that references your
customer, not the actual Customer class.    Is there another class that has
an attribute that is of type Customer.     If so, you probably need to
specify the OneToOne or ManyToOne annotation on that attribute.   That
should be where the problem resides.

Hope this helps ..
-Robert

Robert Greene
JSR220-ORM team lead
rgreene@xxxxxxxxxxx


"Mathias Kluba" <mathias.kluba@xxxxxxxxxxx> wrote in message
news:dhmhuo$ooo$1@xxxxxxxxxxxxxxxxxxx
> I'm not sure if it's a bug and if I must send it to bugzilla...
>
> I have a simple class with a member:
> @Entity(access=AccessType.FIELD)
> public class Customer
> {
>    [...]
>    private int customer_id;
>    [...]
> }
>
> I used the jsr220-orm plugin to define the primary key with this field:
> @Id(generate=GeneratorType.IDENTITY)
> private int customer_id;
>
>
> OK, nice... then I run my main class but I got an exception...
>
> the line wich raise the exception :
> factory = Persistence.createEntityManagerFactory("mycontext");
>
>
> the exception :
> Caused by: org.hibernate.MappingException: Could not determine type for:
> org.mk.model.Customer, for columns:
> [org.hibernate.mapping.Column(CUSTOMER_ID)]
>
>
> I tried to change the type of the field to have something like that :
> @Id(generate=GeneratorType.IDENTITY)
> @Column(jdbcType=Types.SMALLINT)
> private int customer_id;
>
> But now, it makes an error :
> The attribute jdbcType is undefined for the annotation type Column
>
>
> ... so what can I do ? Is it a bug ? Must I do some tricks to make it
> works ?
>
> Thanks for your help,
> Mathias Kluba.