I want to set type of my columns from my Java code manually (table is not created yet). String should be text type in database, and LocalDate should be date type. Afaik without mappings, String will be mapped as VARCHAR type.
Entity:
@Entity
@Table(schema = "subscribers_service", name = "subscribers")
public class Subscriber {
@Id
@Column(name = "email")
private String email;
@Column(name = "subscription_date")
private LocalDate dateOfSubscription;
}
So I want kinda this:
@Id
@Column(name = "email")
@DatabaseType(name = "text")
private String email;
I'm using PotsgreSQL. Is it possible? Or I should manually create database with required column types?