QuerySpec for DB query
Mar 01, 2020
05:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Mar 01, 2020
05:43 PM
QuerySpec for DB query
Need help converting the blow sql into QuerySpec
SELECT *
FROM DISCRETEACTIONITEM DAI
JOIN ITERATEDACTIONITEMSUBJECTLINK ISL ON DAI.IDA2A2 = ISL.IDA3A5
JOIN CONTROLBRANCH CB ON ISL.BRANCHIDA3B5 = CB.IDA2A2
JOIN WTPARTMASTER PM ON CB.IDA3B5 = PM.IDA2A2;
Solved! Go to Solution.
Labels:
- Labels:
-
General Customization
- Tags:
- queryspec
ACCEPTED SOLUTION
Accepted Solutions
Mar 01, 2020
07:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Mar 01, 2020
07:49 PM
No longer have this issue, managed to smash the keyboard enought times to produce the following:
QuerySpec qs = new QuerySpec();
int i = qs.appendClassList(DiscreteActionItem.class, true);
int j = qs.appendClassList(IteratedActionItemSubjectLink.class,
false);
int k = qs.appendClassList(ControlBranch.class, false);
int l = qs.appendClassList(WTPartMaster.class, true);
qs.appendWhere(new SearchCondition(DiscreteActionItem.class,
"thePersistInfo.theObjectIdentifier.id",
IteratedActionItemSubjectLink.class,
"roleAObjectRef.key.id"), new int[] { i, j });
qs.appendAnd();
qs.appendWhere(
new SearchCondition(IteratedActionItemSubjectLink.class,
"roleBObjectRef.key.branchId", ControlBranch.class,
"thePersistInfo.theObjectIdentifier.id"),
new int[] { j, k });
qs.appendAnd();
qs.appendWhere(
new SearchCondition(ControlBranch.class,
"masterReference.key.id", WTPartMaster.class,
"thePersistInfo.theObjectIdentifier.id"),
new int[] { k, l });
However, if anyone has a nicer solution, feel free to respond.
1 REPLY 1
Mar 01, 2020
07:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Mar 01, 2020
07:49 PM
No longer have this issue, managed to smash the keyboard enought times to produce the following:
QuerySpec qs = new QuerySpec();
int i = qs.appendClassList(DiscreteActionItem.class, true);
int j = qs.appendClassList(IteratedActionItemSubjectLink.class,
false);
int k = qs.appendClassList(ControlBranch.class, false);
int l = qs.appendClassList(WTPartMaster.class, true);
qs.appendWhere(new SearchCondition(DiscreteActionItem.class,
"thePersistInfo.theObjectIdentifier.id",
IteratedActionItemSubjectLink.class,
"roleAObjectRef.key.id"), new int[] { i, j });
qs.appendAnd();
qs.appendWhere(
new SearchCondition(IteratedActionItemSubjectLink.class,
"roleBObjectRef.key.branchId", ControlBranch.class,
"thePersistInfo.theObjectIdentifier.id"),
new int[] { j, k });
qs.appendAnd();
qs.appendWhere(
new SearchCondition(ControlBranch.class,
"masterReference.key.id", WTPartMaster.class,
"thePersistInfo.theObjectIdentifier.id"),
new int[] { k, l });
However, if anyone has a nicer solution, feel free to respond.
