com.avaje.ebeaninternal.api.SpiQuery Maven / Gradle / Ivy
/**
* Copyright (C) 2009 Robin Bygrave
*
* This file is part of Ebean.
*
* Ebean is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* Ebean is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Ebean; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package com.avaje.ebeaninternal.api;
import java.util.ArrayList;
import java.util.List;
import com.avaje.ebean.ExpressionList;
import com.avaje.ebean.OrderBy;
import com.avaje.ebean.Query;
import com.avaje.ebean.QueryListener;
import com.avaje.ebean.bean.BeanCollectionTouched;
import com.avaje.ebean.bean.CallStack;
import com.avaje.ebean.bean.EntityBean;
import com.avaje.ebean.bean.ObjectGraphNode;
import com.avaje.ebean.bean.PersistenceContext;
import com.avaje.ebean.event.BeanQueryRequest;
import com.avaje.ebeaninternal.server.autofetch.AutoFetchManager;
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
import com.avaje.ebeaninternal.server.deploy.TableJoin;
import com.avaje.ebeaninternal.server.query.CancelableQuery;
import com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail;
import com.avaje.ebeaninternal.server.querydefn.OrmQueryProperties;
/**
* Object Relational query - Internal extension to Query object.
*/
public interface SpiQuery extends Query {
public enum Mode {
NORMAL(false), LAZYLOAD_MANY(false), LAZYLOAD_BEAN(true), REFRESH_BEAN(true);
Mode(boolean loadContextBean) {
this.loadContextBean = loadContextBean;
}
private final boolean loadContextBean;
public boolean isLoadContextBean() {
return loadContextBean;
}
}
/**
* Return true if select all properties was used to ensure the property
* invoking a lazy load was included in the query.
*/
public boolean selectAllForLazyLoadProperty();
/**
* Set the query mode.
*/
public void setMode(Mode m);
/**
* Return the query mode.
*/
public Mode getMode();
/**
* Check other combinations that can make this a sharedInstance query.
*/
public void deriveSharedInstance();
/**
* This is a lazy loading query for a shared instance. That means all the
* beans returned by this query will also be marked as 'sharedInstance'.
*/
public void setSharedInstance();
/**
* Return true if this is a lazy loading query for a shared instance.
*/
public boolean isSharedInstance();
/**
* Propagate the sharedInstance or readOnly state from a parent.
*/
public void setParentState(int parentState);
/**
* Return a listener that wants to be notified when the bean collection is
* first used.
*/
public BeanCollectionTouched getBeanCollectionTouched();
/**
* Set a listener to be notified when the bean collection has been touched
* (when the list/set/map is first used).
*/
public void setBeanCollectionTouched(BeanCollectionTouched notify);
/**
* Set the list of Id's that is being populated.
*
* This is a mutating list of id's and we are setting this so that other
* threads have access to the id's before the id query has finished.
*
*/
public void setIdList(List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy