code: @SuppressWarnings("unchecked")
  	public <T> DomainObjectMatch<T> createMatchFrom(DomainObjectMatch<T> domainObjectMatch) {
  		DomainObjectMatch<T> ret;
  		FromPreviousQueryExpression pqe;
  		DomainObjectMatch<?> match;
  		DomainObjectMatch<?> delegate = APIAccess.getDelegate(domainObjectMatch);
  		if (delegate != null) { // generic model
  			DomainObjectMatch<?> newDelegate = APIAccess.createDomainObjectMatch(delegate,
  					this.queryExecutor.getDomainObjectMatches().size(),
  					this.queryExecutor.getMappingInfo());
  			this.queryExecutor.getDomainObjectMatches().add(newDelegate);
  			pqe = new FromPreviousQueryExpression(
  					newDelegate, delegate);
  			ret = (DomainObjectMatch<T>) APIAccess.createDomainObjectMatch(DomainObject.class, newDelegate);
  			match = newDelegate;
  		} else {
  			ret = APIAccess.createDomainObjectMatch(domainObjectMatch,
  					this.queryExecutor.getDomainObjectMatches().size(),
  					this.queryExecutor.getMappingInfo());
  			this.queryExecutor.getDomainObjectMatches().add(ret);
  			pqe = new FromPreviousQueryExpression(
  					ret, domainObjectMatch);
  			match = ret;
  		}
  		this.queryExecutor.addAstObject(pqe);
  		QueryRecorder.recordAssignment(this, "createMatchFrom", match,
  				QueryRecorder.reference(domainObjectMatch));
  		return ret;
  	}
docs: Create a match from a DomainObjectMatch specified in the context of another query
  @param domainObjectMatch a match specified in the context of another query
  @return a DomainObjectMatch