Boa tarde!
Gostaria muito da ajuda de vocês para mapear(via annotation) uma tabela do meu BD e um Enum
CLASSE JAVA
@Entity
@Table(name = "tipoendereco", schema = "dbo")
public enum TipoEndereco {
PJ_FISCAL(1), PJ_COBRANCA(2), PONTO(3), SERVIÇO_COBRANCA(4), INDEFINIDO(255);
@Id
@Column(name = "id_tipo")
private int tipoEndereco;
private TipoEndereco(int tipoEndereco) {
this.tipoEndereco = tipoEndereco;
}
public int getTipoEndereco() {
return this.tipoEndereco;
}
}
TABELA BD
CREATE TABLE dbo.TipoEndereco(
ID_Tipo tinyint NOT NULL,
Tipo varchar(30) NOT NULL,
PRIMARY KEY ID_Tipo
);
Desde já agradeço.
