Following as regards my doubts about Hibernate is concerned.
Let's say I have a database with the table asignatura
.
CREATE TABLE IF NOT EXISTS 'asignatura' (
'id' int(11) NOT NULL,
'name' varchar(12) NOT NULL,
PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
This class in Java would be abstract:
public abstract class Asignatura{
}
Since this would derive for example, Mathematics, Chemistry ...
public class Matematicas extends Asignatura{
}
My question is, how do I save the objects of Matematicas
in the table Asignaturas
, is it automatic? or do we have to do something special?