public class AOContext extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AOContext.DB |
Modifier and Type | Field and Description |
---|---|
private com.atlassian.activeobjects.external.ActiveObjects |
ao |
private AOContext.DB |
db |
private String |
identifierQuoteClose |
private String |
identifierQuoteOpen |
private static org.apache.log4j.Logger |
log |
Constructor and Description |
---|
AOContext(String identifierQuoteOpen,
String identifierQuoteClose,
AOContext.DB db,
com.atlassian.activeobjects.external.ActiveObjects ao) |
Modifier and Type | Method and Description |
---|---|
String |
column(String column) |
String |
column(String tableAlias,
String column)
Appends a column name, prefixed with the table name.
|
String |
column2(String table,
String column)
Does the same thing that
column(String, String) but also escapes the table alias |
String |
columnForOrderByClause(String column) |
static AOContext |
create(com.atlassian.activeobjects.external.ActiveObjects ao) |
static AOContext |
create(com.atlassian.activeobjects.external.ActiveObjects ao,
com.atlassian.hibernate.PluginHibernateSessionFactory hack) |
com.atlassian.activeobjects.external.ActiveObjects |
getAO() |
AOContext.DB |
getDb() |
String |
getIdentifierQuoteClose() |
String |
getIdentifierQuoteOpen() |
private static DatabaseMetaData |
getMetadata(com.atlassian.hibernate.PluginHibernateSessionFactory pluginHibernateSessionFactory) |
String |
nativeName(String nativeName)
Add quotes around the name of a NATIVE core table of Confluence.
|
static AOContext |
neutral()
When we're just parsing a query to check it's correct
|
String |
table(String table) |
String |
unlimitedColumn(boolean escapeTableAlias,
String tableAlias,
String column)
Escaping for columns which needs to be casted as varchars
|
private static final org.apache.log4j.Logger log
private final String identifierQuoteOpen
private final String identifierQuoteClose
private final AOContext.DB db
private final com.atlassian.activeobjects.external.ActiveObjects ao
public AOContext(String identifierQuoteOpen, String identifierQuoteClose, AOContext.DB db, com.atlassian.activeobjects.external.ActiveObjects ao)
public static AOContext neutral()
public static AOContext create(com.atlassian.activeobjects.external.ActiveObjects ao)
public static AOContext create(com.atlassian.activeobjects.external.ActiveObjects ao, com.atlassian.hibernate.PluginHibernateSessionFactory hack)
public String column(String tableAlias, String column)
tableAlias
- the name of the table, or rather its alias in the query. It won't be escaped.public String column2(String table, String column)
column(String, String)
but also escapes the table aliaspublic String unlimitedColumn(boolean escapeTableAlias, String tableAlias, String column)
tableAlias
- the name of the table, or rather its alias, and beware that it won't be escaped.public String nativeName(String nativeName)
nativeName
- the name of a CORE table/column of Confluencepublic AOContext.DB getDb()
private static DatabaseMetaData getMetadata(com.atlassian.hibernate.PluginHibernateSessionFactory pluginHibernateSessionFactory) throws net.sf.hibernate.HibernateException, SQLException
net.sf.hibernate.HibernateException
SQLException
public String getIdentifierQuoteOpen()
public String getIdentifierQuoteClose()
public com.atlassian.activeobjects.external.ActiveObjects getAO()
Copyright © 2021 Play SQL. All rights reserved.