I have something like this for defining the hibernate type mapping in the entity class:
@Entity
@Table(name = "TEST_TABLE")
public class Test {
@Type( type = "jsonb" )
@Column(name = "CONTENT_FILES")
private List<ContentFile> contentFiles;
}
which map an entity field to a custom defined hibernate type jsonb for supporting PostgreSQL DB.
I would like to change the mapping to another hibernate custom type json for supporting MSSQL DB.
Can I support both mappings in the same entity class?
I tried to use the @Profile annotation but it doesn't work.
@Profile("pgsql")
@Type( type = "jsonb" )
@Profile("mssql")
@Type( type = "json" )
@Column(name = "CONTENT_FILES")
private List<ContentFile> contentFiles;
orm.xmlin which you can override these things for a specific database.