repo.jdbc.json revision d0e39b14d7dc9dbba1c17f6a8e4aaee6e230e04e
{
"connection" : {
"dbType" : "MYSQL",
"jndiName" : "",
"driverClass" : "com.mysql.jdbc.Driver",
"jdbcUrl" : "jdbc:mysql://localhost:3306/openidm",
"username" : "root",
"password" : "",
"defaultCatalog" : "openidm",
"maxBatchSize" : 100,
"maxTxRetry" : 5,
"enableConnectionPool" : true
},
"queries" : {
"genericTables" : {
"credential-query" : "SELECT fullobject FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.${_propTable} prop ON obj.id = prop.${_mainTable}_id INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE prop.propkey='/userName' AND prop.propvalue = ${username} AND objtype.objecttype = ${_resource}",
"find-by-id" : "SELECT fullobject FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE obj.objectid = ${id} AND objtype.objecttype = ${_resource}",
"get-by-field-value" : "SELECT fullobject FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.${_propTable} prop ON obj.id = prop.${_mainTable}_id INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE prop.propkey='/' + ${field} AND prop.propvalue = ${value} AND objtype.objecttype = ${_resource}",
"get-users-of-role" : "select 'userName' as propkey, propvalue from ${_dbSchema}.${_propTable} where ${_mainTable}_id = (SELECT prop.${_mainTable}_id from ${_dbSchema}.${_propTable} prop WHERE prop.propkey='/roles' AND prop.propvalue regexp concat('^(.*,)?',${role},'(,.*)?$') and propkey = '/username'",
"query-all-ids" : "SELECT obj.fullobject FROM ${_dbSchema}.${_mainTable} obj INNER JOIN objecttypes objtype ON obj.objecttypes_id = objtype.id WHERE objtype.objecttype = ${_resource}",
"query-all" : "SELECT obj.fullobject FROM ${_dbSchema}.${_mainTable} obj INNER JOIN objecttypes objtype ON obj.objecttypes_id = objtype.id WHERE objtype.objecttype = ${_resource}",
"for-userName" : "SELECT fullobject FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.${_propTable} prop ON obj.id = prop.${_mainTable}_id INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE prop.propkey='/userName' AND prop.propvalue = ${uid} AND objtype.objecttype = ${_resource}",
"credential-internaluser-query" : "SELECT credprop.${_mainTable}_id, credprop.propkey, credprop.propvalue FROM ${_dbSchema}.${_propTable} credprop INNER JOIN ${_dbSchema}.${_mainTable} obj ON obj.id = credprop.${_mainTable}_id INNER JOIN ${_dbSchema}.${_propTable} conditionprop ON obj.id = conditionprop.${_mainTable}_id INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE credprop.propkey='/userPassword' AND conditionprop.propkey='/_id' AND conditionprop.propvalue = ${username} AND objtype.objecttype = ${_resource}",
"scan-tasks" : "SELECT fullobject FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.${_propTable} prop ON obj.id = prop.${_mainTable}_id INNER JOIN ${_dbSchema}.${_propTable} complete ON obj.id = complete.${_mainTable}_id INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE ( prop.propkey=${property} AND prop.propvalue < ${condition.before} AND objtype.objecttype = ${_resource} ) AND ( complete.propkey=${taskState.completed} AND complete.propvalue is NULL )"
},
"explicitTables" : {
"get-users-of-role" : "select objectid from ${_dbSchema}.${_table} where roles regexp concat('^(.*,)?',${role},'(,.*)?$')",
"query-all-ids" : "SELECT objectid FROM ${_dbSchema}.${_table}",
"for-internalcredentials" : "select * FROM openidm.internaluser WHERE objectid = ${uid}",
"get-notifications-for-user" : "select * FROM ${_dbSchema}.${_table} WHERE receiverId = ${userId}",
"credential-query" : "SELECT * FROM ${_dbSchema}.${_table} WHERE objectid = ${username}",
"credential-internaluser-query" : "SELECT objectid, pwd, roles FROM ${_dbSchema}.${_table} WHERE objectid = ${username}",
"links-for-firstId" : "SELECT * FROM ${_dbSchema}.${_table} WHERE linkType = ${linkType} AND firstid = ${firstId}",
"links-for-secondId" : "SELECT * FROM ${_dbSchema}.${_table} WHERE linkType = ${linkType} AND secondid = ${secondId}",
"links-for-linkType" : "SELECT * FROM ${_dbSchema}.${_table} WHERE linkType = ${linkType}",
"scan-tasks" : "SELECT * FROM ${_dbSchema}.${_table} WHERE ${property} < ${condition.before} AND ${taskState.completed} is NULL"
}
},
"resourceMapping" : {
"default" : {
"mainTable" : "genericobjects",
"propertiesTable" : "genericobjectproperties",
"searchableDefault" : true
},
"genericMapping" : {
"managed/*" : {
"mainTable" : "managedobjects",
"propertiesTable" : "managedobjectproperties",
"searchableDefault" : true
},
"scheduler" : {
"mainTable" : "schedulerobjects",
"propertiesTable" : "schedulerobjectproperties",
"searchableDefault" : true
}
},
"explicitMapping" : {
"link" : {
"table" : "links",
"objectToColumn" : {
"_id" : "objectid",
"_rev" : "rev",
"linkType" : "linktype",
"firstId" : "firstid",
"secondId" : "secondid"
}
},
"ui/notification" : {
"table" : "uinotification",
"objectToColumn" : {
"_id" : "objectid",
"_rev" : "rev",
"requester" : "requester",
"requesterId" : "requesterId",
"receiverId" : "receiverId",
"createDate" : "createDate",
"notificationType" : "notificationType",
"notificationSubtype" : "notificationSubtype",
"message" : "message"
}
},
"internal/user" : {
"table" : "internaluser",
"objectToColumn" : {
"_id" : "objectid",
"_rev" : "rev",
"password" : "pwd",
"roles" : "roles"
}
},
"audit/activity" : {
"table" : "auditactivity",
"objectToColumn" : {
"_id" : "objectid",
"activityId" : "activityid",
"timestamp" : "activitydate",
"action" : "activity",
"message" : "message",
"objectId" : "subjectid",
"rev" : "subjectrev",
"rootActionId" : "rootactionid",
"parentActionId" : "parentactionid",
"requester" : "requester",
"approver" : "approver",
"before" : "subjectbefore",
"after" : "subjectafter",
"status" : "status",
"changedFields" : "changedfields",
"passwordChanged" : "passwordchanged"
}
},
"audit/recon" : {
"table" : "auditrecon",
"objectToColumn" : {
"_id" : "objectid",
"entryType" : "entrytype",
"rootActionId" : "rootactionid",
"action" : "activity",
"message" : "message",
"reconciling" : "reconciling",
"reconId" : "reconid",
"situation" : "situation",
"sourceObjectId" : "sourceobjectid",
"status" : "status",
"targetObjectId" : "targetobjectid",
"ambiguousTargetObjectIds" : "ambiguoustargetobjectids",
"timestamp" : "activitydate"
}
},
"audit/access" : {
"table" : "auditaccess",
"objectToColumn" : {
"_id" : "objectid",
"action" : "activity",
"ip" : "ip",
"principal" : "principal",
"roles" : "roles",
"status" : "status",
"timestamp" : "activitydate"
}
}
}
}
}