6827.diff
src/com/goldencode/p2j/persist/BufferImpl.java 2022-12-15 13:58:08 +0000 | ||
---|---|---|
225 | 225 |
** created. |
226 | 226 |
** CA 20221010 Reduced 'toLowerCase' usage in 'attachDataSource'. Refs #6820 |
227 | 227 |
** TJD 20220504 Upgrade do Java 11 minor changes |
228 |
** SVL 20221215 Replaced lastQuery handle with the query instance to reduce memory footprint. |
|
228 | 229 |
*/ |
229 | 230 | |
230 | 231 |
/* |
... | ... | |
395 | 396 |
private boolean deleting; |
396 | 397 |
|
397 | 398 |
/** The last query this buffer was added/set to. */ |
398 |
private handle lastQuery = null;
|
|
399 |
private WrappedResource lastQuery = null;
|
|
399 | 400 |
|
400 | 401 |
/** The current dataset. May be {@code null}. */ |
401 | 402 |
private DataSet dataSet = null; |
... | ... | |
6042 | 6043 |
public handle getQueryAsHandle() |
6043 | 6044 |
{ |
6044 | 6045 |
// bit of maintenance |
6045 |
if (lastQuery != null && !lastQuery._isValid())
|
|
6046 |
if (lastQuery != null && !lastQuery.valid())
|
|
6046 | 6047 |
{ |
6047 | 6048 |
lastQuery = null; |
6048 | 6049 |
} |
6049 |
|
|
6050 |
return lastQuery == null ? new handle() : new handle(lastQuery.getResource());
|
|
6050 | ||
6051 |
return lastQuery == null ? new handle() : new handle(lastQuery); |
|
6051 | 6052 |
} |
6052 | 6053 |
|
6053 | 6054 |
/** |
... | ... | |
8857 | 8858 |
* @param qry |
8858 | 8859 |
* The query to associate. |
8859 | 8860 |
*/ |
8860 |
protected void setQuery(handle qry)
|
|
8861 |
protected void setQuery(QueryWrapper qry)
|
|
8861 | 8862 |
{ |
8862 |
if (qry == null || qry.isUnknown() || !qry._isValid()) |
|
8863 |
{ |
|
8864 |
this.lastQuery = null; |
|
8865 |
return; |
|
8866 |
} |
|
8867 |
|
|
8868 |
this.lastQuery = new handle(qry.getResource()); |
|
8863 |
this.lastQuery = qry; |
|
8869 | 8864 |
} |
8870 | 8865 |
|
8871 | 8866 |
/** |
src/com/goldencode/p2j/persist/QueryWrapper.java 2022-12-15 14:01:43 +0000 | ||
---|---|---|
261 | 261 |
** InvokeConfig, to allow caching of the resolved target. |
262 | 262 |
** CA 20221006 UNIQUE-ID and ADM-DATA are kept as Java types instead of BDT. Refs #6827 |
263 | 263 |
** TJD 20220504 Upgrade do Java 11 minor changes - added deprecated annotation |
264 |
** SVL 20221215 Reflected API change. |
|
264 | 265 |
*/ |
265 | 266 | |
266 | 267 |
/* |
... | ... | |
4041 | 4042 |
|
4042 | 4043 |
// if the buffer already exists, is added anyway |
4043 | 4044 |
this.buffers.add(((BufferImpl) buf).ref()); |
4044 |
((BufferImpl) buf).setQuery(new handle(this));
|
|
4045 |
((BufferImpl) buf).setQuery(this);
|
|
4045 | 4046 |
|
4046 | 4047 |
RecordBuffer recordBuffer = ((BufferImpl) buf).buffer(); |
4047 | 4048 |
recordBuffer.registerRelatedQuery(this); |