我有RealmClass ProspectGson
as,
public class ProspectGson extends RealmObject
{
public ProspectMaster prospectMaster;
public RealmList<ContactDetail> contactDetails=new RealmList<>();
public RealmList<DiscussionDetail> discussionDetail=new RealmList<>();
@PrimaryKey
public long id;
}
班级ProspectMaster
as,
public class ProspectMaster extends RealmObject
{
private long ProspectId;
private String ProspectCode;
private String ProspectName;
private String TrustName;
}
班级DiscussionDetail
as,
public class DiscussionDetail extends RealmObject
{
private long RecId;
private long ProspectId;
private String DiscussionDetails;
private String CallPriority;
}
我的领域查询是,
RealmResults results= realm.where(ProspectGson.class)
.contains("prospectMaster.ProspectName", "abv", Case.INSENSITIVE)
.contains("prospectMaster.TrustName", "xyz", Case.INSENSITIVE)
.contains("discussionDetail.CallPriority", "High", Case.INSENSITIVE)
.findAll();
我有很多ProspectGson
的记录,其中一些包含多个DiscussionDetail
,有些记录没有DiscussionDetail
我想要提取包含ProspectGson
DisucssionDetail
为CallPriority
的所有high
条记录,并记录哪些记录没有DiscussionDetail
目前我正在收到ProspectGson
CallPriority
high.
String tmp = "begin ? := pkgioexportora.request(?); end;";
String xml = "<ttc.export.public.data.search><query><popid>1</popid> <moduleid>3</moduleid><only_changes>0</only_changes></query></ttc.export.public.data.search>";
CallableStatement callableStmt = oracle.prepareCall(tmp);
// Register the type of the out param - an Oracle specific type
callableStmt.registerOutParameter(1, OracleTypes.NUMBER);
callableStmt.setString(2, xml);
条记录
请帮帮我
答案 0 :(得分:2)
RealmResults<ProspectGson> results= realm.where(ProspectGson.class)
.isNotEmpty("discussionDetail")
.contains("discussionDetail.CallPriority", "High", Case.INSENSITIVE)
.findAll();
请尝试