#Spring
1 messages · Page 1 of 1 (latest)
<@&1004656351647117403> please have a look, thanks.
package com.gallery.gallery.model;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@MappedSuperclass
public class BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "creation_time")
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private Date creationTime;
@Column(name = "update_time")
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private Date updateTime;
}
my BaseEntity class
looks like basic attribute types shouldn't be containers
when i dont use super class and add id in user class it works
i think putting @Transient above the method might solve your issue too
Yeah it is but I wonder why I an getting this error
When I don’t extend baseentitity class there is no error
JPA probably recognizes the method as a getter but can't find any related attribute to persist