repo.jdbc-postgres.json revision 962eb0542c63ff26b7c13d2058a9f53349d48d35
{
"connection" : {
"dbType" : "POSTGRESQL",
"jndiName" : "",
"driverClass" : "org.postgresql.Driver",
"jdbcUrl" : "jdbc:postgresql://localhost:5432/openidm",
"username" : "openidm",
"password" : "openidm",
"defaultCatalog" : "openidm",
"maxBatchSize" : 100,
"maxTxRetry" : 5,
"enableConnectionPool" : true,
"connectionTimeoutInMs" : 30000
},
"queries" : {
"genericTables" : {
"credential-query" : "SELECT fullobject::text FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE json_extract_path_text(fullobject, 'userName') = ${username} AND json_extract_path_text(fullobject, 'accountStatus') = 'active' AND objtype.objecttype = ${_resource}",
"find-by-id" : "SELECT fullobject::text 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::text FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE json_extract_path_text(fullobject, ${field}) = ${value} AND objtype.objecttype = ${_resource}",
"get-users-of-direct-role" : "select obj.fullobject::text from ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id INNER JOIN ${_dbSchema}.${_propTable} prop ON obj.id = prop.${_mainTable}_id where objtype.objecttype = ${_resource} AND prop.propKey LIKE '/roles/%' AND prop.propValue = ${role}",
"query-all-ids" : "SELECT obj.objectid FROM ${_dbSchema}.${_mainTable} obj INNER JOIN objecttypes objtype ON obj.objecttypes_id = objtype.id WHERE objtype.objecttype = ${_resource} LIMIT ${int:_pageSize} OFFSET ${int:_pagedResultsOffset}",
"query-all-ids-count" : "SELECT COUNT(obj.objectid) AS total FROM ${_dbSchema}.${_mainTable} obj INNER JOIN objecttypes objtype ON obj.objecttypes_id = objtype.id WHERE objtype.objecttype = ${_resource}",
"query-all" : "SELECT obj.fullobject::text FROM ${_dbSchema}.${_mainTable} obj INNER JOIN objecttypes objtype ON obj.objecttypes_id = objtype.id WHERE objtype.objecttype = ${_resource} LIMIT ${int:_pageSize} OFFSET ${int:_pagedResultsOffset}",
"query-all-count" : "SELECT COUNT(obj.fullobject) AS total FROM ${_dbSchema}.${_mainTable} obj INNER JOIN objecttypes objtype ON obj.objecttypes_id = objtype.id WHERE objtype.objecttype = ${_resource}",
"for-userName" : "SELECT fullobject::text FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE json_extract_path_text(fullobject, 'userName') = ${uid} AND objtype.objecttype = ${_resource}",
"scan-tasks" : "SELECT fullobject::text FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE (json_extract_path_text(fullobject, VARIADIC string_to_array(SUBSTR(${property},2),'/')) < ${condition.before} AND objtype.objecttype = ${_resource} ) AND ( json_extract_path_text(fullobject, VARIADIC string_to_array(SUBSTR(${taskState.completed},2),'/')) is NULL )",
"query-cluster-instances" : "SELECT fullobject::text FROM ${_dbSchema}.${_mainTable} obj WHERE json_extract_path_text(fullobject, 'timestamp') <= ${timestamp} AND json_extract_path_text(fullobject, 'state') IN ('1','2')",
"get-managed-users" : "SELECT fullobject::text FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE objtype.objecttype = ${_resource} ORDER BY CASE WHEN ${orderByDir} = 'asc' then json_extract_path_text(fullobject, ${orderBy}) ELSE '' END ASC, CASE WHEN ${orderByDir} = 'desc' THEN json_extract_path_text(fullobject, ${orderBy}) ELSE '' END DESC LIMIT ${int:_pageSize} OFFSET ${int:_pagedResultsOffset}",
"get-managed-users-filtered" : "SELECT fullobject::text FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE objtype.objecttype = ${_resource} AND json_extract_path_text(fullobject, 'userName') LIKE concat(${userName},'%') AND json_extract_path_text(fullobject, 'mail') LIKE concat(${mail},'%') AND json_extract_path_text(fullobject, 'givenName') LIKE concat(${givenName},'%') AND json_extract_path_text(fullobject, 'sn') LIKE concat(${sn},'%') AND json_extract_path_text(fullobject, 'accountStatus') LIKE concat(${accountStatus},'%') ORDER BY CASE WHEN ${orderByDir} = 'asc' then json_extract_path_text(fullobject, ${orderBy}) ELSE '' END ASC, CASE WHEN ${orderByDir} = 'desc' THEN json_extract_path_text(fullobject, ${orderBy}) ELSE '' END DESC LIMIT ${int:_pageSize} OFFSET ${int:_pagedResultsOffset}",
"get-managed-users-count" : "SELECT '{\"total\":' || COUNT(*) || '}' AS fullobject FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE objtype.objecttype = ${_resource}",
"get-managed-users-filtered-count" : "SELECT '{\"total\":' || COUNT(*) || '}' AS fullobject FROM ${_dbSchema}.${_mainTable} obj INNER JOIN ${_dbSchema}.objecttypes objtype ON objtype.id = obj.objecttypes_id WHERE objtype.objecttype = ${_resource} AND json_extract_path_text(fullobject, 'userName') LIKE concat(${userName},'%') AND json_extract_path_text(fullobject, 'mail') LIKE concat(${mail},'%') AND json_extract_path_text(fullobject, 'givenName') LIKE concat(${givenName},'%') AND json_extract_path_text(fullobject, 'sn') LIKE concat(${sn},'%') AND json_extract_path_text(fullobject, 'accountStatus') LIKE concat(${accountStatus},'%')"
},
"explicitTables" : {
"get-users-of-direct-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} order by createDate desc",
"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",
"audit-by-mapping" : "SELECT * FROM ${_dbSchema}.auditrecon WHERE mapping = ${mappingName}",
"audit-by-recon-id" : "SELECT * FROM ${_dbSchema}.auditrecon WHERE reconId = ${reconId}",
"audit-by-recon-id-type" : "SELECT * FROM ${_dbSchema}.auditrecon WHERE reconId = ${reconId} AND entryType = ${entryType}",
"audit-by-recon-id-situation" : "SELECT * FROM ${_dbSchema}.auditrecon WHERE reconId = ${reconId} AND situation = ${situation}",
"audit-by-activity-parent-action" : "SELECT * FROM ${_dbSchema}.auditactivity WHERE parentactionid = ${parentActionId}",
"query-all" : "SELECT * FROM ${_dbSchema}.${_table}"
}
},
"resourceMapping" : {
"default" : {
"mainTable" : "genericobjects",
"propertiesTable" : "genericobjectproperties",
"searchableDefault" : true
},
"genericMapping" : {
"managed/*" : {
"mainTable" : "managedobjects",
"propertiesTable" : "managedobjectproperties",
"searchableDefault" : true
},
"managed/user" : {
"mainTable" : "managedobjects",
"propertiesTable" : "managedobjectproperties",
"searchableDefault" : false,
"properties": {
"/roles": {
"searchable": true
}
}
},
"scheduler" : {
"mainTable" : "schedulerobjects",
"propertiesTable" : "schedulerobjectproperties",
"searchableDefault" : false
},
"cluster" : {
"mainTable" : "clusterobjects",
"propertiesTable" : "clusterobjectproperties",
"searchableDefault" : false
}
},
"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",
"reconAction" : "reconaction",
"situation" : "situation",
"sourceObjectId" : "sourceobjectid",
"status" : "status",
"targetObjectId" : "targetobjectid",
"ambiguousTargetObjectIds" : "ambiguoustargetobjectids",
"timestamp" : "activitydate",
"actionId" : "actionid",
"exception" : "exceptiondetail",
"mapping" : "mapping",
"messageDetail" : { "column" : "messagedetail", "type" : "JSON_MAP" }
}
},
"audit/access" : {
"table" : "auditaccess",
"objectToColumn" : {
"_id" : "objectid",
"action" : "activity",
"ip" : "ip",
"principal" : "principal",
"roles" : "roles",
"status" : "status",
"timestamp" : "activitydate"
}
},
"security" : {
"table" : "security",
"objectToColumn" : {
"_id" : "objectid",
"_rev" : "rev",
"storeString" : "storestring"
}
},
"security/keys" : {
"table" : "securitykeys",
"objectToColumn" : {
"_id" : "objectid",
"_rev" : "rev",
"keyPair" : "keypair"
}
}
}
}
}