我有带有id
注释的字段的实体@Id
:
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
@Entity
@Table(name = "orders")
@Data
@SuperBuilder
@NoArgsConstructor
public class Order {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
}
当我使用mvn mn:run
. 但是,如果使用构建应用程序mvn package -Dpackaging=native-image
然后运行构建的应用程序,我会收到一个错误:
org.hibernate.AnnotationException: No identifier specified for entity: Order
micronaut 版本:2.3.4,micronaut 数据版本:2.2.4