This id column annotation:
Code:
@Column(name = "ID", nullable = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "genAmortizaId")
@Id
@javax.persistence.SequenceGenerator(name = "genAmortizaId",
sequenceName = "AMO_GEN_ID")
private Long id;
worrked prefectly in prevous release 4.3.11 using dialect MySQL5InnoDBDialect cause MySql does not support sequences and AUTO was translated to ID.
But using release 5.0.2 Hib tries to use sequences and, of course, MySQL complains.
The reason why I left SequenceGenerator behind is because, depending on Dialect passed, I can use MySQL or Oracle.
Besides, if I try to generate DDL using SchemaExport (that worked previously with no problem) Tables are completely wrong generated.
I can give Model used, if needed, but I suggest a previous Test using this Id and next Table annotation:
Code:
@DynamicInsert
@DynamicUpdate
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@OptimisticLocking
@Table(name = "AMORTIZA",
uniqueConstraints = {
@javax.persistence.UniqueConstraint(name = "AMO_IDX_AMORTIZA",
columnNames = { "INMOVILIZADO_ID", "CODIGO" })
})
@org.hibernate.annotations.Table(appliesTo = "AMORTIZA",
comment = "Datos para fiscal")
public class Amortiza
and any other column and you will see how last part of Table is (using ! delimiter)
Code:
) ENGINE=InnoDB!
comment='Datos para fiscal'!
and Id is not properly generated
and validators like @NotNull are not used for DDL...