If I define the following entity:
{code:java}@Entity public class ExampleEntity {
@Id private int id;
public static ExampleEntity of(int id) { var obj = new ExampleEntity(); obj.setId(id); return obj; }
public int getId() { return id; }
public void setId(int id) { this.id = id; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ExampleEntity that = (ExampleEntity) o; return id == that.id; }
@Override public int hashCode() { return Objects.hash(id); } }{code}
then during metamodel generation i I get error:
{noformat}diagnostic: error: Error generating JPA metamodel: begin 0, end 3, length 2{noformat}
This is caused by factory method *_of_* defined in entity. This example works in 6.2.7.Final |
|