Query XPWeakReferenceStruct with CriteriaOperator

StatusIDPriorityType
Closed38117MajorQuestion
ProfileReply
gabossoloClient

How to query XPWeakReferenceStruct with CriteriaOperator.

Thank you!

Replies

UserDescriptionPosted On
MariyaVoytovichAgent

Hello gabossolo!

Can provide us more information?
What difficulties did you encounter?

Regards,
Mariya
On behalf of Xafari Client Services Team

gabossoloClient

The issue to get the ItemsOwner (XPWeakReferenceStruct) object from BillingItems table.

CriteriaOperator.Parse("[][^.ItemsOwner ]")) ??????

-----> DCs
# BillingBase
[Aggregated, NonPersistentDc]
[BackReferenceProperty("ItemsOwner")]
IList BillingItems

# Invoice : BillingBase

# Quote : BillingBase

# BillingItem
[Browsable(false), PersistentDc]
XPWeakReferenceStruct ItemsOwner

[NonPersistentDc]
BillingBase Owner { get; set; }

MariyaVoytovichAgent

Hello gabossolo!

Thanks for the provided information.

In this case, comparisons cannot be made through the structure in the criteria.
It is necessary to formulate a criterion using the structure parameters.

For example:
CriteriaOperator.Parse(string.Format("[<PersistentMaster1>][Contains([^.Master1.TargetKey],ToStr(Oid)) AND [^.Master1.TargetType] = {0}]", this.ObjectSpace.Xafari().Session.GetObjectType(typeof(PersistentMaster1).Xafari().ClassInfo).SafeGetId()));
var objects2 = this.ObjectSpace.GetObjects<Details2>(criteria);

This criterion was compiled using the objects described in the demo Xafari.FeatureCenter as an example (PersistentMaster1, Details2).

Feel free to contact us if you need further assistance or have additional questions.

Regards,
Mariya
On behalf of Xafari Client Services Team

gabossoloClient

Thank you!

× This ticket is closed.

Write US