Otis wrote:
If the domainentity exists in the DB, then it should contain data tho. It's a bit unclear on which entity the outofsync occurs at: the fetched domainentity?
Could you please provide more info: what database, selfservicing or adapter and please provide a code snippet what exactly you're doing.
The fetched EmpGeneralEntity is the one that's out of sync. We're using an Oracle database and adapter.
// Here's how we call the fetch function and try to access the data fields
Grb.Platform.Framework.Business.Lower.FactoryAdapter.AdapterConnection adapterConnection = Grb.Platform.Framework.Business.Lower.AuditUtility.CreateAdapterConnection();
Grb.Platform.Framework.Business.Lower.EntityClasses.EmpGeneralEntity empGeneralEntity = GetEmpGeneralEntityByEmployeeId(employeeId, adapterConnection);
auditInformation.DomainId = empGeneralEntity.DomainId.ToString(System.Globalization.CultureInfo.InvariantCulture);
auditInformation.DomainNumber = empGeneralEntity.Domain.Domainnumber.ToString(System.Globalization.CultureInfo.InvariantCulture);
// Here's where we try to fetch the EmpGeneralEntity from the Auditor
private static Grb.Platform.Framework.Business.Lower.EntityClasses.EmpGeneralEntity GetEmpGeneralEntityByEmployeeId(int employeeId, Grb.Platform.Framework.Business.Lower.FactoryAdapter.AdapterConnection adapterConnection)
{
Grb.Platform.Framework.Business.Lower.EntityClasses.EmpGeneralEntity empGeneralEntity = new Grb.Platform.Framework.Business.Lower.EntityClasses.EmpGeneralEntity(employeeId);
SD.LLBLGen.Pro.ORMSupportClasses.IncludeFieldsList empGeneralIncludeFieldsList = new SD.LLBLGen.Pro.ORMSupportClasses.IncludeFieldsList();
empGeneralIncludeFieldsList.Add(Grb.Platform.Framework.Business.Lower.HelperClasses.EmpGeneralFields.DomainId);
var preFetchPath = new SD.LLBLGen.Pro.ORMSupportClasses.PrefetchPath2(Grb.Platform.Framework.Business.Lower.EntityType.EmpGeneralEntity);
var domainIncludeFieldsList = new SD.LLBLGen.Pro.ORMSupportClasses.IncludeFieldsList();
domainIncludeFieldsList.Add(Grb.Platform.Framework.Business.Lower.HelperClasses.DomainFields.Domainnumber);
preFetchPath.Add(Grb.Platform.Framework.Business.Lower.EntityClasses.EmpGeneralEntity.PrefetchPathDomain, domainIncludeFieldsList);
using (SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter adapter = Grb.Platform.Framework.Business.Lower.FactoryAdapter.FactoryAdapter.GetDataAccessAdapter(adapterConnection))
{
adapter.FetchEntity(empGeneralEntity, preFetchPath, null, empGeneralIncludeFieldsList);
}
return empGeneralEntity;
}