use of org.bimserver.database.actions.AddExtendedDataSchemaDatabaseAction in project BIMserver by opensourceBIM.
the class ServiceImpl method addExtendedDataSchema.
@Override
public Long addExtendedDataSchema(SExtendedDataSchema extendedDataSchema) throws ServerException, UserException {
// requireAdminAuthenticationAndRunningServer();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
ExtendedDataSchema create = session.create(ExtendedDataSchema.class);
ExtendedDataSchema convert = getBimServer().getSConverter().convertFromSObject(extendedDataSchema, create, session);
return session.executeAndCommitAction(new AddExtendedDataSchemaDatabaseAction(session, getInternalAccessMethod(), convert));
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations