Hello Guys, I have three class : BaseEntity, User, DaoCore
package com.game.data.core.entity;import jakarta.persistence.*;import lombok.Data;import java.io.Serializable;import java.time.LocalDateTime;@MappedSuperclass@Datapublic abstract class BaseEntity implements Serializable {
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
protected Integer id; @Column(name = "created", nullable = false, updatable = false)
protected LocalDateTime created; @Column(name = "updated", nullable = false)
protected LocalDateTime updated; public BaseEntity() {
this.created = LocalDateTime.now(); this.updated = LocalDateTime.now(); }
@PreUpdate public void preUpdate() {
this.updated = LocalDateTime.now(); }
}
User class :
package com.game.data.core.entity;
import jakarta.persistence.Entity;
import lombok.Data;
@Entity
@Data
public class User extends BaseEntity {
private String username;
private String password;
}
And AbstractServiceCRUD :
And AbstractControllerCRUD :
And class : UserController
*When I call to api : /api/user/find/ {id} it gives an error :* org.hibernate.UnknownEntityTypeException: Unable to locate entity descriptor: com.game.data.core.entity.BaseEntity If I call API /api/user/insert it still works, please help me, thanks |