/** * INTERNAL: * Clone the query, including its selection criteria. * <p> * Normally selection criteria are not cloned here as they are cloned * later on during prepare. */ public Object deepClone() { return clone(); }
/** * INTERNAL: * Clone the query, including its selection criteria. * <p> * Normally selection criteria are not cloned here as they are cloned * later on during prepare. */ public Object deepClone() { return clone(); }
/** * INTERNAL: * Clone the query. */ public Object clone() { ResultSetMappingQuery cloneQuery = (ResultSetMappingQuery)super.clone(); cloneQuery.resultSetMapping = this.resultSetMapping; cloneQuery.resultSetMappingName = this.resultSetMappingName; return cloneQuery; }
/** * INTERNAL: * Clone the query, including its selection criteria. * <p> * Normally selection criteria are not cloned here as they are cloned * later on during prepare. */ public Object deepClone() { return clone(); }
/** * INTERNAL: * Creates and returns a copy of this query. * @return A clone of this instance. */ @Override public Object clone() { final ObjectLevelReadQuery cloneQuery = (ObjectLevelReadQuery)super.clone(); // Must also clone the joined expressions as always joined attribute will be added // don't use setters as this will trigger unprepare. if (joinedAttributeManager != null) { cloneQuery.joinedAttributeManager = joinedAttributeManager.clone(); cloneQuery.joinedAttributeManager.setBaseQuery(cloneQuery); } if (this.batchFetchPolicy != null) { cloneQuery.batchFetchPolicy = batchFetchPolicy.clone(); } if (this.nonFetchJoinAttributeExpressions != null){ cloneQuery.nonFetchJoinAttributeExpressions = new ArrayList<>(nonFetchJoinAttributeExpressions); } // Don't use setters as that will trigger unprepare if (this.orderByExpressions != null) { cloneQuery.orderByExpressions = new ArrayList<>(this.orderByExpressions); } if (this.fetchGroup != null) { cloneQuery.fetchGroup = fetchGroup.clone(); // don't clone immutable entityFetchGroup } return cloneQuery; }
/** * INTERNAL: * Clone the query */ @Override public Object clone() { ObjectLevelReadQuery cloneQuery = (ObjectLevelReadQuery)super.clone(); // Must also clone the joined expressions as always joined attribute will be added // don't use setters as this will trigger unprepare. if (this.joinedAttributeManager != null) { cloneQuery.joinedAttributeManager = this.joinedAttributeManager.clone(); cloneQuery.joinedAttributeManager.setBaseQuery(cloneQuery); } if (this.batchFetchPolicy != null) { cloneQuery.batchFetchPolicy = this.batchFetchPolicy.clone(); } if (this.nonFetchJoinAttributeExpressions != null){ cloneQuery.nonFetchJoinAttributeExpressions = new ArrayList<Expression>(this.nonFetchJoinAttributeExpressions); } // Don't use setters as that will trigger unprepare if (this.orderByExpressions != null) { cloneQuery.orderByExpressions = new ArrayList<Expression>(this.orderByExpressions); } if (this.fetchGroup != null) { cloneQuery.fetchGroup = this.fetchGroup.clone(); // don't clone immutable entityFetchGroup } return cloneQuery; }
/** * INTERNAL: * Clone the query */ public Object clone() { ObjectLevelReadQuery cloneQuery = (ObjectLevelReadQuery)super.clone(); // Must also clone the joined expressions as always joined attribute will be added // don't use setters as this will trigger unprepare. if (cloneQuery.hasJoining()) { cloneQuery.joinedAttributeManager = (JoinedAttributeManager)cloneQuery.getJoinedAttributeManager().clone(); cloneQuery.joinedAttributeManager.setBaseQuery(cloneQuery); } if (hasNonFetchJoinedAttributeExpressions()){ cloneQuery.setNonFetchJoinAttributeExpressions(new ArrayList<Expression>(this.nonFetchJoinAttributeExpressions)); } // Don't use setters as that will trigger unprepare if (hasOrderByExpressions()) { cloneQuery.orderByExpressions = new ArrayList<Expression>(getOrderByExpressions()); } return cloneQuery; }
nestedQuery = (ObjectLevelReadQuery)sourceQuery.clone();