Fixing issues related to oracle database.

revert-70aa11f8
sinthuja 8 years ago
parent 1c13269fc8
commit 124c0b4cf8

@ -19,6 +19,7 @@
package org.wso2.carbon.device.mgt.core.dao.impl; package org.wso2.carbon.device.mgt.core.dao.impl;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
import org.wso2.carbon.device.mgt.common.GroupPaginationRequest; import org.wso2.carbon.device.mgt.common.GroupPaginationRequest;
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
import org.wso2.carbon.device.mgt.core.dao.GroupDAO; import org.wso2.carbon.device.mgt.core.dao.GroupDAO;
@ -204,8 +205,13 @@ public class GroupDAOImpl implements GroupDAO {
hasOwner = true; hasOwner = true;
} }
if (hasLimit) { if (hasLimit) {
if (conn.getMetaData().getDatabaseProductName().contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_ORACLE) ||
conn.getMetaData().getDatabaseProductName().contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_MSSQL)) {
sql += " OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
} else {
sql += " LIMIT ?, ?"; sql += " LIMIT ?, ?";
} }
}
int paramIndex = 1; int paramIndex = 1;
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
@ -267,8 +273,13 @@ public class GroupDAOImpl implements GroupDAO {
} }
sql += ")"; sql += ")";
if (hasLimit) { if (hasLimit) {
if (conn.getMetaData().getDatabaseProductName().contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_ORACLE) ||
conn.getMetaData().getDatabaseProductName().contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_MSSQL)) {
sql += " OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
} else {
sql += " LIMIT ?, ?"; sql += " LIMIT ?, ?";
} }
}
int paramIndex = 1; int paramIndex = 1;
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
@ -513,7 +524,13 @@ public class GroupDAOImpl implements GroupDAO {
" DM_DEVICE d, (" + " DM_DEVICE d, (" +
"SELECT dgm.DEVICE_ID FROM DM_DEVICE_GROUP_MAP dgm WHERE dgm.GROUP_ID = ?) dgm1 " + "SELECT dgm.DEVICE_ID FROM DM_DEVICE_GROUP_MAP dgm WHERE dgm.GROUP_ID = ?) dgm1 " +
"WHERE d.ID = dgm1.DEVICE_ID AND d.TENANT_ID = ?) gd, DM_DEVICE_TYPE t " + "WHERE d.ID = dgm1.DEVICE_ID AND d.TENANT_ID = ?) gd, DM_DEVICE_TYPE t " +
"WHERE gd.DEVICE_TYPE_ID = t.ID) d1 WHERE d1.DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ? LIMIT ? , ?"; "WHERE gd.DEVICE_TYPE_ID = t.ID) d1 WHERE d1.DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ?";
if (conn.getMetaData().getDatabaseProductName().contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_ORACLE) ||
conn.getMetaData().getDatabaseProductName().contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_MSSQL)) {
sql += " OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
} else {
sql += " LIMIT ?, ?";
}
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, groupId); stmt.setInt(1, groupId);

@ -320,12 +320,12 @@ public class GenericOperationDAOImpl implements OperationDAO {
"de.DEVICE_ID, d.DEVICE_IDENTIFICATION, \n" + "de.DEVICE_ID, d.DEVICE_IDENTIFICATION, \n" +
"d.DEVICE_TYPE_ID, dt.NAME AS DEVICE_TYPE_NAME, eom.STATUS, eom.CREATED_TIMESTAMP, \n" + "d.DEVICE_TYPE_ID, dt.NAME AS DEVICE_TYPE_NAME, eom.STATUS, eom.CREATED_TIMESTAMP, \n" +
"eom.UPDATED_TIMESTAMP, op.OPERATION_CODE, op.TYPE AS OPERATION_TYPE, dor.OPERATION_RESPONSE, \n" + "eom.UPDATED_TIMESTAMP, op.OPERATION_CODE, op.TYPE AS OPERATION_TYPE, dor.OPERATION_RESPONSE, \n" +
"dor.RECEIVED_TIMESTAMP FROM DM_ENROLMENT_OP_MAPPING AS eom \n" + "dor.RECEIVED_TIMESTAMP FROM DM_ENROLMENT_OP_MAPPING eom \n" +
"INNER JOIN DM_OPERATION AS op ON op.ID=eom.OPERATION_ID\n" + "INNER JOIN DM_OPERATION op ON op.ID=eom.OPERATION_ID\n" +
"INNER JOIN DM_ENROLMENT AS de ON de.ID=eom.ENROLMENT_ID\n" + "INNER JOIN DM_ENROLMENT de ON de.ID=eom.ENROLMENT_ID\n" +
"INNER JOIN DM_DEVICE AS d ON d.ID=de.DEVICE_ID \n" + "INNER JOIN DM_DEVICE d ON d.ID=de.DEVICE_ID \n" +
"INNER JOIN DM_DEVICE_TYPE AS dt ON dt.ID=d.DEVICE_TYPE_ID\n" + "INNER JOIN DM_DEVICE_TYPE dt ON dt.ID=d.DEVICE_TYPE_ID\n" +
"LEFT JOIN DM_DEVICE_OPERATION_RESPONSE AS dor ON dor.ENROLMENT_ID=de.id \n" + "LEFT JOIN DM_DEVICE_OPERATION_RESPONSE dor ON dor.ENROLMENT_ID=de.id \n" +
"AND dor.OPERATION_ID = eom.OPERATION_ID\n" + "AND dor.OPERATION_ID = eom.OPERATION_ID\n" +
"WHERE eom.OPERATION_ID = ? AND de.TENANT_ID = ?"; "WHERE eom.OPERATION_ID = ? AND de.TENANT_ID = ?";

@ -148,11 +148,12 @@ public class OperationMappingDAOImpl implements OperationMappingDAO {
//devices to be active at that moment. Hence filtering by 'ACTIVE' & 'UNREACHABLE' device states. //devices to be active at that moment. Hence filtering by 'ACTIVE' & 'UNREACHABLE' device states.
String sql = "SELECT ENROLMENT_ID, D.DEVICE_IDENTIFICATION AS DEVICE_IDENTIFIER, MIN(CREATED_TIMESTAMP) " + String sql = "SELECT ENROLMENT_ID, D.DEVICE_IDENTIFICATION AS DEVICE_IDENTIFIER, MIN(CREATED_TIMESTAMP) " +
"AS CREATED_TIMESTAMP, E.STATUS AS ENROLMENT_STATUS, E.TENANT_ID FROM " + "AS CREATED_TIMESTAMP, E.STATUS AS ENROLMENT_STATUS, E.TENANT_ID FROM " +
"DM_ENROLMENT_OP_MAPPING AS OP INNER JOIN DM_ENROLMENT E ON OP.ENROLMENT_ID = E.ID INNER JOIN " + "DM_ENROLMENT_OP_MAPPING OP INNER JOIN DM_ENROLMENT E ON OP.ENROLMENT_ID = E.ID INNER JOIN " +
"DM_DEVICE D ON E.DEVICE_ID = D.ID WHERE " + "DM_DEVICE D ON E.DEVICE_ID = D.ID WHERE " +
"OP.STATUS IN ('"+ Operation.Status.PENDING.name() + "','" + Operation.Status.REPEATED.name() + "') " + "OP.STATUS IN ('"+ Operation.Status.PENDING.name() + "','" + Operation.Status.REPEATED.name() + "') " +
"AND OP.CREATED_TIMESTAMP BETWEEN ? AND ? AND E.STATUS IN ('" + EnrolmentInfo.Status.ACTIVE.name() + "AND OP.CREATED_TIMESTAMP BETWEEN ? AND ? AND E.STATUS IN ('" + EnrolmentInfo.Status.ACTIVE.name() +
"','" + EnrolmentInfo.Status.UNREACHABLE.name() + "') AND D.DEVICE_TYPE_ID = ? GROUP BY ENROLMENT_ID"; "','" + EnrolmentInfo.Status.UNREACHABLE.name() + "') AND D.DEVICE_TYPE_ID = ? GROUP BY " +
"ENROLMENT_ID, D.DEVICE_IDENTIFICATION,E.STATUS, E.TENANT_ID";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setLong(1, maxDuration); stmt.setLong(1, maxDuration);
stmt.setLong(2, minDuration); stmt.setLong(2, minDuration);
@ -182,7 +183,7 @@ public class OperationMappingDAOImpl implements OperationMappingDAO {
//We are specifically looking for operation mappings in 'Pending' & 'Repeated' states. Further we want //We are specifically looking for operation mappings in 'Pending' & 'Repeated' states. Further we want
//devices to be active at that moment. Hence filtering by 'ACTIVE' & 'UNREACHABLE' device states. //devices to be active at that moment. Hence filtering by 'ACTIVE' & 'UNREACHABLE' device states.
String sql = "SELECT OP.ENROLMENT_ID AS EID, MAX(OP.UPDATED_TIMESTAMP) AS LAST_CONNECTED_TIME FROM " + String sql = "SELECT OP.ENROLMENT_ID AS EID, MAX(OP.UPDATED_TIMESTAMP) AS LAST_CONNECTED_TIME FROM " +
"DM_ENROLMENT_OP_MAPPING AS OP INNER JOIN DM_ENROLMENT E ON OP.ENROLMENT_ID = E.ID INNER JOIN " + "DM_ENROLMENT_OP_MAPPING OP INNER JOIN DM_ENROLMENT E ON OP.ENROLMENT_ID = E.ID INNER JOIN " +
"DM_DEVICE D ON E.DEVICE_ID = D.ID WHERE " + "DM_DEVICE D ON E.DEVICE_ID = D.ID WHERE " +
"OP.STATUS = '" + Operation.Status.COMPLETED.name() + "'" + "OP.STATUS = '" + Operation.Status.COMPLETED.name() + "'" +
"AND OP.UPDATED_TIMESTAMP >= ? AND E.STATUS IN ('" + EnrolmentInfo.Status.ACTIVE.name() + "AND OP.UPDATED_TIMESTAMP >= ? AND E.STATUS IN ('" + EnrolmentInfo.Status.ACTIVE.name() +

@ -23,6 +23,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException; import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService; import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService;
@ -62,7 +63,7 @@ public class ProcessorImpl implements Processor {
@Override @Override
public List<Device> execute(SearchContext searchContext) throws SearchMgtException { public List<Device> execute(SearchContext searchContext) throws SearchMgtException {
if(!Utils.validateOperators(searchContext.getConditions())){ if (!Utils.validateOperators(searchContext.getConditions())) {
throw new SearchMgtException("Invalid validator is provided."); throw new SearchMgtException("Invalid validator is provided.");
} }
@ -268,10 +269,10 @@ public class ProcessorImpl implements Processor {
} else if (type.getColumnType().equals(ValueType.columnType.INTEGER)) { } else if (type.getColumnType().equals(ValueType.columnType.INTEGER)) {
stmt.setInt(x, type.getIntValue()); stmt.setInt(x, type.getIntValue());
x++; x++;
} else if (type.getColumnType().equals(ValueType.columnType.LONG)){ } else if (type.getColumnType().equals(ValueType.columnType.LONG)) {
stmt.setLong(x, type.getLongValue()); stmt.setLong(x, type.getLongValue());
x++; x++;
} else if(type.getColumnType().equals(ValueType.columnType.DOUBLE)){ } else if (type.getColumnType().equals(ValueType.columnType.DOUBLE)) {
stmt.setDouble(x, type.getDoubleValue()); stmt.setDouble(x, type.getDoubleValue());
x++; x++;
} }
@ -360,8 +361,9 @@ public class ProcessorImpl implements Processor {
try { try {
conn = this.getConnection(); conn = this.getConnection();
String query = "SELECT * FROM DM_DEVICE_INFO WHERE DEVICE_ID IN ("; String query = "SELECT * FROM DM_DEVICE_INFO WHERE DEVICE_ID IN (";
if (conn.getMetaData().getDatabaseProductName().contains("H2") || conn.getMetaData() if (conn.getMetaData().getDatabaseProductName().contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_H2) || conn.getMetaData()
.getDatabaseProductName().contains("MySQL")) { .getDatabaseProductName().contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_MYSQL) ||
conn.getMetaData().getDatabaseProductName().contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_ORACLE)) {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
for (int i = 0; i < devices.size(); i++) { for (int i = 0; i < devices.size(); i++) {
builder.append("?,"); builder.append("?,");
@ -374,8 +376,9 @@ public class ProcessorImpl implements Processor {
} else { } else {
query += "?) ORDER BY DEVICE_ID"; query += "?) ORDER BY DEVICE_ID";
stmt = conn.prepareStatement(query); stmt = conn.prepareStatement(query);
Array array = conn.createArrayOf("INT", Utils.getArrayOfDeviceIds(devices)); for (int i = 0; i < devices.size(); i++) {
stmt.setArray(1, array); stmt.setInt(i, devices.get(i).getId());
}
} }
rs = stmt.executeQuery(); rs = stmt.executeQuery();

@ -113,13 +113,12 @@ public class QueryBuilderImpl implements QueryBuilder {
queries.put(Constants.LOCATION, this.processLocation(locCondition)); queries.put(Constants.LOCATION, this.processLocation(locCondition));
} }
if (log.isDebugEnabled()) { // if (log.isDebugEnabled()) {
log.debug("General Query : " + queries.get(Constants.GENERAL)); log.info("General Query : " + queries.get(Constants.GENERAL));
log.debug("Property with AND Query : " + queries.get(Constants.PROP_AND)); log.info("Property with AND Query : " + queries.get(Constants.PROP_AND));
log.debug("Property with OR Query : " + queries.get(Constants.PROP_OR)); log.info("Property with OR Query : " + queries.get(Constants.PROP_OR));
log.debug("Location related Query : " + queries.get(Constants.LOCATION)); log.info("Location related Query : " + queries.get(Constants.LOCATION));
} // }
return queries; return queries;
} }
@ -342,10 +341,10 @@ public class QueryBuilderImpl implements QueryBuilder {
"DD.SSID, DD.CPU_USAGE, DD.TOTAL_RAM_MEMORY, DD.AVAILABLE_RAM_MEMORY, \n" + "DD.SSID, DD.CPU_USAGE, DD.TOTAL_RAM_MEMORY, DD.AVAILABLE_RAM_MEMORY, \n" +
"DD.PLUGGED_IN, DD.UPDATE_TIMESTAMP, DL.LATITUDE, DL.LONGITUDE, DL.STREET1, DL.STREET2, DL.CITY, DL.ZIP, \n" + "DD.PLUGGED_IN, DD.UPDATE_TIMESTAMP, DL.LATITUDE, DL.LONGITUDE, DL.STREET1, DL.STREET2, DL.CITY, DL.ZIP, \n" +
"DL.STATE, DL.COUNTRY, DL.UPDATE_TIMESTAMP AS DL_UPDATED_TIMESTAMP, DE.OWNER, DE.OWNERSHIP, DE.STATUS " + "DL.STATE, DL.COUNTRY, DL.UPDATE_TIMESTAMP AS DL_UPDATED_TIMESTAMP, DE.OWNER, DE.OWNERSHIP, DE.STATUS " +
"AS DE_STATUS FROM DM_DEVICE_DETAIL AS DD INNER JOIN DM_DEVICE AS D ON D.ID=DD.DEVICE_ID\n" + "AS DE_STATUS FROM DM_DEVICE_DETAIL DD INNER JOIN DM_DEVICE D ON D.ID=DD.DEVICE_ID\n" +
"LEFT JOIN DM_DEVICE_LOCATION AS DL ON DL.DEVICE_ID=D.ID \n" + "LEFT JOIN DM_DEVICE_LOCATION DL ON DL.DEVICE_ID=D.ID \n" +
"INNER JOIN DM_DEVICE_TYPE AS DT ON DT.ID=D.DEVICE_TYPE_ID\n" + "INNER JOIN DM_DEVICE_TYPE DT ON DT.ID=D.DEVICE_TYPE_ID\n" +
"INNER JOIN DM_ENROLMENT AS DE ON D.ID=DE.DEVICE_ID\n" + "INNER JOIN DM_ENROLMENT DE ON D.ID=DE.DEVICE_ID\n" +
"WHERE D.TENANT_ID = ? "; "WHERE D.TENANT_ID = ? ";
ValueType type = new ValueType(); ValueType type = new ValueType();
@ -370,11 +369,11 @@ public class QueryBuilderImpl implements QueryBuilder {
"DD.PLUGGED_IN, DD.UPDATE_TIMESTAMP, DL.LATITUDE, DL.LONGITUDE, DL.STREET1, DL.STREET2, DL.CITY, DL.ZIP, \n" + "DD.PLUGGED_IN, DD.UPDATE_TIMESTAMP, DL.LATITUDE, DL.LONGITUDE, DL.STREET1, DL.STREET2, DL.CITY, DL.ZIP, \n" +
"DL.STATE, DL.COUNTRY, DL.UPDATE_TIMESTAMP AS DL_UPDATED_TIMESTAMP, DI.KEY_FIELD, DI.VALUE_FIELD, \n" + "DL.STATE, DL.COUNTRY, DL.UPDATE_TIMESTAMP AS DL_UPDATED_TIMESTAMP, DI.KEY_FIELD, DI.VALUE_FIELD, \n" +
"DE.OWNER, DE.OWNERSHIP, DE.STATUS AS DE_STATUS " + "DE.OWNER, DE.OWNERSHIP, DE.STATUS AS DE_STATUS " +
"FROM DM_DEVICE_DETAIL AS DD INNER JOIN DM_DEVICE AS D ON D.ID=DD.DEVICE_ID\n" + "FROM DM_DEVICE_DETAIL DD INNER JOIN DM_DEVICE D ON D.ID=DD.DEVICE_ID\n" +
"LEFT JOIN DM_DEVICE_LOCATION AS DL ON DL.DEVICE_ID=D.ID \n" + "LEFT JOIN DM_DEVICE_LOCATION DL ON DL.DEVICE_ID=D.ID \n" +
"INNER JOIN DM_DEVICE_TYPE AS DT ON DT.ID=D.DEVICE_TYPE_ID\n" + "INNER JOIN DM_DEVICE_TYPE DT ON DT.ID=D.DEVICE_TYPE_ID\n" +
"INNER JOIN DM_ENROLMENT AS DE ON D.ID=DE.DEVICE_ID\n" + "INNER JOIN DM_ENROLMENT DE ON D.ID=DE.DEVICE_ID\n" +
"LEFT JOIN DM_DEVICE_INFO AS DI ON DI.DEVICE_ID=D.ID\n" + "LEFT JOIN DM_DEVICE_INFO DI ON DI.DEVICE_ID=D.ID\n" +
"WHERE D.TENANT_ID = ? "; "WHERE D.TENANT_ID = ? ";
ValueType type = new ValueType(); ValueType type = new ValueType();

@ -38,8 +38,7 @@ import java.util.List;
* FeatureDAO implementation for DB engines with ANSI SQL support. * FeatureDAO implementation for DB engines with ANSI SQL support.
*/ */
public final class GenericFeatureDAOImpl extends AbstractFeatureDAO { public final class GenericFeatureDAOImpl extends AbstractFeatureDAO {
private static final int BATCH_SIZE = 10;
private static final Log log = LogFactory.getLog(GenericFeatureDAOImpl.class);
@Override @Override
public List<ProfileFeature> addProfileFeatures(List<ProfileFeature> features, int profileId) throws public List<ProfileFeature> addProfileFeatures(List<ProfileFeature> features, int profileId) throws
@ -54,31 +53,36 @@ public final class GenericFeatureDAOImpl extends AbstractFeatureDAO {
conn = this.getConnection(); conn = this.getConnection();
String query = "INSERT INTO DM_PROFILE_FEATURES (PROFILE_ID, FEATURE_CODE, DEVICE_TYPE, CONTENT, " + String query = "INSERT INTO DM_PROFILE_FEATURES (PROFILE_ID, FEATURE_CODE, DEVICE_TYPE, CONTENT, " +
"TENANT_ID) VALUES (?, ?, ?, ?, ?)"; "TENANT_ID) VALUES (?, ?, ?, ?, ?)";
stmt = conn.prepareStatement(query, new String[] {"id"}); stmt = conn.prepareStatement(query, new String[]{"id"});
int noRecords = 0;
for (ProfileFeature feature : features) { for (ProfileFeature feature : features) {
stmt.setInt(1, profileId); stmt.setInt(1, profileId);
stmt.setString(2, feature.getFeatureCode()); stmt.setString(2, feature.getFeatureCode());
stmt.setString(3, feature.getDeviceType()); stmt.setString(3, feature.getDeviceType());
// if (conn.getMetaData().getDriverName().contains("H2")) {
// stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent()));
// } else {
stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent())); stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent()));
//}
stmt.setInt(5, tenantId); stmt.setInt(5, tenantId);
stmt.addBatch(); stmt.addBatch();
//Not adding the logic to check the size of the stmt and execute if the size records added is over 1000 noRecords++;
if (noRecords >= BATCH_SIZE && noRecords % BATCH_SIZE == 0) {
stmt.executeBatch();
generatedKeys = stmt.getGeneratedKeys();
int i = noRecords - BATCH_SIZE;
while (generatedKeys.next()) {
features.get(i).setId(generatedKeys.getInt(1));
i++;
}
}
} }
stmt.executeBatch(); stmt.executeBatch();
generatedKeys = stmt.getGeneratedKeys(); generatedKeys = stmt.getGeneratedKeys();
int i = 0; int i = 0;
if (noRecords > BATCH_SIZE) {
i = noRecords - BATCH_SIZE;
}
while (generatedKeys.next()) { while (generatedKeys.next()) {
features.get(i).setId(generatedKeys.getInt(1)); features.get(i).setId(generatedKeys.getInt(1));
i++; i++;
} }
} catch (SQLException | IOException e) { } catch (SQLException | IOException e) {
throw new FeatureManagerDAOException("Error occurred while adding the feature list to the database.", e); throw new FeatureManagerDAOException("Error occurred while adding the feature list to the database.", e);
} finally { } finally {
@ -90,4 +94,5 @@ public final class GenericFeatureDAOImpl extends AbstractFeatureDAO {
private Connection getConnection() throws FeatureManagerDAOException { private Connection getConnection() throws FeatureManagerDAOException {
return PolicyManagementDAOFactory.getConnection(); return PolicyManagementDAOFactory.getConnection();
} }
} }

@ -49,7 +49,7 @@ CREATE TABLE DM_ROLE_GROUP_MAP (
GROUP_ID NUMBER(10) DEFAULT NULL, GROUP_ID NUMBER(10) DEFAULT NULL,
ROLE VARCHAR2(45) DEFAULT NULL, ROLE VARCHAR2(45) DEFAULT NULL,
TENANT_ID NUMBER(10) DEFAULT 0, TENANT_ID NUMBER(10) DEFAULT 0,
CONSTRAINT PK_DM_GROUP PRIMARY KEY (ID), CONSTRAINT PK_DM_ROLE_GROUP PRIMARY KEY (ID),
CONSTRAINT fk_DM_ROLE_GROUP_MAP_GROUP2 FOREIGN KEY (GROUP_ID) CONSTRAINT fk_DM_ROLE_GROUP_MAP_GROUP2 FOREIGN KEY (GROUP_ID)
REFERENCES DM_GROUP (ID) REFERENCES DM_GROUP (ID)
) )

Loading…
Cancel
Save