Tanks a lot for your help.
I try it in this way:
EBoolean priorPredicate = QLocation.location.id.eq(
QLocation.location.parent.id);
OracleQuery oQuery = new OracleQuery(connection, new OracleTemplates()).connectByPrior(priorPredicate);
This is a part of Location entity class:
@Entity
@Table(name="LOCATION")
public class Location implements Serializable {
@Id
private long id;
private String name;
//bi-directional many-to-one association to Location
@ManyToOne
@JoinColumn(name="PARENT_ID")
private Location parent;
//bi-directional many-to-one association to Location
@OneToMany(mappedBy="parent")
private List<Location> children;
and this is a part of QLocation class :
public class QLocation extends PEntity<Location> {
public static final QLocation location = new QLocation("location");
public final PSet<Location> children = createSet("children", Location.class);
public final PNumber<Long> id = createNumber("id", Long.class);
public final PString name = createString("name");
public final QLocation parent;
...
But there is some problem yet, with my priorPredicate.
when I run the code , this exception throws :
com.mysema.query.QueryException: java.sql.SQLSyntaxErrorException: ORA-00904: "LOCATION"."PARENT"."ID": invalid identifier
So what's the correct format for the predicate?