mirror of
https://github.com/apache/openjpa.git
synced 2025-02-21 01:15:30 +00:00
OPENJPA-801: PCPath is now a CandidatePath. But why was it not before?
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@724856 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
569641f095
commit
62e1deae8f
@ -37,6 +37,7 @@ import org.apache.openjpa.jdbc.sql.Result;
|
||||
import org.apache.openjpa.jdbc.sql.SQLBuffer;
|
||||
import org.apache.openjpa.jdbc.sql.Select;
|
||||
import org.apache.openjpa.kernel.Filters;
|
||||
import org.apache.openjpa.kernel.exps.CandidatePath;
|
||||
import org.apache.openjpa.lib.util.Localizer;
|
||||
import org.apache.openjpa.meta.ClassMetaData;
|
||||
import org.apache.openjpa.meta.FieldMetaData;
|
||||
@ -50,8 +51,11 @@ import org.apache.openjpa.util.UserException;
|
||||
* @author Abe White
|
||||
*/
|
||||
public class PCPath
|
||||
extends AbstractVal
|
||||
extends CandidatePath
|
||||
implements JDBCPath {
|
||||
|
||||
protected static final String TRUE = "1 = 1";
|
||||
protected static final String FALSE = "1 <> 1";
|
||||
|
||||
private static final int PATH = 0;
|
||||
private static final int BOUND_VAR = 1;
|
||||
@ -63,7 +67,6 @@ public class PCPath
|
||||
|
||||
private final ClassMapping _candidate;
|
||||
private ClassMapping _class = null;
|
||||
private LinkedList _actions = null;
|
||||
private boolean _key = false;
|
||||
private int _type = PATH;
|
||||
private String _varName = null;
|
||||
@ -794,6 +797,11 @@ public class PCPath
|
||||
return ObjectUtils.equals(_candidate, path._candidate)
|
||||
&& ObjectUtils.equals(_actions, path._actions);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return Val.VAL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper class representing an action.
|
||||
|
@ -37,11 +37,11 @@ import org.apache.openjpa.util.ImplHelper;
|
||||
*
|
||||
* @author Abe White
|
||||
*/
|
||||
class CandidatePath
|
||||
public class CandidatePath
|
||||
extends Val
|
||||
implements Path {
|
||||
|
||||
private LinkedList _actions = null;
|
||||
protected LinkedList _actions = null;
|
||||
|
||||
/**
|
||||
* Traverse into the given field of the current object, and update
|
||||
|
@ -139,4 +139,12 @@ public class TestQuery extends SliceTestCase {
|
||||
}
|
||||
em.getTransaction().rollback();
|
||||
}
|
||||
|
||||
public void testInMemoryOrderBy() {
|
||||
EntityManager em = emf.createEntityManager();
|
||||
em.getTransaction().begin();
|
||||
Query query = em.createQuery("SELECT p FROM PObject p ORDER BY p.value");
|
||||
List result = query.getResultList();
|
||||
em.getTransaction().rollback();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user