I have some entity mapped to a sql view as
@Entity
@Immutable
@Table(name = "SOME_VIEW")
public class MyClass implements Serializable {
@Id
@Column(name = "SOME_COL", insertable = false, updatable = false)
private Integer id;
...
}
Today I was told that on one one of servers, column SOME_COL
in SOME_VIEW
will be filled with nulls, and I should use SOME_OTHER_COL
as id, depending on value in config.properties
file. Since @Column
has @Retention(RUNTIME)
, might it be possible that I can change mapping to @Column(name = "SOME_OTHER_COL")
before application starts on tomcat?
Aucun commentaire:
Enregistrer un commentaire