I'm wondering if it's possible to map different data types. For instance, I have a Visit data type in Java, which has a userEmail field which is of the type String, and can I map it with hibernate to a database table which would have userID instead of userEmail? And according to the id it would find the email and return to java the email and vice versa? Is this possible?
If yes, then how would the mapping look like? Or how is this supposed to look like:
<many-to-one name="patientEmail"
column="idPatient"
not-null="true"
class="com.my.myapp.datamodel.Patient"/>