Top Description Fields Constructors Methods
org.hibernate.sql

public Class ANSIJoinFragment

extends JoinFragment
Class Inheritance
Known Direct Subclasses
org.hibernate.sql.CacheJoinFragment
Imports
org.hibernate.AssertionFailure

An ANSI-style join.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private StringBuilder
private StringBuilder
Inherited from org.hibernate.sql.JoinFragment:
FULL_JOININNER_JOINLEFT_OUTER_JOINRIGHT_OUTER_JOIN

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addCondition(String
The alias to apply to column(s)
alias
,
String[]
The columns to apply restriction
columns
,
String
The restriction condition
condition
)

Adds a condition to the join fragment.

public void
addCondition(String
The alias of the joined table
alias
,
String[]
The names of the columns which reference the joined table
fkColumns
,
String[]
The columns in the joined table being referenced
pkColumns
)

Implements abstract org.hibernate.sql.JoinFragment.addCondition.

Adds a condition to the join fragment.
public boolean
addCondition(String
The fragment
condition
)

Implements abstract org.hibernate.sql.JoinFragment.addCondition.

Adds a free-form condition fragment
public void
addCrossJoin(String
The name of the table to be joined
tableName
,
String
The alias to apply to the joined table
alias
)

Implements abstract org.hibernate.sql.JoinFragment.addCrossJoin.

Adds a cross join to the specified table.
public void
addFromFragmentString(String
The join fragment string
fromFragmentString
)

Adds an externally built join fragment.

public void
addJoin(String
The name of the table being joined.
tableName
,
String
The alias applied to the table being joined.
alias
,
String[]
The columns (from the table being joined) used to define the join-restriction (the ON)
fkColumns
,
String[]
The columns (from the table being joined to) used to define the join-restriction (the ON)
pkColumns
,
JoinType
The type of join to produce (INNER, etc).
joinType
)

Implements abstract org.hibernate.sql.JoinFragment.addJoin.

Adds a join, represented by the given information, to the fragment.
public void
addJoin(String
The name of the table being joined (the RHS table).
rhsTableName
,
String
The alias applied to the table being joined (the alias for the RHS table).
rhsAlias
,
String[]
The columns (from the table being joined) used to define the join-restriction (the ON). These are the LHS columns, and are expected to be qualified.
lhsColumns
,
String[]
The columns (from the table being joined to) used to define the join-restriction (the ON). These are the RHS columns and are expected to *not* be qualified.
rhsColumns
,
JoinType
The type of join to produce (INNER, etc).
joinType
,
String
Any extra join restrictions
on
)

Implements abstract org.hibernate.sql.JoinFragment.addJoin.

Adds a join, represented by the given information, to the fragment.
public void
addJoin(String
The name of the table to be joined
rhsTableName
,
String
The alias to apply to the joined table
rhsAlias
,
String[][]
The names of the columns which reference the joined table
lhsColumns
,
String[]
The columns in the joined table being referenced
rhsColumns
,
JoinType
The type of join
joinType
,
String
The additional ON fragment
on
)

Overrides org.hibernate.sql.JoinFragment.addJoin.

Adds a join, with an additional ON clause fragment
public void
addJoins(String
The FROM clause fragment
fromFragment
,
String
The WHERE clause fragment
whereFragment
)

Implements abstract org.hibernate.sql.JoinFragment.addJoins.

Free-form form of adding theta-style joins taking the necessary FROM and WHERE clause fragments
public JoinFragment
copy()

Implements abstract org.hibernate.sql.JoinFragment.copy.

Make a copy.
public String
toFromFragmentString()

Implements abstract org.hibernate.sql.JoinFragment.toFromFragmentString.

Render this fragment to its FROM clause portion
public String
toWhereFragmentString()

Implements abstract org.hibernate.sql.JoinFragment.toWhereFragmentString.

Render this fragment to its WHERE clause portion
Inherited from org.hibernate.sql.JoinFragment:
addConditionaddFragmenthasFilterConditionhasThetaJoinssetHasFilterConditionsetHasThetaJoins

Field Detail

bufferback to summary
private StringBuilder buffer
conditionsback to summary
private StringBuilder conditions

Constructor Detail

ANSIJoinFragmentback to summary
public ANSIJoinFragment()

Method Detail

addConditionback to summary
public void addCondition(String alias, String[] columns, String condition)

Adds a condition to the join fragment. For each given column a predicate is built in the form: [alias.[column] = [condition]

Parameters
alias:String

The alias to apply to column(s)

columns:String[]

The columns to apply restriction

condition:String

The restriction condition

addConditionback to summary
public void addCondition(String alias, String[] fkColumns, String[] pkColumns)

Implements abstract org.hibernate.sql.JoinFragment.addCondition.

Doc from org.hibernate.sql.JoinFragment.addCondition.

Adds a condition to the join fragment.

Parameters
alias:String

The alias of the joined table

fkColumns:String[]

The names of the columns which reference the joined table

pkColumns:String[]

The columns in the joined table being referenced

Annotations
@Override
addConditionback to summary
public boolean addCondition(String condition)

Implements abstract org.hibernate.sql.JoinFragment.addCondition.

Doc from org.hibernate.sql.JoinFragment.addCondition.

Adds a free-form condition fragment

Parameters
condition:String

The fragment

Returns:boolean

true if the condition was added

Annotations
@Override
addCrossJoinback to summary
public void addCrossJoin(String tableName, String alias)

Implements abstract org.hibernate.sql.JoinFragment.addCrossJoin.

Doc from org.hibernate.sql.JoinFragment.addCrossJoin.

Adds a cross join to the specified table.

Parameters
tableName:String

The name of the table to be joined

alias:String

The alias to apply to the joined table

Annotations
@Override
addFromFragmentStringback to summary
public void addFromFragmentString(String fromFragmentString)

Adds an externally built join fragment.

Parameters
fromFragmentString:String

The join fragment string

addJoinback to summary
public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, JoinType joinType)

Implements abstract org.hibernate.sql.JoinFragment.addJoin.

Adds a join, represented by the given information, to the fragment.

Parameters
tableName:String

The name of the table being joined.

alias:String

The alias applied to the table being joined.

fkColumns:String[]

The columns (from the table being joined) used to define the join-restriction (the ON)

pkColumns:String[]

The columns (from the table being joined to) used to define the join-restriction (the ON)

joinType:JoinType

The type of join to produce (INNER, etc).

addJoinback to summary
public void addJoin(String rhsTableName, String rhsAlias, String[] lhsColumns, String[] rhsColumns, JoinType joinType, String on)

Implements abstract org.hibernate.sql.JoinFragment.addJoin.

Adds a join, represented by the given information, to the fragment.

Parameters
rhsTableName:String

The name of the table being joined (the RHS table).

rhsAlias:String

The alias applied to the table being joined (the alias for the RHS table).

lhsColumns:String[]

The columns (from the table being joined) used to define the join-restriction (the ON). These are the LHS columns, and are expected to be qualified.

rhsColumns:String[]

The columns (from the table being joined to) used to define the join-restriction (the ON). These are the RHS columns and are expected to *not* be qualified.

joinType:JoinType

The type of join to produce (INNER, etc).

on:String

Any extra join restrictions

addJoinback to summary
public void addJoin(String rhsTableName, String rhsAlias, String[][] lhsColumns, String[] rhsColumns, JoinType joinType, String on)

Overrides org.hibernate.sql.JoinFragment.addJoin.

Doc from org.hibernate.sql.JoinFragment.addJoin.

Adds a join, with an additional ON clause fragment

Parameters
rhsTableName:String

The name of the table to be joined

rhsAlias:String

The alias to apply to the joined table

lhsColumns:String[][]

The names of the columns which reference the joined table

rhsColumns:String[]

The columns in the joined table being referenced

joinType:JoinType

The type of join

on:String

The additional ON fragment

addJoinsback to summary
public void addJoins(String fromFragment, String whereFragment)

Implements abstract org.hibernate.sql.JoinFragment.addJoins.

Doc from org.hibernate.sql.JoinFragment.addJoins.

Free-form form of adding theta-style joins taking the necessary FROM and WHERE clause fragments

Parameters
fromFragment:String

The FROM clause fragment

whereFragment:String

The WHERE clause fragment

Annotations
@Override
copyback to summary
public JoinFragment copy()

Implements abstract org.hibernate.sql.JoinFragment.copy.

Doc from org.hibernate.sql.JoinFragment.copy.

Make a copy.

Returns:JoinFragment

The copy.

Annotations
@Override
toFromFragmentStringback to summary
public String toFromFragmentString()

Implements abstract org.hibernate.sql.JoinFragment.toFromFragmentString.

Doc from org.hibernate.sql.JoinFragment.toFromFragmentString.

Render this fragment to its FROM clause portion

Returns:String

The FROM clause portion of this fragment

Annotations
@Override
toWhereFragmentStringback to summary
public String toWhereFragmentString()

Implements abstract org.hibernate.sql.JoinFragment.toWhereFragmentString.

Doc from org.hibernate.sql.JoinFragment.toWhereFragmentString.

Render this fragment to its WHERE clause portion

Returns:String

The WHERE clause portion of this fragment

Annotations
@Override