Hi,
I'm new to Hibernate and I'm trying to achieve the following: the class i'm working with is persistent and is stored in DB. It looks like this:
Code:
class Card {
private int id;
private int CardPrototype prototype;
...
};
and has all needed getters and setters and annotations for persistence. Class Card is stored in DB table like this
Code:
CREATE TABLE Card (
id SERIAL NOT NULL,
prototype CHAR(85) NOT NULL,
...
)
The class in relation is CardPrototype, it is identified by a string identifier, and it is not stored in database at all. However, I have a factory class with non-static method
Code:
CardPrototype getPrototype (final String id)
which I want to use to resolve Card.prototype field during ORM object loading. Could you please help me to achieve this with Hibernate?