Added opened database check. Renamed remove method with delete.

This commit is contained in:
Christian P. MOMON 2018-02-28 11:01:06 +01:00
parent 0303fee50b
commit b17515229a
5 changed files with 599 additions and 416 deletions

View file

@ -0,0 +1,64 @@
/**
* Copyright (C) 2018 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of SikevaDB, simple key value database.
*
* SikevaDB is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* SikevaDB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with SikevaDB. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.devinsy.sikevadb.core;
/**
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/
public class UnopenedDatabaseException extends SikevaDBException
{
private static final long serialVersionUID = 8364599416669077052L;
/**
*
*/
public UnopenedDatabaseException()
{
super();
}
/**
*
* @param message
*/
public UnopenedDatabaseException(final String message)
{
super(message);
}
/**
*
* @param message
* @param cause
*/
public UnopenedDatabaseException(final String message, final Throwable cause)
{
super(message, cause);
}
/**
*
* @param cause
*/
public UnopenedDatabaseException(final Throwable cause)
{
super(cause);
}
}

View file

@ -1005,7 +1005,7 @@ public class FileTreeSikevaDB implements SikevaDB
* @see fr.devinsy.sikevadb.core.SikevaDB#remove(java.lang.String) * @see fr.devinsy.sikevadb.core.SikevaDB#remove(java.lang.String)
*/ */
@Override @Override
public void remove(final String key) throws SikevaDBException public void delete(final String key) throws SikevaDBException
{ {
if (this.status == Status.CLOSED) if (this.status == Status.CLOSED)
{ {
@ -1038,7 +1038,7 @@ public class FileTreeSikevaDB implements SikevaDB
* @see fr.devinsy.sikevadb.core.SikevaDB#remove(java.lang.String, java.lang.String) * @see fr.devinsy.sikevadb.core.SikevaDB#remove(java.lang.String, java.lang.String)
*/ */
@Override @Override
public void remove(final String key, final String subkey) throws SikevaDBException public void delete(final String key, final String subkey) throws SikevaDBException
{ {
if (this.status == Status.CLOSED) if (this.status == Status.CLOSED)
{ {
@ -1072,7 +1072,7 @@ public class FileTreeSikevaDB implements SikevaDB
* @see fr.devinsy.sikevadb.core.SikevaDB#removeMany(java.lang.String, java.lang.String[]) * @see fr.devinsy.sikevadb.core.SikevaDB#removeMany(java.lang.String, java.lang.String[])
*/ */
@Override @Override
public void removeMany(final String key, final String... subkeys) throws SikevaDBException public void deleteMany(final String key, final String... subkeys) throws SikevaDBException
{ {
if (this.status == Status.CLOSED) if (this.status == Status.CLOSED)
{ {
@ -1088,7 +1088,7 @@ public class FileTreeSikevaDB implements SikevaDB
{ {
for (String subkey : subkeys) for (String subkey : subkeys)
{ {
remove(key, subkey); delete(key, subkey);
} }
} }
} }

View file

@ -40,6 +40,7 @@ import fr.devinsy.sikevadb.core.Element;
import fr.devinsy.sikevadb.core.Elements; import fr.devinsy.sikevadb.core.Elements;
import fr.devinsy.sikevadb.core.SikevaDB; import fr.devinsy.sikevadb.core.SikevaDB;
import fr.devinsy.sikevadb.core.SikevaDBException; import fr.devinsy.sikevadb.core.SikevaDBException;
import fr.devinsy.sikevadb.core.UnopenedDatabaseException;
import fr.devinsy.util.strings.StringList; import fr.devinsy.util.strings.StringList;
/** /**
@ -115,12 +116,17 @@ public class SQLSikevaDB implements SikevaDB
} }
} }
/** /* (non-Javadoc)
* This methods clear all data in current opened database. * @see fr.devinsy.sikevadb.core.SikevaDB#clear()
*
*/ */
@Override @Override
public void clear() throws SikevaDBException public void clear() throws SikevaDBException
{
if (this.status == Status.CLOSED)
{
throw new UnopenedDatabaseException();
}
else
{ {
Connection connection = null; Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
@ -142,6 +148,7 @@ public class SQLSikevaDB implements SikevaDB
closeQuietly(connection, statement, resultSet); closeQuietly(connection, statement, resultSet);
} }
} }
}
/** /**
* This method closes the current database session. * This method closes the current database session.
@ -174,10 +181,14 @@ public class SQLSikevaDB implements SikevaDB
} }
/** /**
* Close quietly.
* *
* @param connection * @param connection
* the connection
* @param statement * @param statement
* the statement
* @param resultSet * @param resultSet
* the result set
*/ */
private void closeQuietly(final Connection connection, final Statement statement, final ResultSet resultSet) private void closeQuietly(final Connection connection, final Statement statement, final ResultSet resultSet)
{ {
@ -221,14 +232,20 @@ public class SQLSikevaDB implements SikevaDB
} }
} }
/** /* (non-Javadoc)
* {@inheritDoc} * @see fr.devinsy.sikevadb.core.SikevaDB#countOfElements()
*/ */
@Override @Override
public long countOfElements() throws SikevaDBException public long countOfElements() throws SikevaDBException
{ {
long result; long result;
if (this.status == Status.CLOSED)
{
throw new UnopenedDatabaseException();
}
else
{
Connection connection = null; Connection connection = null;
Statement statement = null; Statement statement = null;
ResultSet resultSet = null; ResultSet resultSet = null;
@ -251,20 +268,25 @@ public class SQLSikevaDB implements SikevaDB
{ {
closeQuietly(connection, statement, resultSet); closeQuietly(connection, statement, resultSet);
} }
}
// //
return result; return result;
} }
/** /* (non-Javadoc)
* {@inheritDoc} * @see fr.devinsy.sikevadb.core.SikevaDB#countOfElements(java.lang.String)
*/ */
@Override @Override
public long countOfElements(final String key) throws SikevaDBException public long countOfElements(final String key) throws SikevaDBException
{ {
long result; long result;
if (key == null) if (this.status == Status.CLOSED)
{
throw new UnopenedDatabaseException();
}
else if (key == null)
{ {
throw new IllegalArgumentException("Key is null."); throw new IllegalArgumentException("Key is null.");
} }
@ -299,15 +321,19 @@ public class SQLSikevaDB implements SikevaDB
return result; return result;
} }
/** /* (non-Javadoc)
* {@inheritDoc} * @see fr.devinsy.sikevadb.core.SikevaDB#countOfElements(java.lang.String, java.lang.String)
*/ */
@Override @Override
public long countOfElements(final String key, final String subkey) throws SikevaDBException public long countOfElements(final String key, final String subkey) throws SikevaDBException
{ {
long result; long result;
if (key == null) if (this.status == Status.CLOSED)
{
throw new UnopenedDatabaseException();
}
else if (key == null)
{ {
throw new IllegalArgumentException("Key is null."); throw new IllegalArgumentException("Key is null.");
} }
@ -423,15 +449,177 @@ public class SQLSikevaDB implements SikevaDB
} }
/** /**
* {@inheritDoc}
*/
@Override
public void delete(final String key) throws SikevaDBException
{
if (key == null)
{
throw new IllegalArgumentException("Key is null.");
}
else
{
//
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
try
{
//
connection = getConnection();
connection.setAutoCommit(true);
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY IS NULL AND ARCHIVE_DATE IS NULL");
statement.setString(1, key);
int rowCount = statement.executeUpdate();
if (rowCount == 0)
{
logger.warn("Remove action without existing target [key=" + key + "]");
}
}
catch (SQLException exception)
{
logger.error("Error removing element.", exception);
try
{
connection.rollback();
}
catch (SQLException exception1)
{
logger.error("Rollback failed.", exception);
}
throw new SikevaDBException("Error removing element", exception);
}
finally
{
closeQuietly(connection, statement, resultSet);
}
}
}
/**
* {@inheritDoc}
*/
@Override
public void delete(final String key, final String subkey) throws SikevaDBException
{
if (key == null)
{
throw new IllegalArgumentException("Key is null.");
}
else if (subkey == null)
{
throw new IllegalArgumentException("Subkey is null.");
}
else
{
//
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
try
{
//
connection = getConnection();
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY=? AND ARCHIVE_DATE IS NULL");
statement.setString(1, key);
statement.setString(2, subkey);
int rowCount = statement.executeUpdate();
if (rowCount == 0)
{
logger.warn("Remove action without existing target [key=" + key + "][subkey=" + subkey + "]");
}
}
catch (SQLException exception)
{
logger.error("Error removing subkey.", exception);
throw new SikevaDBException("Error removing subkey", exception);
}
finally
{
closeQuietly(connection, statement, resultSet);
}
}
}
/**
* {@inheritDoc}
*/
@Override
public void deleteMany(final String key, final String... subkeys) throws SikevaDBException
{
if (key == null)
{
throw new IllegalArgumentException("Key is null.");
}
else if ((subkeys != null) && (subkeys.length > 0))
{
//
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
try
{
//
connection = getConnection();
//
String questionMarks = new StringList(subkeys.length).append('?').repeatLast(subkeys.length - 1).toStringWithCommas();
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY IN (" + questionMarks + ") AND ARCHIVE_DATE IS NULL");
//
statement.setString(1, key);
//
for (int index = 0; index < subkeys.length; index++)
{
statement.setString(2 + index, subkeys[index]);
}
//
int rowCount = statement.executeUpdate();
if (rowCount == 0)
{
logger.warn("Remove action without existing target [key=" + key + "][subkeys=" + new StringList(subkeys).toStringWithCommas() + "]");
}
}
catch (SQLException exception)
{
logger.error("Error removing subkeys.", exception);
throw new SikevaDBException("Error removing subkeys", exception);
}
finally
{
closeQuietly(connection, statement, resultSet);
}
}
}
/**
* Exists.
* *
* @param id * @param element
* @return * the element
* @return true, if successful
* @throws SikevaDBException * @throws SikevaDBException
* the sikeva DB exception
*/ */
public boolean exists(final Element element) throws SikevaDBException public boolean exists(final Element element) throws SikevaDBException
{ {
boolean result; boolean result;
if (this.status == Status.CLOSED)
{
throw new UnopenedDatabaseException();
}
else
{
if (element == null) if (element == null)
{ {
result = false; result = false;
@ -444,20 +632,29 @@ public class SQLSikevaDB implements SikevaDB
{ {
result = true; result = true;
} }
}
// //
return result; return result;
} }
/** /**
* Gets the connection.
* *
* @return * @return the connection
* @throws SikevaDBException * @throws SikevaDBException
* the sikeva DB exception
*/ */
public Connection getConnection() throws SikevaDBException public Connection getConnection() throws SikevaDBException
{ {
Connection result; Connection result;
if (this.status == Status.CLOSED)
{
throw new UnopenedDatabaseException();
}
else
{
if (this.singleConnection != null) if (this.singleConnection != null)
{ {
result = this.singleConnection; result = this.singleConnection;
@ -478,36 +675,61 @@ public class SQLSikevaDB implements SikevaDB
{ {
throw new IllegalArgumentException("Connection is not initialized."); throw new IllegalArgumentException("Connection is not initialized.");
} }
}
// //
return result; return result;
} }
/** /**
* Gets the context name.
* *
* @return * @return the context name
*/ */
public String getContextName() public String getContextName()
{ {
return this.contextName; String result;
result = this.contextName;
//
return result;
} }
/** /**
* Gets the driver classname.
* *
* @return * @return the driver classname
*/ */
public String getDriverClassname() public String getDriverClassname()
{ {
return this.driverClassname; String result;
result = this.driverClassname;
//
return result;
} }
/** /**
* Gets the element.
* *
* @param id
* the id
* @return the element
* @throws SikevaDBException
* the sikeva DB exception
*/ */
public Element getElement(final long id) throws SikevaDBException public Element getElement(final long id) throws SikevaDBException
{ {
Element result; Element result;
if (this.status == Status.CLOSED)
{
throw new UnopenedDatabaseException();
}
else
{
if (id == Element.NO_ID) if (id == Element.NO_ID)
{ {
result = null; result = null;
@ -564,21 +786,25 @@ public class SQLSikevaDB implements SikevaDB
closeQuietly(connection, statement, resultSet); closeQuietly(connection, statement, resultSet);
} }
} }
}
// //
return result; return result;
} }
/** /* (non-Javadoc)
* {@inheritDoc} * @see fr.devinsy.sikevadb.core.SikevaDB#getElement(java.lang.String)
*/ */
@Override @Override
public Element getElement(final String key) throws SikevaDBException public Element getElement(final String key) throws SikevaDBException
{ {
Element result; Element result;
// if (this.status == Status.CLOSED)
if (key == null) {
throw new UnopenedDatabaseException();
}
else if (key == null)
{ {
throw new IllegalArgumentException("Key is null."); throw new IllegalArgumentException("Key is null.");
} }
@ -640,16 +866,19 @@ public class SQLSikevaDB implements SikevaDB
return result; return result;
} }
/** /* (non-Javadoc)
* {@inheritDoc} * @see fr.devinsy.sikevadb.core.SikevaDB#getElement(java.lang.String, java.lang.String)
*/ */
@Override @Override
public Element getElement(final String key, final String subkey) throws SikevaDBException public Element getElement(final String key, final String subkey) throws SikevaDBException
{ {
Element result; Element result;
// if (this.status == Status.CLOSED)
if (key == null) {
throw new UnopenedDatabaseException();
}
else if (key == null)
{ {
throw new IllegalArgumentException("Key is null."); throw new IllegalArgumentException("Key is null.");
} }
@ -717,14 +946,20 @@ public class SQLSikevaDB implements SikevaDB
return result; return result;
} }
/** /* (non-Javadoc)
* * @see fr.devinsy.sikevadb.core.SikevaDB#getElements()
*/ */
@Override @Override
public Elements getElements() throws SikevaDBException public Elements getElements() throws SikevaDBException
{ {
Elements result; Elements result;
if (this.status == Status.CLOSED)
{
throw new UnopenedDatabaseException();
}
else
{
// //
result = new Elements((int) countOfElements()); result = new Elements((int) countOfElements());
@ -768,21 +1003,25 @@ public class SQLSikevaDB implements SikevaDB
{ {
closeQuietly(connection, statement, resultSet); closeQuietly(connection, statement, resultSet);
} }
}
// //
return result; return result;
} }
/** /* (non-Javadoc)
* {@inheritDoc} * @see fr.devinsy.sikevadb.core.SikevaDB#getElements(java.lang.String)
*/ */
@Override @Override
public Elements getElements(final String key) throws SikevaDBException public Elements getElements(final String key) throws SikevaDBException
{ {
Elements result; Elements result;
// if (this.status == Status.CLOSED)
if (key == null) {
throw new UnopenedDatabaseException();
}
else if (key == null)
{ {
throw new IllegalArgumentException("Key is null."); throw new IllegalArgumentException("Key is null.");
} }
@ -838,14 +1077,20 @@ public class SQLSikevaDB implements SikevaDB
return result; return result;
} }
/** /* (non-Javadoc)
* {@inheritDoc} * @see fr.devinsy.sikevadb.core.SikevaDB#getKeys()
*/ */
@Override @Override
public StringList getKeys() throws SikevaDBException public StringList getKeys() throws SikevaDBException
{ {
StringList result; StringList result;
if (this.status == Status.CLOSED)
{
throw new UnopenedDatabaseException();
}
else
{
// //
result = new StringList(); result = new StringList();
@ -874,39 +1119,55 @@ public class SQLSikevaDB implements SikevaDB
{ {
closeQuietly(connection, statement, resultSet); closeQuietly(connection, statement, resultSet);
} }
}
// //
return result; return result;
} }
/** /**
* Gets the login.
* *
* @return * @return the login
*/ */
public String getLogin() public String getLogin()
{ {
return this.login; String result;
result = this.login;
//
return result;
} }
/** /**
* Gets the password.
* *
* @return * @return the password
*/ */
public String getPassword() public String getPassword()
{ {
return this.password; String result;
result = this.password;
//
return result;
} }
/** /* (non-Javadoc)
* {@inheritDoc} * @see fr.devinsy.sikevadb.core.SikevaDB#getSubkeys(java.lang.String)
*/ */
@Override @Override
public StringList getSubkeys(final String key) throws SikevaDBException public StringList getSubkeys(final String key) throws SikevaDBException
{ {
StringList result; StringList result;
// if (this.status == Status.CLOSED)
if (key == null) {
throw new UnopenedDatabaseException();
}
else if (key == null)
{ {
throw new IllegalArgumentException("Key is null."); throw new IllegalArgumentException("Key is null.");
} }
@ -949,23 +1210,33 @@ public class SQLSikevaDB implements SikevaDB
} }
/** /**
* Gets the url.
* *
* @return * @return the url
*/ */
public String getUrl() public String getUrl()
{ {
return this.url; String result;
result = this.url;
//
return result;
} }
/** /* (non-Javadoc)
* {@inheritDoc} * @see fr.devinsy.sikevadb.core.SikevaDB#getValue(java.lang.String)
*/ */
@Override @Override
public String getValue(final String key) throws SikevaDBException public String getValue(final String key) throws SikevaDBException
{ {
String result; String result;
if (key == null) if (this.status == Status.CLOSED)
{
throw new UnopenedDatabaseException();
}
else if (key == null)
{ {
throw new IllegalArgumentException("Key is null."); throw new IllegalArgumentException("Key is null.");
} }
@ -1009,7 +1280,7 @@ public class SQLSikevaDB implements SikevaDB
closeQuietly(connection, statement, resultSet); closeQuietly(connection, statement, resultSet);
} }
} }
getValue("", "");
// //
return result; return result;
} }
@ -1675,158 +1946,6 @@ public class SQLSikevaDB implements SikevaDB
} }
} }
/**
* {@inheritDoc}
*/
@Override
public void remove(final String key) throws SikevaDBException
{
if (key == null)
{
throw new IllegalArgumentException("Key is null.");
}
else
{
//
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
try
{
//
connection = getConnection();
connection.setAutoCommit(true);
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY IS NULL AND ARCHIVE_DATE IS NULL");
statement.setString(1, key);
int rowCount = statement.executeUpdate();
if (rowCount == 0)
{
logger.warn("Remove action without existing target [key=" + key + "]");
}
}
catch (SQLException exception)
{
logger.error("Error removing element.", exception);
try
{
connection.rollback();
}
catch (SQLException exception1)
{
logger.error("Rollback failed.", exception);
}
throw new SikevaDBException("Error removing element", exception);
}
finally
{
closeQuietly(connection, statement, resultSet);
}
}
}
/**
* {@inheritDoc}
*/
@Override
public void remove(final String key, final String subkey) throws SikevaDBException
{
if (key == null)
{
throw new IllegalArgumentException("Key is null.");
}
else if (subkey == null)
{
throw new IllegalArgumentException("Subkey is null.");
}
else
{
//
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
try
{
//
connection = getConnection();
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY=? AND ARCHIVE_DATE IS NULL");
statement.setString(1, key);
statement.setString(2, subkey);
int rowCount = statement.executeUpdate();
if (rowCount == 0)
{
logger.warn("Remove action without existing target [key=" + key + "][subkey=" + subkey + "]");
}
}
catch (SQLException exception)
{
logger.error("Error removing subkey.", exception);
throw new SikevaDBException("Error removing subkey", exception);
}
finally
{
closeQuietly(connection, statement, resultSet);
}
}
}
/**
* {@inheritDoc}
*/
@Override
public void removeMany(final String key, final String... subkeys) throws SikevaDBException
{
if (key == null)
{
throw new IllegalArgumentException("Key is null.");
}
else if ((subkeys != null) && (subkeys.length > 0))
{
//
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
try
{
//
connection = getConnection();
//
String questionMarks = new StringList(subkeys.length).append('?').repeatLast(subkeys.length - 1).toStringWithCommas();
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY IN (" + questionMarks + ") AND ARCHIVE_DATE IS NULL");
//
statement.setString(1, key);
//
for (int index = 0; index < subkeys.length; index++)
{
statement.setString(2 + index, subkeys[index]);
}
//
int rowCount = statement.executeUpdate();
if (rowCount == 0)
{
logger.warn("Remove action without existing target [key=" + key + "][subkeys=" + new StringList(subkeys).toStringWithCommas() + "]");
}
}
catch (SQLException exception)
{
logger.error("Error removing subkeys.", exception);
throw new SikevaDBException("Error removing subkeys", exception);
}
finally
{
closeQuietly(connection, statement, resultSet);
}
}
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -1891,8 +2010,8 @@ public class SQLSikevaDB implements SikevaDB
} }
} }
/** /* (non-Javadoc)
* {@inheritDoc} * @see fr.devinsy.sikevadb.core.SikevaDB#replaceInValue(java.lang.String, java.lang.String[])
*/ */
@Override @Override
public void replaceInValue(final String key, final String... tokens) throws SikevaDBException public void replaceInValue(final String key, final String... tokens) throws SikevaDBException

View file

@ -501,7 +501,7 @@ public class TreeFileSikevaDBTest
Assert.assertEquals(12, database.countOfElements()); Assert.assertEquals(12, database.countOfElements());
database.removeMany("alpha01", "bravo", "delta", "fox"); database.deleteMany("alpha01", "bravo", "delta", "fox");
Assert.assertEquals(9, database.countOfElements()); Assert.assertEquals(9, database.countOfElements());
@ -560,14 +560,14 @@ public class TreeFileSikevaDBTest
database.put("alpha03", "qlskjfmlqj"); database.put("alpha03", "qlskjfmlqj");
database.put("alpha04", "qlskjfmlqj"); database.put("alpha04", "qlskjfmlqj");
database.put("alpha05", "qlskjfmlqj"); database.put("alpha05", "qlskjfmlqj");
database.remove("alpha03"); database.delete("alpha03");
database.put("alpha01s", "bravo1", "qlskjfmlqja"); database.put("alpha01s", "bravo1", "qlskjfmlqja");
database.put("alpha01s", "bravo1", "qlskjfmlqjb"); database.put("alpha01s", "bravo1", "qlskjfmlqjb");
database.put("alpha01s", "bravo2", "qlskjfmlqj"); database.put("alpha01s", "bravo2", "qlskjfmlqj");
database.put("alpha01s", "bravo3", "qlskjfmlqj"); database.put("alpha01s", "bravo3", "qlskjfmlqj");
database.put("alpha01s", "bravo4", "qlskjfmlqj"); database.put("alpha01s", "bravo4", "qlskjfmlqj");
database.put("alpha01s", "bravo5", "qlskjfmlqj"); database.put("alpha01s", "bravo5", "qlskjfmlqj");
database.remove("alpha01s", "bravo3"); database.delete("alpha01s", "bravo3");
// System.out.println(database.countOfElements() + " " + // System.out.println(database.countOfElements() + " " +
// database.countOfArchivedElements() + " " + // database.countOfArchivedElements() + " " +

View file

@ -566,7 +566,7 @@ public class SQLSikevaDBTest
Assert.assertEquals(12, database.countOfElements()); Assert.assertEquals(12, database.countOfElements());
database.removeMany("alpha01", "bravo", "delta", "fox"); database.deleteMany("alpha01", "bravo", "delta", "fox");
Assert.assertEquals(9, database.countOfElements()); Assert.assertEquals(9, database.countOfElements());
@ -625,14 +625,14 @@ public class SQLSikevaDBTest
database.put("alpha03", "qlskjfmlqj"); database.put("alpha03", "qlskjfmlqj");
database.put("alpha04", "qlskjfmlqj"); database.put("alpha04", "qlskjfmlqj");
database.put("alpha05", "qlskjfmlqj"); database.put("alpha05", "qlskjfmlqj");
database.remove("alpha03"); database.delete("alpha03");
database.put("alpha01", "bravo1", "qlskjfmlqja"); database.put("alpha01", "bravo1", "qlskjfmlqja");
database.put("alpha01", "bravo1", "qlskjfmlqjb"); database.put("alpha01", "bravo1", "qlskjfmlqjb");
database.put("alpha01", "bravo2", "qlskjfmlqj"); database.put("alpha01", "bravo2", "qlskjfmlqj");
database.put("alpha01", "bravo3", "qlskjfmlqj"); database.put("alpha01", "bravo3", "qlskjfmlqj");
database.put("alpha01", "bravo4", "qlskjfmlqj"); database.put("alpha01", "bravo4", "qlskjfmlqj");
database.put("alpha01", "bravo5", "qlskjfmlqj"); database.put("alpha01", "bravo5", "qlskjfmlqj");
database.remove("alpha01", "bravo3"); database.delete("alpha01", "bravo3");
// System.out.println(database.countOfElements() + " " + // System.out.println(database.countOfElements() + " " +
// database.countOfArchivedElements() + " " + // database.countOfArchivedElements() + " " +