My environment:
Hibernate 1.0 JPA Netbeans 7.01 Sql server 2005
Part of code:
public class EdiAgendamentoCliente implements Serializable {
private static final long 开发者_StackOverflowserialVersionUID = 1L;
@Id
@GeneratedValue (strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id_edi", unique = true, nullable = true)
private Integer idEdi;
Error:
"java.lang.IllegalArgumentException: id to load is required for loading"
Im trying to insert values into a table with auto increment, but its not working, can you guys give me some direction here?
Change it to nullable false, and check column name in database matches the name attribute
@Column(name = "id_edi", unique = true, nullable = false)
精彩评论