Bohuzel to nepomohlo, hazi to tu samou vyjimku.
------------ Původní zpráva ------------
Od: Lukas Barton <[EMAIL PROTECTED]>
Předmět: Re: hibernate mapovani
Datum: 23.1.2008 22:43:06
----------------------------------------
Napiste anotaci @ManyToOne k deklaracifieldu private Category
parentCategory;
Anotaci @JoinColumn(name="id") muzete IMHO vynechat.
Lukas
> Ahoj, nedari se mi namapovat tridu Category, nevite prosim nekdo co je spatne?
Hibernate hazi vyjimku:
>
> org.hibernate.MappingException: Could not determine type for:
domain.Category, for columns: [org.hibernate.mapping.Column(parentCategory)]
>
> @MappedSuperclass
> public class BaseEntity {
>
> @Id
> @GeneratedValue(strategy = GenerationType.AUTO)
> private Long id;
>
> @Version
> private int version;
> .....
> }
>
>
>
> @Entity
> public class Category extends BaseEntity {
>
> @OneToMany(cascade = {CascadeType.ALL}, mappedBy = "parentCategory")
> private Set<Category> childCategory;
>
> private Category parentCategory;
> private String name;
> private String description;
>
>
> @ManyToOne
> @JoinColumn(name="id")
> public Category getParentCategory() {
> return parentCategory;
> }
> ...
> }
>
> Nebo bude lepsi znemit domenovy model?
>
>