Hi
Poor subject title I know, I don't know if this can be done but I'll explain with the example below:
Code:
public class Passport {
...
@ManyToOne
@JoinColumn(name = "COUNTRYCODE")
private CountryCode country;
...
}
The mapping is a ManyToOne annotation mapping which generates a Varchar in mysql with a FK to CountryCode table. I would like to keep using with hbm2ddl though out my project to generate my db schema but in my object model, I want the country in Passport object to be a type String but still have it generated as with FK to CountryCode table in db. Is there another way to map it with annotation to achieve what I describe above or I just have to maintain my schema myself and give up using hbm2ddl?
Thank you.