Reputation: 1035
I have a database that from time to time gets or has columns removed. Is it possible to map these columns using Hibernate if the column names and data types are not known beforehand? Something like:
@Entity
@Table(name = "some_table")
public class SomeTable {
@Id
@GeneratedValue(strategy = GenerationType.Entity)
private String id;
// private List<Object> fields;
}
Upvotes: 0
Views: 109
Reputation: 16400
It's not possible through entities because Hibernate selects exactly the columns you mapped instead of doing a select *
. You can run a native query and run select *
though.
Upvotes: 1