#11 Search for identity with "%" does not work

open
5
2014-05-02
2004-10-08
AndrejB
No

If "%" is given as search criteria for identity (search for
objects with any identity), no object is found. The
reason ist that in StateWithHoles_1.findStates() the
wildcard is cut off and it will be attempted to create a
Path with "/" as the last character:

// code like in AbstractDatabase
if ("identity".equals(filter.name())) {
// must map identity filter to filter for object_stateId
List filterValues = new ArrayList();
for(
int j = 0;
j < filter.getValues().length;
j++
) {
String filterString = (String)filter.getValue(j);
// remove possible wildcard (... like 'a%')
boolean wildcardSuffix = filterString.endsWith("%");
try {
// create path for correct treatment of wildcards
etc
Path filterPath = new Path(
wildcardSuffix ? filterString.substring(0,
filterString.length()-1) : filterString
);

This causes the following exeption:

BasicException.Entry[0]
Timestamp=2004-10-08 10:15:40.074
Class=org.openmdx.compatibility.base.naming.Path
Method=<init>
Line=147
ExceptionDomain=DefaultDomain
ExceptionCode=BAD_PARAMETER
Param[0]:
exception.class=org.openmdx.base.exception.RuntimeSer
viceException
Param[1]: exception.source=n/a
Description=Path ends with '/'
Backtrace:
at org.openmdx.compatibility.base.naming.Path.<init>
(Path.java:147)
at org.openmdx.compatibility.base.naming.Path.<init>
(Path.java:118)
at
org.openmdx.compatibility.base.dataprovider.layer.model.
StateWithHoles_1.findStates
(StateWithHoles_1.java:2482)
at
org.openmdx.compatibility.base.dataprovider.layer.model.
StateWithHoles_1.find(StateWithHoles_1.java:4751)

In the resulting SQL-statement ";underflow;State_1" is
put as search criteria for vm.object__state_id and
consequently the search finds no object matching this
criteria.

Discussion


Anonymous


Cancel   Add attachments