Hi,
We are in a situation where we want all our entities to have some common fields. Lets say we want to have a BaseEntity with a field deleted that is a boolean defining the state of the entity. We are happy having to define "extends @BaseEntity" for every single Entity definition but the problem we are experiencing is that it does translate into a composition approach in the db.
Example would be:
----------------------------------------------------------------------
Sculptor:
----------------------------------------------------------------------
abstract Entity BaseEntity {
boolean deleted;
}
Entity SomeEntity extends @Entity {
String name;
}
----------------------------------------------------------------------
this gets translated into a ddl like:
----------------------------------------------------------------------
CREATE TABLE BASE_ENTITY (
BASE_ENTITY_ID BIGINT NOT NULL,
DELETED BOOLEAN
);
CREATE TABLE SOME_ENTITY (
SOME_ENTITY_ID BIGINT NOT NULL,
NAME VARCHAR(10),
BASE_ENTITY_ID BIGINT NOT NULL
);
----------------------------------------------------------------------
where we would like something more like:
----------------------------------------------------------------------
CREATE TABLE SOME_ENTITY (
SOME_ENTITY_ID BIGINT NOT NULL,
NAME VARCHAR(10),
DELETED BOOLEAN
);
----------------------------------------------------------------------
Is there anyway to achieve this?
Best regards,
Andreu