someone know how do to hibernate follow the order of the fields of the my class (order of the fields of the class == order of the columns in table )
class processo
Code:
@EmbeddedId
private ProcessoPk processoPk;
@Column(length=1, nullable=false)
private String situacao;
@Column(name="tipo_vitima", length=30)
private String tipoVitima;
//set and get
class ProcessoPk
Code:
@ManyToOne
@ForeignKey(name="fk_processo_empresa")
@JoinColumn(name="empresa",columnDefinition="INTEGER",nullable=false)
private Empresa empresa;
@Column(name="ano",columnDefinition="INTEGER",nullable=false)
private Integer ano;
@Column(name="processo",columnDefinition="INTEGER",nullable=false)
private Integer processo;
//set and get
Code:
CREATE TABLE PROCESSO
(
ANO INTEGER NOT NULL,
PROCESSO INTEGER NOT NULL,
TIPO_VITIMA VARCHAR( 30) COLLATE NONE,
SITUACAO VARCHAR( 1) NOT NULL COLLATE NONE,
EMPRESA INTEGER NOT NULL,
PRIMARY KEY (ANO, EMPRESA, PROCESSO)
)
The column in table doesn't follows the same sequence the class.
thanks!
excuse-me my english