public class StatementKey extends Object
The key describes the statement within its usage scope, i.e. the StatementId and using class. The using class is necessary to locate the prepared statement because a select method may be implemented in a superclass of the actual class using the statement, which may result in a different SQL string.
As an alternative, a statement key may be expressed directly by an SQL string. In this case, no using class is required. Notice that ths SQL string must be exactly the string sent to the database backend! If there are different backends with different SQLs, each SQL must get its own statement key.
| Constructor and Description |
|---|
StatementKey(StatementId statementId,
Class<?> usingClass)
Creates the statement key.
|
StatementKey(String sql)
Creates a statement key.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getSql()
Gets the SQL string.
|
StatementId |
getStatementId()
Gets the statement id.
|
Class<?> |
getUsingClass()
Gets the using class.
|
int |
hashCode() |
public StatementKey(StatementId statementId, Class<?> usingClass)
statementId - the global statement idusingClass - the using classpublic StatementKey(String sql)
sql - the SQL stringpublic StatementId getStatementId()
public Class<?> getUsingClass()
public String getSql()
Copyright © 2016 Krake Softwaretechnik. All rights reserved.