Hi all,
I have the following object model:
Code:
public interface Component {
void start();
void stop();
}
public class MyComp implements Component {
...
}
public class Server {
Component comp;
void setComponent(Component c) { comp = c; }
// component is a part of the server, but may vary in implementation
}
Let's also assume all components are in a single table (COMPONENT) with a discriminator column (CLASS).
How do I create mapping files for this object model? Hibernate forces me to provide an 'id' in the Component.hbm.xml file, but obviously, I do not want to expose any id-handling in this interface... I'd rather keep it private in the MyComp implementation.
Hibernate version: 3.1
Mapping documents:Code between sessionFactory.openSession() and session.close():Server s1 = new Server();
s1.setComponent(new MyComp());
Full stack trace of any exception that occurs:Name and version of the database you are using:HSQLDB 1.8.0.4
The generated SQL (show_sql=true):Debug level Hibernate log excerpt:[/code]