jmix icon indicating copy to clipboard operation
jmix copied to clipboard

Generic class not work correctly

Open anasoid opened this issue 3 years ago • 0 comments

I use a generic class with generic attribute and i have the folowing errors :

Caused by: java.lang.IllegalStateException: Can't find range class 'java.lang.Object' for property 'Localized.item'



@JmixEntity
@MappedSuperclass
public abstract class Localized<T> {
    @JmixGeneratedValue
    @Column(name = "PK", nullable = false)
    @Id
    private Long pk;


    @Column(name = "LOCALE", length = 10)
    private String locale;

    @ManyToOne
    @JoinColumn(name = "ITEM_PK", nullable = false)
    private T item;

//getter and setter


}

and


@JmixEntity
@Table(name = "PRODUCT_LOCALIZED")
@Entity
public class ProductLocalized extends Localized<Product> {

    @Column(name = "NAME", length = 50)
    private String name;

    @Column(name = "DESCRIPTION", length = 250)
    private String description;


}

anasoid avatar May 09 '22 21:05 anasoid