mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
CE-1406 Add Cloneable
This commit is contained in:
@ -56,7 +56,7 @@ import com.kingsrook.qqq.backend.core.utils.StringUtils;
|
|||||||
** JoinsContext is constructed before executing a query, and not meant to be set
|
** JoinsContext is constructed before executing a query, and not meant to be set
|
||||||
** by users.
|
** by users.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public class QueryJoin
|
public class QueryJoin implements Cloneable
|
||||||
{
|
{
|
||||||
private String baseTableOrAlias;
|
private String baseTableOrAlias;
|
||||||
private String joinTable;
|
private String joinTable;
|
||||||
@ -69,6 +69,40 @@ public class QueryJoin
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
@Override
|
||||||
|
public QueryJoin clone()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
QueryJoin clone = (QueryJoin) super.clone();
|
||||||
|
|
||||||
|
if(joinMetaData != null)
|
||||||
|
{
|
||||||
|
clone.joinMetaData = joinMetaData.clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(securityCriteria != null)
|
||||||
|
{
|
||||||
|
clone.securityCriteria = new ArrayList<>();
|
||||||
|
for(QFilterCriteria securityCriterion : securityCriteria)
|
||||||
|
{
|
||||||
|
clone.securityCriteria.add(securityCriterion.clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
|
catch(CloneNotSupportedException e)
|
||||||
|
{
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
** define the types of joins - INNER, LEFT, RIGHT, or FULL.
|
** define the types of joins - INNER, LEFT, RIGHT, or FULL.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
@ -33,7 +33,7 @@ import com.kingsrook.qqq.backend.core.utils.StringUtils;
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
** Definition of how 2 tables join together within a QQQ Instance.
|
** Definition of how 2 tables join together within a QQQ Instance.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public class QJoinMetaData implements TopLevelMetaDataInterface
|
public class QJoinMetaData implements TopLevelMetaDataInterface, Cloneable
|
||||||
{
|
{
|
||||||
private String name;
|
private String name;
|
||||||
private JoinType type;
|
private JoinType type;
|
||||||
@ -62,6 +62,44 @@ public class QJoinMetaData implements TopLevelMetaDataInterface
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
@Override
|
||||||
|
public QJoinMetaData clone()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
QJoinMetaData clone = (QJoinMetaData) super.clone();
|
||||||
|
|
||||||
|
if(joinOns != null)
|
||||||
|
{
|
||||||
|
clone.joinOns = new ArrayList<>();
|
||||||
|
for(JoinOn joinOn : joinOns)
|
||||||
|
{
|
||||||
|
clone.joinOns.add(joinOn.clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(orderBys != null)
|
||||||
|
{
|
||||||
|
clone.orderBys = new ArrayList<>();
|
||||||
|
for(QFilterOrderBy orderBy : orderBys)
|
||||||
|
{
|
||||||
|
clone.orderBys.add(orderBy.clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
|
catch(CloneNotSupportedException e)
|
||||||
|
{
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
** Getter for name
|
** Getter for name
|
||||||
**
|
**
|
||||||
|
Reference in New Issue
Block a user