Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
DB in Entity Layer
Contents
Contents
1. Objective
2. List of API available in Entity Layer
3. Entity Layer Mongo Persistence with multi tenancy[POC]
4. Strategies
5. Action Items
1. Objective
To replace MySQL database with Mongo DB in Entity Layer
4. Strategies
Suppose if
5. Action Items
In some scenario, we are joining multiple tables in my SQL database so we need to
check how we can do it in Mongo DB.
https://docs.mongodb.com/manual/core/data-model-design/
8. MYSQL/Mongo DB
SQL Terms/Concepts
MongoDB Terms/Concepts
database
database
table
collection
SQL Terms/Concepts
MongoDB Terms/Concepts
row
column
field
index
index
table joins
primary key
primary key
aggregation pipeline
aggregation (e.g. group by)
See the SQL to Aggregation Mapping Chart.
"secondaryContactNumber": "string",
"secondaryContactNumberType": "string",
"locationId": "string",
"locationName": "string",
"locationType": "string",
"prefLocation1Id": "string",
"prefLocation1Name": "string",
"prefLocation1Type": "string",
"prefLocation2Id": "string",
"prefLocation2Name": "string",
"prefLocation2Type": "string",
"prefLocation3Id": "string",
"prefLocation3Name": "string",
"prefLocation3Type": "string",
"clientCreatedOn": "2016-05-25T06:34:34.941Z",
"clientUpdatedOn": "2016-05-25T06:34:34.941Z",
"sourceName": "string",
"sourceNameId": "string",
"sourceType": "string",
"sourceTypeId": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:34:34.941Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:34:34.941Z",
"flowId": "string",
"duplicate": "string",
"candidateUrl": "string",
"requisitionIds": ["string"],
"entityAddressBean": [{
"id": "string",
"entityType": 0,
"entityId": "string",
"addressType": "string",
"line1": "string",
"line2": "string",
"line3": "string",
"city": "string",
"state": "string",
"country": "string",
"pincode": "string",
"flowId": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:34:34.941Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:34:34.941Z"
}],
"candidateEducationMapBean": [{
"id": "string",
"candidateId": "string",
"instituteId": "string",
"instituteName": "string",
"instituteAddressId": "string",
"degreeId": "string",
"degreeName": "string",
"major": "string",
"enrolledDate": "2016-05-25T06:34:34.941Z",
"passoutDate": "2016-05-25T06:34:34.941Z",
"gradeTypeId": "string",
"gradeTypeName": "string",
"gradeMaxValue": "string",
"isHighestDegree": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:34:34.941Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:34:34.941Z",
"flowId": "string"
}],
"candidateEmployerMapBean": [{
"id": "string",
"candidateId": "string",
"employerName": "string",
"employerId": "string",
"employmentTypeId": "string",
"employmentTypeName": "string",
"employerAddressId": "string",
"designationId": "string",
"designationName": "string",
"startDate": "2016-05-25T06:34:34.941Z",
"endDate": "2016-05-25T06:34:34.941Z",
"isCurrentEmployer": "string",
"currentCtc": 0,
"currentFixedSalary": 0,
"currentVariableSalary": 0,
"currentCtcCurrency": "string",
"currentCtcCurrencyCode": "string",
"employerIndexStart": 0,
"employerIndexEnd": 0,
"createdBy": "string",
"createdOn": "2016-05-25T06:34:34.941Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:34:34.941Z",
"flowId": "string"
}],
"candidateJobFamilyMapBean": [{
"id": "string",
"candidateId": "string",
"jobFamily": "string",
"jobFamilyId": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:34:34.942Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:34:34.942Z",
"flowId": "string"
}],
"candidateSkillMapBean": [{
"id": "string",
"candidateId": "string",
"skill": "string",
"skillExprncMnth": 0,
"skillPrfcncy": 0,
"skillStrength": 0,
"skillOccurrence": "string",
"skillIndex": "string",
"skillRecencyGap": 0,
"createdBy": "string",
"createdOn": "2016-05-25T06:34:34.942Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:34:34.942Z",
"flowId": "string"
}],
"candidateProjectMapBean": [{
"id": "string",
"candidateId": "string",
"projectName": "string",
"projectType": "string",
"clientName": "string",
"employerName": "string",
"startDate": "2016-05-25T06:34:34.942Z",
"endDate": "2016-05-25T06:34:34.942Z",
"description": "string",
"roleId": "string",
"roleName": "string",
"projectIndexStart": 0,
"projectIndexEnd": 0,
"createdBy": "string",
"createdOn": "2016-05-25T06:34:34.942Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:34:34.943Z",
"flowId": "string"
}],
"requisitionCandidateMappingBean": [{
"id": "string",
"requisitionId": "string",
"candidateId": "string",
"candidateDisplayId": "string",
"requisitionDisplayId": "string",
"isCurrent": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:34:34.943Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:34:34.943Z",
"flowId": "string",
"richnnessIndex": 0
}]
}
"requisitionCandidateMappingBean": [{
"id": "string",
"requisitionId": "string",
"candidateId": "string",
"candidateDisplayId": "string",
"requisitionDisplayId": "string",
"isCurrent": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:34:34.943Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:34:34.943Z",
"flowId": "string",
"richnnessIndex": 0
}]
requisitionCandidateMappingBean is kept outside , since this collection holds mapping of
candidates and requisitions and it requires frequent access while tagging and untagging.
Requisition Json Structure:
{
"id": "string",
"displayId": "string",
"jobTitle": "string",
"exprncFromMnth": 0,
"exprncToMnth": 0,
"statusDisplay": "string",
"statusCode": "string",
"totalOpenPositions": 0,
"jobDescriptionUrl": "string",
"crntOpenPositions": 0,
"openDate": "2016-05-25T06:39:59.300Z",
"closeDate": "2016-05-25T06:39:59.300Z",
"minComp": 0,
"maxComp": 0,
"currencyCode": "string",
"jobLevelId": "string",
"jobLevel": "string",
"businessUnitId": "string",
"businessUnit": "string",
"clientCreatedOn": "2016-05-25T06:39:59.300Z",
"clientUpdatedOn": "2016-05-25T06:39:59.300Z",
"createdBy": "string",
"createdOn": "2016-05-25T06:39:59.300Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:39:59.300Z",
"flowId": "string",
"duplicate": "string",
"criticality": 0,
"reqSourceMapBean": [{
"id": "string",
"reqId": "string",
"sourceName": "string",
"sourceNameId": "string",
"sourceType": "string",
"sourceTypeId": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:39:59.300Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:39:59.300Z",
"flowId": "string"
}],
"reqSkillMapBean": [{
"id": "string",
"reqId": "string",
"skillCategory": "string",
"skill": "string",
"skillExprncFromMnth": 0,
"skillExprncToMnth": 0,
"skillPrfcncyFrom": 0,
"skillPrfcncyTo": 0,
"skillOccurrence": "string",
"skillIndex": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:39:59.300Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:39:59.300Z",
"flowId": "string"
}],
"reqLocationMapBean": [{
"id": "string",
"reqId": "string",
"locationId": "string",
"locationName": "string",
"locationType": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:39:59.301Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:39:59.301Z",
"flowId": "string"
}],
"reqJobFamilyMapBean": [{
"id": "string",
"reqId": "string",
"jobFamilyId": "string",
"jobFamily": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:39:59.301Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:39:59.301Z",
"flowId": "string"
}],
"reqUserMapBean": [{
"id": "string",
"userId": "string",
"emailId": "string",
"reqId": "string",
"createdBy": "string",
"createdOn": "2016-05-25T06:39:59.301Z",
"updatedBy": "string",
"updatedOn": "2016-05-25T06:39:59.301Z",
"flowId": "string"
}],
"screenSelect": 0,
"screenReject": 0,
"totalCount": 0,
"businessSelect": 0,
"businessReject": 0,
"interviewedCandidates": 0,
"offerReleasedCandidates": 0,
"hiredCandidates": 0,
"yetToJoin": 0
}