summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/data/util/sqlcontainer
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-07-23 15:23:43 +0300
committerLeif Åstrand <leif@vaadin.com>2012-07-23 15:23:43 +0300
commit3604bf01ded16d21041cbb655632429e00c94639 (patch)
tree9bf7ae9d3a33e6b672c164e696a24aef08ebc13e /src/com/vaadin/data/util/sqlcontainer
parentb7982bac6d8bca02fc76c9974ffd1c24d9a06f04 (diff)
downloadvaadin-framework-3604bf01ded16d21041cbb655632429e00c94639.tar.gz
vaadin-framework-3604bf01ded16d21041cbb655632429e00c94639.zip
Add Java 6 @Override annotations to all methods from interfaces
Diffstat (limited to 'src/com/vaadin/data/util/sqlcontainer')
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java5
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/RowItem.java4
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/SQLContainer.java33
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java3
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java3
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java12
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java16
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java4
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java2
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java2
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java2
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java2
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java2
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java2
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java2
-rw-r--r--src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java2
16 files changed, 96 insertions, 0 deletions
diff --git a/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java b/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java
index d84a164bfa..168bce1880 100644
--- a/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java
+++ b/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java
@@ -61,6 +61,7 @@ final public class ColumnProperty implements Property {
this.readOnly = readOnly;
}
+ @Override
public Object getValue() {
if (isModified()) {
return changedValue;
@@ -68,6 +69,7 @@ final public class ColumnProperty implements Property {
return value;
}
+ @Override
public void setValue(Object newValue) throws ReadOnlyException {
if (newValue == null && !nullable) {
throw new NotNullableException(
@@ -134,10 +136,12 @@ final public class ColumnProperty implements Property {
|| newValue.equals(referenceValue);
}
+ @Override
public Class<?> getType() {
return type;
}
+ @Override
public boolean isReadOnly() {
return readOnly;
}
@@ -146,6 +150,7 @@ final public class ColumnProperty implements Property {
return allowReadOnlyChange;
}
+ @Override
public void setReadOnly(boolean newStatus) {
if (allowReadOnlyChange) {
readOnly = newStatus;
diff --git a/src/com/vaadin/data/util/sqlcontainer/RowItem.java b/src/com/vaadin/data/util/sqlcontainer/RowItem.java
index adededb65c..d613a06b63 100644
--- a/src/com/vaadin/data/util/sqlcontainer/RowItem.java
+++ b/src/com/vaadin/data/util/sqlcontainer/RowItem.java
@@ -48,6 +48,7 @@ public final class RowItem implements Item {
this.id = id;
}
+ @Override
public Property<?> getItemProperty(Object id) {
if (id instanceof String && id != null) {
for (ColumnProperty cp : properties) {
@@ -59,6 +60,7 @@ public final class RowItem implements Item {
return null;
}
+ @Override
public Collection<?> getItemPropertyIds() {
Collection<String> ids = new ArrayList<String>(properties.size());
for (ColumnProperty cp : properties) {
@@ -71,6 +73,7 @@ public final class RowItem implements Item {
* Adding properties is not supported. Properties are generated by
* SQLContainer.
*/
+ @Override
public boolean addItemProperty(Object id, Property property)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -80,6 +83,7 @@ public final class RowItem implements Item {
* Removing properties is not supported. Properties are generated by
* SQLContainer.
*/
+ @Override
public boolean removeItemProperty(Object id)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
diff --git a/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
index e9b5b4fea3..250b2eb4c3 100644
--- a/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
+++ b/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
@@ -130,6 +130,7 @@ public class SQLContainer implements Container, Container.Filterable,
* {@inheritDoc}
*/
+ @Override
public Object addItem() throws UnsupportedOperationException {
Object emptyKey[] = new Object[delegate.getPrimaryKeyColumns().size()];
RowId itemId = new TemporaryRowId(emptyKey);
@@ -186,6 +187,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#containsId(java.lang.Object)
*/
+ @Override
public boolean containsId(Object itemId) {
if (itemId == null) {
return false;
@@ -227,6 +229,7 @@ public class SQLContainer implements Container, Container.Filterable,
* java.lang.Object)
*/
+ @Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
Item item = getItem(itemId);
if (item == null) {
@@ -241,6 +244,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#getContainerPropertyIds()
*/
+ @Override
public Collection<?> getContainerPropertyIds() {
return Collections.unmodifiableCollection(propertyIds);
}
@@ -251,6 +255,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#getItem(java.lang.Object)
*/
+ @Override
public Item getItem(Object itemId) {
if (!cachedItems.containsKey(itemId)) {
int index = indexOfId(itemId);
@@ -298,6 +303,7 @@ public class SQLContainer implements Container, Container.Filterable,
* {@inheritDoc}
*/
+ @Override
public Collection<?> getItemIds() {
updateCount();
ArrayList<RowId> ids = new ArrayList<RowId>();
@@ -355,6 +361,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#getType(java.lang.Object)
*/
+ @Override
public Class<?> getType(Object propertyId) {
if (!propertyIds.contains(propertyId)) {
return null;
@@ -368,6 +375,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#size()
*/
+ @Override
public int size() {
updateCount();
return size + sizeOfAddedItems() - removedItems.size();
@@ -379,6 +387,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#removeItem(java.lang.Object)
*/
+ @Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException {
if (!containsId(itemId)) {
@@ -447,6 +456,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#removeAllItems()
*/
+ @Override
public boolean removeAllItems() throws UnsupportedOperationException {
if (autoCommit) {
/* Remove and commit instantly. */
@@ -508,6 +518,7 @@ public class SQLContainer implements Container, Container.Filterable,
* {@inheritDoc}
*/
+ @Override
public void addContainerFilter(Filter filter)
throws UnsupportedFilterException {
// filter.setCaseSensitive(!ignoreCase);
@@ -520,6 +531,7 @@ public class SQLContainer implements Container, Container.Filterable,
* {@inheritDoc}
*/
+ @Override
public void removeContainerFilter(Filter filter) {
filters.remove(filter);
}
@@ -560,6 +572,7 @@ public class SQLContainer implements Container, Container.Filterable,
* {@inheritDoc}
*/
+ @Override
public void removeAllContainerFilters() {
filters.clear();
refresh();
@@ -575,6 +588,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Indexed#indexOfId(java.lang.Object)
*/
+ @Override
public int indexOfId(Object itemId) {
// First check if the id is in the added items
for (int ix = 0; ix < addedItems.size(); ix++) {
@@ -622,6 +636,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Indexed#getIdByIndex(int)
*/
+ @Override
public Object getIdByIndex(int index) {
if (index < 0 || index > size() - 1) {
return null;
@@ -649,6 +664,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#nextItemId(java.lang.Object)
*/
+ @Override
public Object nextItemId(Object itemId) {
return getIdByIndex(indexOfId(itemId) + 1);
}
@@ -659,6 +675,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#prevItemId(java.lang.Object)
*/
+ @Override
public Object prevItemId(Object itemId) {
return getIdByIndex(indexOfId(itemId) - 1);
}
@@ -669,6 +686,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#firstItemId()
*/
+ @Override
public Object firstItemId() {
updateCount();
if (size == 0) {
@@ -697,6 +715,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#lastItemId()
*/
+ @Override
public Object lastItemId() {
if (addedItems.isEmpty()) {
int lastIx = size() - 1;
@@ -723,6 +742,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#isFirstId(java.lang.Object)
*/
+ @Override
public boolean isFirstId(Object itemId) {
return firstItemId().equals(itemId);
}
@@ -733,6 +753,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#isLastId(java.lang.Object)
*/
+ @Override
public boolean isLastId(Object itemId) {
return lastItemId().equals(itemId);
}
@@ -748,6 +769,7 @@ public class SQLContainer implements Container, Container.Filterable,
* boolean[])
*/
+ @Override
public void sort(Object[] propertyId, boolean[] ascending) {
sorters.clear();
if (propertyId == null || propertyId.length == 0) {
@@ -777,6 +799,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds()
*/
+ @Override
public Collection<?> getSortableContainerPropertyIds() {
return getContainerPropertyIds();
}
@@ -1351,6 +1374,7 @@ public class SQLContainer implements Container, Container.Filterable,
* java.lang.Class, java.lang.Object)
*/
+ @Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -1362,6 +1386,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object)
*/
+ @Override
public boolean removeContainerProperty(Object propertyId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -1373,6 +1398,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#addItem(java.lang.Object)
*/
+ @Override
public Item addItem(Object itemId) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
@@ -1384,6 +1410,7 @@ public class SQLContainer implements Container, Container.Filterable,
* java.lang.Object)
*/
+ @Override
public Item addItemAfter(Object previousItemId, Object newItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -1395,6 +1422,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Indexed#addItemAt(int, java.lang.Object)
*/
+ @Override
public Item addItemAt(int index, Object newItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -1406,6 +1434,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Indexed#addItemAt(int)
*/
+ @Override
public Object addItemAt(int index) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
@@ -1416,6 +1445,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object)
*/
+ @Override
public Object addItemAfter(Object previousItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -1433,6 +1463,7 @@ public class SQLContainer implements Container, Container.Filterable,
* .data.Container.ItemSetChangeListener)
*/
+ @Override
public void addListener(Container.ItemSetChangeListener listener) {
if (itemSetChangeListeners == null) {
itemSetChangeListeners = new LinkedList<Container.ItemSetChangeListener>();
@@ -1448,6 +1479,7 @@ public class SQLContainer implements Container, Container.Filterable,
* .data.Container.ItemSetChangeListener)
*/
+ @Override
public void removeListener(Container.ItemSetChangeListener listener) {
if (itemSetChangeListeners != null) {
itemSetChangeListeners.remove(listener);
@@ -1477,6 +1509,7 @@ public class SQLContainer implements Container, Container.Filterable,
super(source);
}
+ @Override
public Container getContainer() {
return (Container) getSource();
}
diff --git a/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java b/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java
index 40d0d0426f..9aa4f7c4be 100644
--- a/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java
+++ b/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java
@@ -26,6 +26,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool {
this.dataSourceJndiName = dataSourceJndiName;
}
+ @Override
public Connection reserveConnection() throws SQLException {
Connection conn = getDataSource().getConnection();
conn.setAutoCommit(false);
@@ -51,6 +52,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool {
}
}
+ @Override
public void releaseConnection(Connection conn) {
if (conn != null) {
try {
@@ -62,6 +64,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool {
}
}
+ @Override
public void destroy() {
dataSource = null;
}
diff --git a/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java b/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java
index 2a1068e786..21760014b9 100644
--- a/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java
+++ b/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java
@@ -81,6 +81,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool {
initialized = true;
}
+ @Override
public synchronized Connection reserveConnection() throws SQLException {
if (!initialized) {
initializeConnections();
@@ -100,6 +101,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool {
return c;
}
+ @Override
public synchronized void releaseConnection(Connection conn) {
if (conn == null || !initialized) {
return;
@@ -139,6 +141,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool {
return c;
}
+ @Override
public void destroy() {
for (Connection c : availableConnections) {
try {
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java b/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java
index 56a8455a16..ec986fab95 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java
@@ -99,6 +99,7 @@ public class FreeformQuery implements QueryDelegate {
*
* {@inheritDoc}
*/
+ @Override
public int getCount() throws SQLException {
// First try the delegate
int count = countByDelegate();
@@ -187,6 +188,7 @@ public class FreeformQuery implements QueryDelegate {
*
* @see FreeformQueryDelegate#getQueryString(int, int)
*/
+ @Override
@SuppressWarnings("deprecation")
public ResultSet getResults(int offset, int pagelength) throws SQLException {
if (activeConnection == null) {
@@ -218,6 +220,7 @@ public class FreeformQuery implements QueryDelegate {
return rs;
}
+ @Override
@SuppressWarnings("deprecation")
public boolean implementationRespectsPagingLimits() {
if (delegate == null) {
@@ -251,6 +254,7 @@ public class FreeformQuery implements QueryDelegate {
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#setFilters(java
* .util.List)
*/
+ @Override
public void setFilters(List<Filter> filters)
throws UnsupportedOperationException {
if (delegate != null) {
@@ -268,6 +272,7 @@ public class FreeformQuery implements QueryDelegate {
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#setOrderBy(java
* .util.List)
*/
+ @Override
public void setOrderBy(List<OrderBy> orderBys)
throws UnsupportedOperationException {
if (delegate != null) {
@@ -285,6 +290,7 @@ public class FreeformQuery implements QueryDelegate {
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#storeRow(com.vaadin
* .data.util.sqlcontainer.RowItem)
*/
+ @Override
public int storeRow(RowItem row) throws SQLException {
if (activeConnection == null) {
throw new IllegalStateException("No transaction is active!");
@@ -307,6 +313,7 @@ public class FreeformQuery implements QueryDelegate {
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#removeRow(com.vaadin
* .data.util.sqlcontainer.RowItem)
*/
+ @Override
public boolean removeRow(RowItem row) throws SQLException {
if (activeConnection == null) {
throw new IllegalStateException("No transaction is active!");
@@ -328,6 +335,7 @@ public class FreeformQuery implements QueryDelegate {
* @see
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#beginTransaction()
*/
+ @Override
public synchronized void beginTransaction()
throws UnsupportedOperationException, SQLException {
if (activeConnection != null) {
@@ -342,6 +350,7 @@ public class FreeformQuery implements QueryDelegate {
*
* @see com.vaadin.data.util.sqlcontainer.query.QueryDelegate#commit()
*/
+ @Override
public synchronized void commit() throws UnsupportedOperationException,
SQLException {
if (activeConnection == null) {
@@ -359,6 +368,7 @@ public class FreeformQuery implements QueryDelegate {
*
* @see com.vaadin.data.util.sqlcontainer.query.QueryDelegate#rollback()
*/
+ @Override
public synchronized void rollback() throws UnsupportedOperationException,
SQLException {
if (activeConnection == null) {
@@ -376,6 +386,7 @@ public class FreeformQuery implements QueryDelegate {
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#getPrimaryKeyColumns
* ()
*/
+ @Override
public List<String> getPrimaryKeyColumns() {
return primaryKeyColumns;
}
@@ -403,6 +414,7 @@ public class FreeformQuery implements QueryDelegate {
* @see FreeformQueryDelegate#getContainsRowQueryString(Object...)
*
*/
+ @Override
@SuppressWarnings("deprecation")
public boolean containsRowWithKey(Object... keys) throws SQLException {
String query = null;
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java b/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java
index 22ca30cc32..d0606704f7 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java
@@ -111,6 +111,7 @@ public class TableQuery implements QueryDelegate,
*
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#getCount()
*/
+ @Override
public int getCount() throws SQLException {
getLogger().log(Level.FINE, "Fetching count...");
StatementHelper sh = sqlGenerator.generateSelectQuery(tableName,
@@ -137,6 +138,7 @@ public class TableQuery implements QueryDelegate,
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#getResults(int,
* int)
*/
+ @Override
public ResultSet getResults(int offset, int pagelength) throws SQLException {
StatementHelper sh;
/*
@@ -161,6 +163,7 @@ public class TableQuery implements QueryDelegate,
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#
* implementationRespectsPagingLimits()
*/
+ @Override
public boolean implementationRespectsPagingLimits() {
return true;
}
@@ -172,6 +175,7 @@ public class TableQuery implements QueryDelegate,
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#storeRow(com.vaadin
* .addon.sqlcontainer.RowItem)
*/
+ @Override
public int storeRow(RowItem row) throws UnsupportedOperationException,
SQLException {
if (row == null) {
@@ -254,6 +258,7 @@ public class TableQuery implements QueryDelegate,
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#setFilters(java.util
* .List)
*/
+ @Override
public void setFilters(List<Filter> filters)
throws UnsupportedOperationException {
if (filters == null) {
@@ -270,6 +275,7 @@ public class TableQuery implements QueryDelegate,
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#setOrderBy(java.util
* .List)
*/
+ @Override
public void setOrderBy(List<OrderBy> orderBys)
throws UnsupportedOperationException {
if (orderBys == null) {
@@ -284,6 +290,7 @@ public class TableQuery implements QueryDelegate,
*
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#beginTransaction()
*/
+ @Override
public void beginTransaction() throws UnsupportedOperationException,
SQLException {
if (transactionOpen && activeConnection != null) {
@@ -301,6 +308,7 @@ public class TableQuery implements QueryDelegate,
*
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#commit()
*/
+ @Override
public void commit() throws UnsupportedOperationException, SQLException {
if (transactionOpen && activeConnection != null) {
getLogger().log(Level.FINE, "DB -> commit");
@@ -329,6 +337,7 @@ public class TableQuery implements QueryDelegate,
*
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#rollback()
*/
+ @Override
public void rollback() throws UnsupportedOperationException, SQLException {
if (transactionOpen && activeConnection != null) {
getLogger().log(Level.FINE, "DB -> rollback");
@@ -346,6 +355,7 @@ public class TableQuery implements QueryDelegate,
* @see
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#getPrimaryKeyColumns()
*/
+ @Override
public List<String> getPrimaryKeyColumns() {
return Collections.unmodifiableList(primaryKeyColumns);
}
@@ -581,6 +591,7 @@ public class TableQuery implements QueryDelegate,
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#removeRow(com.vaadin
* .addon.sqlcontainer.RowItem)
*/
+ @Override
public boolean removeRow(RowItem row) throws UnsupportedOperationException,
SQLException {
getLogger().log(Level.FINE,
@@ -604,6 +615,7 @@ public class TableQuery implements QueryDelegate,
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#containsRowWithKey(
* java.lang.Object[])
*/
+ @Override
public boolean containsRowWithKey(Object... keys) throws SQLException {
ArrayList<Filter> filtersAndKeys = new ArrayList<Filter>();
if (filters != null) {
@@ -665,10 +677,12 @@ public class TableQuery implements QueryDelegate,
this.newId = newId;
}
+ @Override
public RowId getNewRowId() {
return newId;
}
+ @Override
public RowId getOldRowId() {
return oldId;
}
@@ -677,6 +691,7 @@ public class TableQuery implements QueryDelegate,
/**
* Adds RowIdChangeListener to this query
*/
+ @Override
public void addListener(RowIdChangeListener listener) {
if (rowIdChangeListeners == null) {
rowIdChangeListeners = new LinkedList<QueryDelegate.RowIdChangeListener>();
@@ -687,6 +702,7 @@ public class TableQuery implements QueryDelegate,
/**
* Removes the given RowIdChangeListener from this query
*/
+ @Override
public void removeListener(RowIdChangeListener listener) {
if (rowIdChangeListeners != null) {
rowIdChangeListeners.remove(listener);
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java
index 24d283c9ab..a6798f972b 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java
@@ -51,6 +51,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
* generateSelectQuery(java.lang.String, java.util.List, java.util.List,
* int, int, java.lang.String)
*/
+ @Override
public StatementHelper generateSelectQuery(String tableName,
List<Filter> filters, List<OrderBy> orderBys, int offset,
int pagelength, String toSelect) {
@@ -84,6 +85,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
* generateUpdateQuery(java.lang.String,
* com.vaadin.addon.sqlcontainer.RowItem)
*/
+ @Override
public StatementHelper generateUpdateQuery(String tableName, RowItem item) {
if (tableName == null || tableName.trim().equals("")) {
throw new IllegalArgumentException("Table name must be given.");
@@ -133,6 +135,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
* generateInsertQuery(java.lang.String,
* com.vaadin.addon.sqlcontainer.RowItem)
*/
+ @Override
public StatementHelper generateInsertQuery(String tableName, RowItem item) {
if (tableName == null || tableName.trim().equals("")) {
throw new IllegalArgumentException("Table name must be given.");
@@ -184,6 +187,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
* generateDeleteQuery(java.lang.String,
* com.vaadin.addon.sqlcontainer.RowItem)
*/
+ @Override
public StatementHelper generateDeleteQuery(String tableName,
List<String> primaryKeyColumns, String versionColumn, RowItem item) {
if (tableName == null || tableName.trim().equals("")) {
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java
index 02d6671b60..251a543a8a 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;
public class AndTranslator implements FilterTranslator {
+ @Override
public boolean translatesFilter(Filter filter) {
return filter instanceof And;
}
+ @Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
return QueryBuilder.group(QueryBuilder.getJoinedFilterString(
((And) filter).getFilters(), "AND", sh));
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java
index e8a87a82d8..4fcaf759ea 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;
public class BetweenTranslator implements FilterTranslator {
+ @Override
public boolean translatesFilter(Filter filter) {
return filter instanceof Between;
}
+ @Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
Between between = (Between) filter;
sh.addParameterValue(between.getStartValue());
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java
index 72d72dd069..4293e1d630 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;
public class CompareTranslator implements FilterTranslator {
+ @Override
public boolean translatesFilter(Filter filter) {
return filter instanceof Compare;
}
+ @Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
Compare compare = (Compare) filter;
sh.addParameterValue(compare.getValue());
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java
index 2593bbae57..a2a6cd2c09 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;
public class IsNullTranslator implements FilterTranslator {
+ @Override
public boolean translatesFilter(Filter filter) {
return filter instanceof IsNull;
}
+ @Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
IsNull in = (IsNull) filter;
return QueryBuilder.quote(in.getPropertyId()) + " IS NULL";
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java
index b1c779ae73..25a85caec0 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;
public class LikeTranslator implements FilterTranslator {
+ @Override
public boolean translatesFilter(Filter filter) {
return filter instanceof Like;
}
+ @Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
Like like = (Like) filter;
if (like.isCaseSensitive()) {
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java
index 7c1bba2bb5..5dfbe240e7 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java
@@ -10,10 +10,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;
public class NotTranslator implements FilterTranslator {
+ @Override
public boolean translatesFilter(Filter filter) {
return filter instanceof Not;
}
+ @Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
Not not = (Not) filter;
if (not.getFilter() instanceof IsNull) {
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java
index 9724ee7944..2f0ed814e0 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;
public class OrTranslator implements FilterTranslator {
+ @Override
public boolean translatesFilter(Filter filter) {
return filter instanceof Or;
}
+ @Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
return QueryBuilder.group(QueryBuilder.getJoinedFilterString(
((Or) filter).getFilters(), "OR", sh));
diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java
index 1aae68abc0..f108003535 100644
--- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java
+++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java
@@ -10,10 +10,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;
public class SimpleStringTranslator implements FilterTranslator {
+ @Override
public boolean translatesFilter(Filter filter) {
return filter instanceof SimpleStringFilter;
}
+ @Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
SimpleStringFilter ssf = (SimpleStringFilter) filter;
// Create a Like filter based on the SimpleStringFilter and execute the