abstract public BaseModel createEntity(Serializable id) throws ValidateException, DBException;
public T insert(T obj) throws ValidateException, DBException {
try {
// TODO: create entity
BaseModel entity = createEntity(obj.getPrimaryKey());
setEntityAttributes(entity, obj);
getPersistence().update(entity, false);
obj.setNew(false);
updateManyReference(obj);
calcFunctionField(obj);