Hibernate: Can I Use an Entity Without @Id or @EmbeddedId?

  Kiến thức lập trình

I want to define an entity class without any identifier at all.or without unique identity

@Entity
@Table(name = "payment_gateway_hourly_error")
public class PaymentGatewayHourlyError {

    @Transient        // I want this field to be ignored by Hibernate while saving in database 
    private Long id;

    @Column(name = "jsonFile_date")
    private LocalDate jsonFile_date; 

    @Column(name = "hour")
    private int hour;

    @Column(length = 128, nullable = false)
    @JsonProperty("Payment_Gateway")
    private String Payment_Gateway;

    @Column(length = 128, nullable = false)
    @JsonProperty("Error")
    private String Error;

    @Column(length = 128, nullable = false)
    @JsonProperty("Count")
    private int Count;

   
}

1

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website Kho Theme wordpress Kho Theme WP Theme WP

LEAVE A COMMENT