// We keep track of the old stuff because during the creation of a JPQLQueryStateObject,
// it is possible the state model uses this builder to create some objects
BasicStateObjectBuilder builder = getStateObjectBuilder();
IJPQLQueryBuilder oldBuilder = builder.jpqlQueryBuilder;
IManagedTypeProvider oldProvider = builder.managedTypeProvider;
JPQLQueryStateObject oldParent = builder.parent;
StateObject oldStateObject = builder.stateObject;
try {
builder.jpqlQueryBuilder = this;
builder.managedTypeProvider = parent.getManagedTypeProvider();