@Maycon_Ricardo escreveu:
Fala Devs beleza, seguinte estou usando o TABLE_PER_CLASS para criar duas tabelas utilizando como herança os campos iguais,certo consegui fazer isso, mais deparei com um problema em outras tabelas onde o tipo da PK é diferente, e com isso da erro:
Error Msg = ORA-01790 : a expressão deve ter o mesmo tipo de dados da expressão correspondente
@Entity @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class PlanningPublication { @NotNull @Column(name = "NUM_ANO") private Integer year; }
@Entity @Table(name = "A15_PLANEJ_PUBL") public class PlanningPublicationClassic extends PlanningPublication { @Id @NotNull @Column(name = "NUM_MANU") private String manual; // esse é var no bd @Column(name = "NUM_DIA") private Integer day; }
@Entity @Table(name = "EPR_BAS_PLANEJ_PUBL") public class PlanningPublicationProgram extends PlanningPublication { @Id @NotNull @Column(name = "NUM_MANU") private Integer manual; // esse é number no bd @Column(name = "DAT_PLANEJ", columnDefinition = "DATETIME") private LocalDateTime plannerDate; }
Dessa forma que postei não funciona pois o PlanningPublication precisa de uma @id e não tem como eu unificar pois são tipos diferentes, se fosse igual funciona. Se eu colocar um tipo so por exemplo String ele mostra a msn inicial.
Desde já agradeço!
Mensagens: 1
Participantes: 1