2020-08-27

Hibernate JPA @Type Example

@Type

The @Type annotation is used to specify the Hibernate @Type used by the currently annotated basic attribute.

Custom BasicType mapping

@Entity(name = "Product")
public static class Product {

@Id
private Integer id;

@Type( type = "bitset" )
private BitSet bitSet;

public Integer getId() {
return id;
}

//Getters and setters are omitted for brevity
}

No comments:

Post a Comment