use of com.evolveum.midpoint.repo.sql.data.common.RUser in project midpoint by Evolveum.
the class ObjectDeltaUpdaterTest method test120AddActivation.
@Test
public void test120AddActivation() throws Exception {
OperationResult result = new OperationResult("test120AddActivation");
List<ItemDelta<?, ?>> modifications = prismContext.deltaFor(UserType.class).item(UserType.F_ACTIVATION).add(new ActivationType(prismContext).administrativeStatus(ActivationStatusType.ARCHIVED)).asItemDeltas();
TestStatementInspector.start();
repositoryService.modifyObject(UserType.class, userOid, modifications, result);
TestStatementInspector.dump();
/*
- select oid from m_object where oid = ? for update
- select ruser0_.oid as oid1_27_, ruser0_2_.createChannel as createCh2_27_, ruser0_2_.createTimestamp as createTi3_27_, ruser0_2_.creatorRef_relation as creatorR4_27_, ruser0_2_.creatorRef_targetOid as creatorR5_27_, ruser0_2_.creatorRef_type as creatorR6_27_, ruser0_2_.fullObject as fullObje7_27_, ruser0_2_.lifecycleState as lifecycl8_27_, ruser0_2_.modifierRef_relation as modifier9_27_, ruser0_2_.modifierRef_targetOid as modifie10_27_, ruser0_2_.modifierRef_type as modifie11_27_, ruser0_2_.modifyChannel as modifyC12_27_, ruser0_2_.modifyTimestamp as modifyT13_27_, ruser0_2_.name_norm as name_no14_27_, ruser0_2_.name_orig as name_or15_27_, ruser0_2_.objectTypeClass as objectT16_27_, ruser0_2_.tenantRef_relation as tenantR17_27_, ruser0_2_.tenantRef_targetOid as tenantR18_27_, ruser0_2_.tenantRef_type as tenantR19_27_, ruser0_2_.version as version20_27_, ruser0_1_.administrativeStatus as administ1_53_, ruser0_1_.archiveTimestamp as archiveT2_53_, ruser0_1_.disableReason as disableR3_53_, ruser0_1_.disableTimestamp as disableT4_53_, ruser0_1_.effectiveStatus as effectiv5_53_, ruser0_1_.enableTimestamp as enableTi6_53_, ruser0_1_.validFrom as validFro7_53_, ruser0_1_.validTo as validTo8_53_, ruser0_1_.validityChangeTimestamp as validity9_53_, ruser0_1_.validityStatus as validit10_53_, ruser0_1_.costCenter as costCen11_53_, ruser0_1_.emailAddress as emailAd12_53_, ruser0_1_.hasPhoto as hasPhot13_53_, ruser0_1_.locale as locale14_53_, ruser0_1_.locality_norm as localit15_53_, ruser0_1_.locality_orig as localit16_53_, ruser0_1_.preferredLanguage as preferr17_53_, ruser0_1_.telephoneNumber as telepho18_53_, ruser0_1_.timezone as timezon19_53_, ruser0_.additionalName_norm as addition1_73_, ruser0_.additionalName_orig as addition2_73_, ruser0_.employeeNumber as employee3_73_, ruser0_.familyName_norm as familyNa4_73_, ruser0_.familyName_orig as familyNa5_73_, ruser0_.fullName_norm as fullName6_73_, ruser0_.fullName_orig as fullName7_73_, ruser0_.givenName_norm as givenNam8_73_, ruser0_.givenName_orig as givenNam9_73_, ruser0_.honorificPrefix_norm as honorif10_73_, ruser0_.honorificPrefix_orig as honorif11_73_, ruser0_.honorificSuffix_norm as honorif12_73_, ruser0_.honorificSuffix_orig as honorif13_73_, ruser0_.name_norm as name_no14_73_, ruser0_.name_orig as name_or15_73_, ruser0_.nickName_norm as nickNam16_73_, ruser0_.nickName_orig as nickNam17_73_, ruser0_.title_norm as title_n18_73_, ruser0_.title_orig as title_o19_73_ from m_user ruser0_ inner join m_focus ruser0_1_ on ruser0_.oid=ruser0_1_.oid inner join m_object ruser0_2_ on ruser0_.oid=ruser0_2_.oid where ruser0_.oid=?
- update m_object set createChannel=?, createTimestamp=?, creatorRef_relation=?, creatorRef_targetOid=?, creatorRef_type=?, fullObject=?, lifecycleState=?, modifierRef_relation=?, modifierRef_targetOid=?, modifierRef_type=?, modifyChannel=?, modifyTimestamp=?, name_norm=?, name_orig=?, objectTypeClass=?, tenantRef_relation=?, tenantRef_targetOid=?, tenantRef_type=?, version=? where oid=?
- update m_focus set administrativeStatus=?, archiveTimestamp=?, disableReason=?, disableTimestamp=?, effectiveStatus=?, enableTimestamp=?, validFrom=?, validTo=?, validityChangeTimestamp=?, validityStatus=?, costCenter=?, emailAddress=?, hasPhoto=?, locale=?, locality_norm=?, locality_orig=?, preferredLanguage=?, telephoneNumber=?, timezone=? where oid=?
*/
if (isUsingH2()) {
AssertJUnit.assertEquals(4, TestStatementInspector.getQueryCount());
}
try (Session session = factory.openSession()) {
RUser u = session.get(RUser.class, userOid);
AssertJUnit.assertEquals(RActivationStatus.ARCHIVED, u.getActivation().getAdministrativeStatus());
}
}
use of com.evolveum.midpoint.repo.sql.data.common.RUser in project midpoint by Evolveum.
the class ObjectDeltaUpdaterTest method test149ReplaceAssignmentActivationWithNull.
@Test
public void test149ReplaceAssignmentActivationWithNull() throws Exception {
OperationResult result = new OperationResult("test149ReplaceAssignmentActivationWithNull");
List<ItemDelta<?, ?>> modifications = prismContext.deltaFor(UserType.class).item(UserType.F_ASSIGNMENT, 2, AssignmentType.F_ACTIVATION).replace().asItemDeltas();
TestStatementInspector.start();
repositoryService.modifyObject(UserType.class, userOid, modifications, result);
TestStatementInspector.dump();
if (isUsingH2()) {
AssertJUnit.assertEquals(5, TestStatementInspector.getQueryCount());
}
try (Session session = factory.openSession()) {
RUser u = session.get(RUser.class, userOid);
Set<RAssignment> assignments = u.getAssignments();
AssertJUnit.assertEquals(1, assignments.size());
AssertJUnit.assertNull(assignments.iterator().next().getActivation());
}
}
use of com.evolveum.midpoint.repo.sql.data.common.RUser in project midpoint by Evolveum.
the class ExtensionTest method test045ReplaceVisibleExtensionValuesToNull.
// MID-5573
@Test
public void test045ReplaceVisibleExtensionValuesToNull() throws Exception {
OperationResult result = new OperationResult(ExtensionTest.class.getName() + ".test045ReplaceVisibleExtensionValuesToNull");
ObjectDelta<UserType> delta = getPrismContext().deltaFor(UserType.class).item(UserType.F_EXTENSION, EXT_VISIBLE).replace().asObjectDelta("");
delta.applyTo(expectedUser);
queryListener.start();
repositoryService.modifyObject(UserType.class, userOid, delta.getModifications(), getOptions(), result);
queryListener.dumpAndStop();
try (Session session = factory.openSession()) {
RUser u = session.get(RUser.class, userOid);
assertExtension(u, itemHidden1, "h1.2", "h1.5");
assertExtension(u, itemHidden2);
assertExtension(u, itemHidden3);
assertExtension(u, itemVisible);
assertExtension(u, itemWeapon, "w1");
}
assertGetObject(result);
assertSearch(EXT_VISIBLE, "v0", 0, result);
assertSearch(EXT_VISIBLE, "v1", 0, result);
assertSearch(EXT_VISIBLE, "v2", 0, result);
assertSearch(EXT_VISIBLE, "v3", 0, result);
/*
[1] select oid from m_object where oid = ? for update
[1] select ruser0_.oid as oid1_27_, ruser0_2_.createChannel as createCh2_27_, ruser0_2_.createTimestamp as createTi3_27_, ruser0_2_.creatorRef_relation as creatorR4_27_, ruser0_2_.creatorRef_targetOid as creatorR5_27_, ruser0_2_.creatorRef_type as creatorR6_27_, ruser0_2_.fullObject as fullObje7_27_, ruser0_2_.lifecycleState as lifecycl8_27_, ruser0_2_.modifierRef_relation as modifier9_27_, ruser0_2_.modifierRef_targetOid as modifie10_27_, ruser0_2_.modifierRef_type as modifie11_27_, ruser0_2_.modifyChannel as modifyC12_27_, ruser0_2_.modifyTimestamp as modifyT13_27_, ruser0_2_.name_norm as name_no14_27_, ruser0_2_.name_orig as name_or15_27_, ruser0_2_.objectTypeClass as objectT16_27_, ruser0_2_.tenantRef_relation as tenantR17_27_, ruser0_2_.tenantRef_targetOid as tenantR18_27_, ruser0_2_.tenantRef_type as tenantR19_27_, ruser0_2_.version as version20_27_, ruser0_1_.administrativeStatus as administ1_53_, ruser0_1_.archiveTimestamp as archiveT2_53_, ruser0_1_.disableReason as disableR3_53_, ruser0_1_.disableTimestamp as disableT4_53_, ruser0_1_.effectiveStatus as effectiv5_53_, ruser0_1_.enableTimestamp as enableTi6_53_, ruser0_1_.validFrom as validFro7_53_, ruser0_1_.validTo as validTo8_53_, ruser0_1_.validityChangeTimestamp as validity9_53_, ruser0_1_.validityStatus as validit10_53_, ruser0_1_.costCenter as costCen11_53_, ruser0_1_.emailAddress as emailAd12_53_, ruser0_1_.hasPhoto as hasPhot13_53_, ruser0_1_.locale as locale14_53_, ruser0_1_.locality_norm as localit15_53_, ruser0_1_.locality_orig as localit16_53_, ruser0_1_.preferredLanguage as preferr17_53_, ruser0_1_.telephoneNumber as telepho18_53_, ruser0_1_.timezone as timezon19_53_, ruser0_.additionalName_norm as addition1_73_, ruser0_.additionalName_orig as addition2_73_, ruser0_.employeeNumber as employee3_73_, ruser0_.familyName_norm as familyNa4_73_, ruser0_.familyName_orig as familyNa5_73_, ruser0_.fullName_norm as fullName6_73_, ruser0_.fullName_orig as fullName7_73_, ruser0_.givenName_norm as givenNam8_73_, ruser0_.givenName_orig as givenNam9_73_, ruser0_.honorificPrefix_norm as honorif10_73_, ruser0_.honorificPrefix_orig as honorif11_73_, ruser0_.honorificSuffix_norm as honorif12_73_, ruser0_.honorificSuffix_orig as honorif13_73_, ruser0_.name_norm as name_no14_73_, ruser0_.name_orig as name_or15_73_, ruser0_.nickName_norm as nickNam16_73_, ruser0_.nickName_orig as nickNam17_73_, ruser0_.title_norm as title_n18_73_, ruser0_.title_orig as title_o19_73_ from m_user ruser0_ inner join m_focus ruser0_1_ on ruser0_.oid=ruser0_1_.oid inner join m_object ruser0_2_ on ruser0_.oid=ruser0_2_.oid where ruser0_.oid=?
[1] select strings0_.owner_oid as owner_oi2_33_0_, strings0_.item_id as item_id1_33_0_, strings0_.ownerType as ownerTyp3_33_0_, strings0_.stringValue as stringVa4_33_0_, strings0_.item_id as item_id1_33_1_, strings0_.owner_oid as owner_oi2_33_1_, strings0_.ownerType as ownerTyp3_33_1_, strings0_.stringValue as stringVa4_33_1_ from m_object_ext_string strings0_ where strings0_.owner_oid=?
[1] update m_object set createChannel=?, createTimestamp=?, creatorRef_relation=?, creatorRef_targetOid=?, creatorRef_type=?, fullObject=?, lifecycleState=?, modifierRef_relation=?, modifierRef_targetOid=?, modifierRef_type=?, modifyChannel=?, modifyTimestamp=?, name_norm=?, name_orig=?, objectTypeClass=?, tenantRef_relation=?, tenantRef_targetOid=?, tenantRef_type=?, version=? where oid=?
[3] delete from m_object_ext_string where item_id=? and owner_oid=? and ownerType=? and stringValue=?
*/
assertCounts(5, 7);
}
use of com.evolveum.midpoint.repo.sql.data.common.RUser in project midpoint by Evolveum.
the class ExtensionTest method test160ReplaceWholeAssignmentExtension.
@Test
public void test160ReplaceWholeAssignmentExtension() throws Exception {
OperationResult result = new OperationResult(ExtensionTest.class.getName() + ".test055AddWholeExtension");
PrismContainerValue<?> extValue = expectedUser.getDefinition().findContainerDefinition(UserType.F_ASSIGNMENT).findContainerDefinition(AssignmentType.F_EXTENSION).instantiate().getValue();
extValue.findOrCreateProperty(EXT_WEAPON).addRealValues("W4", "W5");
extValue.findOrCreateProperty(EXT_SHIP_NAME).addRealValues("ship");
ObjectDelta<UserType> delta = getPrismContext().deltaFor(UserType.class).item(UserType.F_ASSIGNMENT, 1, AssignmentType.F_EXTENSION).replace(extValue.clone()).asObjectDelta("");
delta.applyTo(expectedUser);
queryListener.start();
repositoryService.modifyObject(UserType.class, userOid, delta.getModifications(), getOptions(), result);
queryListener.dumpAndStop();
try (Session session = factory.openSession()) {
RUser u = session.get(RUser.class, userOid);
assertExtension(u, itemHidden1, "h1.1", "h1.2");
assertExtension(u, itemHidden2);
assertExtension(u, itemHidden3);
assertExtension(u, itemVisible, "v1", "v2", "v3");
assertExtension(u, itemWeapon);
RAssignment a = u.getAssignments().iterator().next();
assertExtension(a, itemWeapon, "W4", "W5");
assertExtension(a, itemShipName, "ship");
}
assertGetObject(result);
/*
[1] select oid from m_object where oid = ? for update
[1] select ruser0_.oid as oid1_27_, ruser0_2_.createChannel as createCh2_27_, ruser0_2_.createTimestamp as createTi3_27_, ruser0_2_.creatorRef_relation as creatorR4_27_, ruser0_2_.creatorRef_targetOid as creatorR5_27_, ruser0_2_.creatorRef_type as creatorR6_27_, ruser0_2_.fullObject as fullObje7_27_, ruser0_2_.lifecycleState as lifecycl8_27_, ruser0_2_.modifierRef_relation as modifier9_27_, ruser0_2_.modifierRef_targetOid as modifie10_27_, ruser0_2_.modifierRef_type as modifie11_27_, ruser0_2_.modifyChannel as modifyC12_27_, ruser0_2_.modifyTimestamp as modifyT13_27_, ruser0_2_.name_norm as name_no14_27_, ruser0_2_.name_orig as name_or15_27_, ruser0_2_.objectTypeClass as objectT16_27_, ruser0_2_.tenantRef_relation as tenantR17_27_, ruser0_2_.tenantRef_targetOid as tenantR18_27_, ruser0_2_.tenantRef_type as tenantR19_27_, ruser0_2_.version as version20_27_, ruser0_1_.administrativeStatus as administ1_53_, ruser0_1_.archiveTimestamp as archiveT2_53_, ruser0_1_.disableReason as disableR3_53_, ruser0_1_.disableTimestamp as disableT4_53_, ruser0_1_.effectiveStatus as effectiv5_53_, ruser0_1_.enableTimestamp as enableTi6_53_, ruser0_1_.validFrom as validFro7_53_, ruser0_1_.validTo as validTo8_53_, ruser0_1_.validityChangeTimestamp as validity9_53_, ruser0_1_.validityStatus as validit10_53_, ruser0_1_.costCenter as costCen11_53_, ruser0_1_.emailAddress as emailAd12_53_, ruser0_1_.hasPhoto as hasPhot13_53_, ruser0_1_.locale as locale14_53_, ruser0_1_.locality_norm as localit15_53_, ruser0_1_.locality_orig as localit16_53_, ruser0_1_.preferredLanguage as preferr17_53_, ruser0_1_.telephoneNumber as telepho18_53_, ruser0_1_.timezone as timezon19_53_, ruser0_.additionalName_norm as addition1_73_, ruser0_.additionalName_orig as addition2_73_, ruser0_.employeeNumber as employee3_73_, ruser0_.familyName_norm as familyNa4_73_, ruser0_.familyName_orig as familyNa5_73_, ruser0_.fullName_norm as fullName6_73_, ruser0_.fullName_orig as fullName7_73_, ruser0_.givenName_norm as givenNam8_73_, ruser0_.givenName_orig as givenNam9_73_, ruser0_.honorificPrefix_norm as honorif10_73_, ruser0_.honorificPrefix_orig as honorif11_73_, ruser0_.honorificSuffix_norm as honorif12_73_, ruser0_.honorificSuffix_orig as honorif13_73_, ruser0_.name_norm as name_no14_73_, ruser0_.name_orig as name_or15_73_, ruser0_.nickName_norm as nickNam16_73_, ruser0_.nickName_orig as nickNam17_73_, ruser0_.title_norm as title_n18_73_, ruser0_.title_orig as title_o19_73_ from m_user ruser0_ inner join m_focus ruser0_1_ on ruser0_.oid=ruser0_1_.oid inner join m_object ruser0_2_ on ruser0_.oid=ruser0_2_.oid where ruser0_.oid=?
[1] select assignment0_.owner_oid as owner_oi2_5_0_, assignment0_.id as id1_5_0_, assignment0_.id as id1_5_1_, assignment0_.owner_oid as owner_oi2_5_1_, assignment0_.administrativeStatus as administ3_5_1_, assignment0_.archiveTimestamp as archiveT4_5_1_, assignment0_.disableReason as disableR5_5_1_, assignment0_.disableTimestamp as disableT6_5_1_, assignment0_.effectiveStatus as effectiv7_5_1_, assignment0_.enableTimestamp as enableTi8_5_1_, assignment0_.validFrom as validFro9_5_1_, assignment0_.validTo as validTo10_5_1_, assignment0_.validityChangeTimestamp as validit11_5_1_, assignment0_.validityStatus as validit12_5_1_, assignment0_.assignmentOwner as assignm13_5_1_, assignment0_.createChannel as createC14_5_1_, assignment0_.createTimestamp as createT15_5_1_, assignment0_.creatorRef_relation as creator16_5_1_, assignment0_.creatorRef_targetOid as creator17_5_1_, assignment0_.creatorRef_type as creator18_5_1_, assignment0_.extId as extId38_5_1_, assignment0_.extOid as extOid39_5_1_, assignment0_.lifecycleState as lifecyc19_5_1_, assignment0_.modifierRef_relation as modifie20_5_1_, assignment0_.modifierRef_targetOid as modifie21_5_1_, assignment0_.modifierRef_type as modifie22_5_1_, assignment0_.modifyChannel as modifyC23_5_1_, assignment0_.modifyTimestamp as modifyT24_5_1_, assignment0_.orderValue as orderVa25_5_1_, assignment0_.orgRef_relation as orgRef_26_5_1_, assignment0_.orgRef_targetOid as orgRef_27_5_1_, assignment0_.orgRef_type as orgRef_28_5_1_, assignment0_.resourceRef_relation as resourc29_5_1_, assignment0_.resourceRef_targetOid as resourc30_5_1_, assignment0_.resourceRef_type as resourc31_5_1_, assignment0_.targetRef_relation as targetR32_5_1_, assignment0_.targetRef_targetOid as targetR33_5_1_, assignment0_.targetRef_type as targetR34_5_1_, assignment0_.tenantRef_relation as tenantR35_5_1_, assignment0_.tenantRef_targetOid as tenantR36_5_1_, assignment0_.tenantRef_type as tenantR37_5_1_, rassignmen1_.owner_id as owner_id1_12_2_, rassignmen1_.owner_owner_oid as owner_ow2_12_2_ from m_assignment assignment0_ left outer join m_assignment_extension rassignmen1_ on assignment0_.extId=rassignmen1_.owner_id and assignment0_.extOid=rassignmen1_.owner_owner_oid where assignment0_.owner_oid=?
[1] select booleans0_.anyContainer_owner_id as anyConta2_6_0_, booleans0_.anyContainer_owner_owner_oid as anyConta3_6_0_, booleans0_.item_id as item_id1_6_0_, booleans0_.booleanValue as booleanV4_6_0_, booleans0_.item_id as item_id1_6_1_, booleans0_.anyContainer_owner_id as anyConta2_6_1_, booleans0_.anyContainer_owner_owner_oid as anyConta3_6_1_, booleans0_.booleanValue as booleanV4_6_1_ from m_assignment_ext_boolean booleans0_ where booleans0_.anyContainer_owner_id=? and booleans0_.anyContainer_owner_owner_oid=?
[1] select dates0_.anyContainer_owner_id as anyConta2_7_0_, dates0_.anyContainer_owner_owner_oid as anyConta3_7_0_, dates0_.item_id as item_id1_7_0_, dates0_.dateValue as dateValu4_7_0_, dates0_.item_id as item_id1_7_1_, dates0_.anyContainer_owner_id as anyConta2_7_1_, dates0_.anyContainer_owner_owner_oid as anyConta3_7_1_, dates0_.dateValue as dateValu4_7_1_ from m_assignment_ext_date dates0_ where dates0_.anyContainer_owner_id=? and dates0_.anyContainer_owner_owner_oid=?
[1] select longs0_.anyContainer_owner_id as anyConta2_8_0_, longs0_.anyContainer_owner_owner_oid as anyConta3_8_0_, longs0_.item_id as item_id1_8_0_, longs0_.longValue as longValu4_8_0_, longs0_.item_id as item_id1_8_1_, longs0_.anyContainer_owner_id as anyConta2_8_1_, longs0_.anyContainer_owner_owner_oid as anyConta3_8_1_, longs0_.longValue as longValu4_8_1_ from m_assignment_ext_long longs0_ where longs0_.anyContainer_owner_id=? and longs0_.anyContainer_owner_owner_oid=?
[1] select polys0_.anyContainer_owner_id as anyConta2_9_0_, polys0_.anyContainer_owner_owner_oid as anyConta3_9_0_, polys0_.item_id as item_id1_9_0_, polys0_.orig as orig4_9_0_, polys0_.item_id as item_id1_9_1_, polys0_.anyContainer_owner_id as anyConta2_9_1_, polys0_.anyContainer_owner_owner_oid as anyConta3_9_1_, polys0_.orig as orig4_9_1_, polys0_.norm as norm5_9_1_ from m_assignment_ext_poly polys0_ where polys0_.anyContainer_owner_id=? and polys0_.anyContainer_owner_owner_oid=?
[1] select references0_.anyContainer_owner_id as anyConta2_10_0_, references0_.anyContainer_owner_owner_oid as anyConta3_10_0_, references0_.item_id as item_id1_10_0_, references0_.targetoid as targetoi4_10_0_, references0_.item_id as item_id1_10_1_, references0_.anyContainer_owner_id as anyConta2_10_1_, references0_.anyContainer_owner_owner_oid as anyConta3_10_1_, references0_.targetoid as targetoi4_10_1_, references0_.relation as relation5_10_1_, references0_.targetType as targetTy6_10_1_ from m_assignment_ext_reference references0_ where references0_.anyContainer_owner_id=? and references0_.anyContainer_owner_owner_oid=?
[1] select strings0_.anyContainer_owner_id as anyConta2_11_0_, strings0_.anyContainer_owner_owner_oid as anyConta3_11_0_, strings0_.item_id as item_id1_11_0_, strings0_.stringValue as stringVa4_11_0_, strings0_.item_id as item_id1_11_1_, strings0_.anyContainer_owner_id as anyConta2_11_1_, strings0_.anyContainer_owner_owner_oid as anyConta3_11_1_, strings0_.stringValue as stringVa4_11_1_ from m_assignment_ext_string strings0_ where strings0_.anyContainer_owner_id=? and strings0_.anyContainer_owner_owner_oid=?
[3] insert into m_assignment_ext_string (item_id, anyContainer_owner_id, anyContainer_owner_owner_oid, stringValue) values (?, ?, ?, ?)
[1] update m_object set createChannel=?, createTimestamp=?, creatorRef_relation=?, creatorRef_targetOid=?, creatorRef_type=?, fullObject=?, lifecycleState=?, modifierRef_relation=?, modifierRef_targetOid=?, modifierRef_type=?, modifyChannel=?, modifyTimestamp=?, name_norm=?, name_orig=?, objectTypeClass=?, tenantRef_relation=?, tenantRef_targetOid=?, tenantRef_type=?, version=? where oid=?
[2] delete from m_assignment_ext_string where item_id=? and anyContainer_owner_id=? and anyContainer_owner_owner_oid=? and stringValue=?
*/
assertCounts(12 + getExtraSafeInsertionSelects(3), 15 + getExtraSafeInsertionSelects(3));
}
use of com.evolveum.midpoint.repo.sql.data.common.RUser in project midpoint by Evolveum.
the class ExtensionTest method test065ReplaceWholeExtensionToNull.
@Test
public void test065ReplaceWholeExtensionToNull() throws Exception {
OperationResult result = new OperationResult(ExtensionTest.class.getName() + ".test065ReplaceWholeExtensionToNull");
ObjectDelta<UserType> delta = getPrismContext().deltaFor(UserType.class).item(UserType.F_EXTENSION).replace().asObjectDelta("");
delta.applyTo(expectedUser);
queryListener.start();
repositoryService.modifyObject(UserType.class, userOid, delta.getModifications(), getOptions(), result);
queryListener.dumpAndStop();
try (Session session = factory.openSession()) {
RUser u = session.get(RUser.class, userOid);
assertExtension(u, itemHidden1);
assertExtension(u, itemHidden2);
assertExtension(u, itemHidden3);
assertExtension(u, itemVisible);
assertExtension(u, itemWeapon);
}
assertGetObject(result);
/*
[1] select oid from m_object where oid = ? for update
[1] select ruser0_.oid as oid1_27_, ruser0_2_.createChannel as createCh2_27_, ruser0_2_.createTimestamp as createTi3_27_, ruser0_2_.creatorRef_relation as creatorR4_27_, ruser0_2_.creatorRef_targetOid as creatorR5_27_, ruser0_2_.creatorRef_type as creatorR6_27_, ruser0_2_.fullObject as fullObje7_27_, ruser0_2_.lifecycleState as lifecycl8_27_, ruser0_2_.modifierRef_relation as modifier9_27_, ruser0_2_.modifierRef_targetOid as modifie10_27_, ruser0_2_.modifierRef_type as modifie11_27_, ruser0_2_.modifyChannel as modifyC12_27_, ruser0_2_.modifyTimestamp as modifyT13_27_, ruser0_2_.name_norm as name_no14_27_, ruser0_2_.name_orig as name_or15_27_, ruser0_2_.objectTypeClass as objectT16_27_, ruser0_2_.tenantRef_relation as tenantR17_27_, ruser0_2_.tenantRef_targetOid as tenantR18_27_, ruser0_2_.tenantRef_type as tenantR19_27_, ruser0_2_.version as version20_27_, ruser0_1_.administrativeStatus as administ1_53_, ruser0_1_.archiveTimestamp as archiveT2_53_, ruser0_1_.disableReason as disableR3_53_, ruser0_1_.disableTimestamp as disableT4_53_, ruser0_1_.effectiveStatus as effectiv5_53_, ruser0_1_.enableTimestamp as enableTi6_53_, ruser0_1_.validFrom as validFro7_53_, ruser0_1_.validTo as validTo8_53_, ruser0_1_.validityChangeTimestamp as validity9_53_, ruser0_1_.validityStatus as validit10_53_, ruser0_1_.costCenter as costCen11_53_, ruser0_1_.emailAddress as emailAd12_53_, ruser0_1_.hasPhoto as hasPhot13_53_, ruser0_1_.locale as locale14_53_, ruser0_1_.locality_norm as localit15_53_, ruser0_1_.locality_orig as localit16_53_, ruser0_1_.preferredLanguage as preferr17_53_, ruser0_1_.telephoneNumber as telepho18_53_, ruser0_1_.timezone as timezon19_53_, ruser0_.additionalName_norm as addition1_73_, ruser0_.additionalName_orig as addition2_73_, ruser0_.employeeNumber as employee3_73_, ruser0_.familyName_norm as familyNa4_73_, ruser0_.familyName_orig as familyNa5_73_, ruser0_.fullName_norm as fullName6_73_, ruser0_.fullName_orig as fullName7_73_, ruser0_.givenName_norm as givenNam8_73_, ruser0_.givenName_orig as givenNam9_73_, ruser0_.honorificPrefix_norm as honorif10_73_, ruser0_.honorificPrefix_orig as honorif11_73_, ruser0_.honorificSuffix_norm as honorif12_73_, ruser0_.honorificSuffix_orig as honorif13_73_, ruser0_.name_norm as name_no14_73_, ruser0_.name_orig as name_or15_73_, ruser0_.nickName_norm as nickNam16_73_, ruser0_.nickName_orig as nickNam17_73_, ruser0_.title_norm as title_n18_73_, ruser0_.title_orig as title_o19_73_ from m_user ruser0_ inner join m_focus ruser0_1_ on ruser0_.oid=ruser0_1_.oid inner join m_object ruser0_2_ on ruser0_.oid=ruser0_2_.oid where ruser0_.oid=?
[1] select booleans0_.owner_oid as owner_oi2_28_0_, booleans0_.item_id as item_id1_28_0_, booleans0_.ownerType as ownerTyp3_28_0_, booleans0_.booleanValue as booleanV4_28_0_, booleans0_.item_id as item_id1_28_1_, booleans0_.owner_oid as owner_oi2_28_1_, booleans0_.ownerType as ownerTyp3_28_1_, booleans0_.booleanValue as booleanV4_28_1_ from m_object_ext_boolean booleans0_ where booleans0_.owner_oid=?
[1] select dates0_.owner_oid as owner_oi2_29_0_, dates0_.item_id as item_id1_29_0_, dates0_.ownerType as ownerTyp3_29_0_, dates0_.dateValue as dateValu4_29_0_, dates0_.item_id as item_id1_29_1_, dates0_.owner_oid as owner_oi2_29_1_, dates0_.ownerType as ownerTyp3_29_1_, dates0_.dateValue as dateValu4_29_1_ from m_object_ext_date dates0_ where dates0_.owner_oid=?
[1] select longs0_.owner_oid as owner_oi2_30_0_, longs0_.item_id as item_id1_30_0_, longs0_.ownerType as ownerTyp3_30_0_, longs0_.longValue as longValu4_30_0_, longs0_.item_id as item_id1_30_1_, longs0_.owner_oid as owner_oi2_30_1_, longs0_.ownerType as ownerTyp3_30_1_, longs0_.longValue as longValu4_30_1_ from m_object_ext_long longs0_ where longs0_.owner_oid=?
[1] select polys0_.owner_oid as owner_oi2_31_0_, polys0_.item_id as item_id1_31_0_, polys0_.ownerType as ownerTyp3_31_0_, polys0_.orig as orig4_31_0_, polys0_.item_id as item_id1_31_1_, polys0_.owner_oid as owner_oi2_31_1_, polys0_.ownerType as ownerTyp3_31_1_, polys0_.orig as orig4_31_1_, polys0_.norm as norm5_31_1_ from m_object_ext_poly polys0_ where polys0_.owner_oid=?
[1] select references0_.owner_oid as owner_oi2_32_0_, references0_.item_id as item_id1_32_0_, references0_.ownerType as ownerTyp3_32_0_, references0_.targetoid as targetoi4_32_0_, references0_.item_id as item_id1_32_1_, references0_.owner_oid as owner_oi2_32_1_, references0_.ownerType as ownerTyp3_32_1_, references0_.targetoid as targetoi4_32_1_, references0_.relation as relation5_32_1_, references0_.targetType as targetTy6_32_1_ from m_object_ext_reference references0_ where references0_.owner_oid=?
[1] select strings0_.owner_oid as owner_oi2_33_0_, strings0_.item_id as item_id1_33_0_, strings0_.ownerType as ownerTyp3_33_0_, strings0_.stringValue as stringVa4_33_0_, strings0_.item_id as item_id1_33_1_, strings0_.owner_oid as owner_oi2_33_1_, strings0_.ownerType as ownerTyp3_33_1_, strings0_.stringValue as stringVa4_33_1_ from m_object_ext_string strings0_ where strings0_.owner_oid=?
[1] update m_object set createChannel=?, createTimestamp=?, creatorRef_relation=?, creatorRef_targetOid=?, creatorRef_type=?, fullObject=?, lifecycleState=?, modifierRef_relation=?, modifierRef_targetOid=?, modifierRef_type=?, modifyChannel=?, modifyTimestamp=?, name_norm=?, name_orig=?, objectTypeClass=?, tenantRef_relation=?, tenantRef_targetOid=?, tenantRef_type=?, version=? where oid=?
[3] delete from m_object_ext_string where item_id=? and owner_oid=? and ownerType=? and stringValue=?
*/
assertCounts(10, 12);
}
Aggregations