From f9ac2a46f83fcc6c3db0fd040f954eb93be49ae5 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 14 Aug 2015 23:27:21 +0200 Subject: [PATCH] =?utf8?q?Added=20and=20implemented=20missing=20methods=20?= =?utf8?q?Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../AddressbookContactDatabaseConstants.java | 7 ++++++- .../AddressbookContactDatabaseFrontend.java | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Addressbook/src/org/mxchange/addressbook/database/contact/AddressbookContactDatabaseConstants.java b/Addressbook/src/org/mxchange/addressbook/database/contact/AddressbookContactDatabaseConstants.java index e4b743e..4596c57 100644 --- a/Addressbook/src/org/mxchange/addressbook/database/contact/AddressbookContactDatabaseConstants.java +++ b/Addressbook/src/org/mxchange/addressbook/database/contact/AddressbookContactDatabaseConstants.java @@ -25,7 +25,12 @@ public final class AddressbookContactDatabaseConstants { /** * Column own_contact */ - public static final String COLUMN_NAME_OWN_CONTACT = "own_contact"; //NOI18N + public static final String COLUMN_OWN_CONTACT = "own_contact"; //NOI18N + + /** + * Column id + */ + public static final String COLUMN_ID = "id"; /** * No instances are allowed as this class only holds static attributes diff --git a/Addressbook/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java b/Addressbook/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java index 48f8bbe..0b98b4b 100644 --- a/Addressbook/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java +++ b/Addressbook/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java @@ -21,6 +21,7 @@ import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.text.MessageFormat; import java.util.Iterator; +import java.util.Map; import java.util.StringTokenizer; import org.mxchange.addressbook.contact.book.BookContact; import org.mxchange.addressbook.contact.user.UserContact; @@ -162,7 +163,7 @@ public class AddressbookContactDatabaseFrontend extends BaseDatabaseFrontend imp this.getLogger().trace("CALLED!"); //NOI18N // Get row index back from backend - int rowIndex = this.getBackend().getRowIndexFromColumn(AddressbookContactDatabaseConstants.COLUMN_NAME_OWN_CONTACT, true); + int rowIndex = this.getBackend().getRowIndexFromColumn(AddressbookContactDatabaseConstants.COLUMN_OWN_CONTACT, true); // Debug message this.getLogger().debug(MessageFormat.format("rowIndex={0}", rowIndex)); @@ -247,7 +248,7 @@ public class AddressbookContactDatabaseFrontend extends BaseDatabaseFrontend imp SearchableCritera critera = new SearchCriteria(); // Add condition - critera.addCriteria(AddressbookContactDatabaseConstants.COLUMN_NAME_OWN_CONTACT, true); + critera.addCriteria(AddressbookContactDatabaseConstants.COLUMN_OWN_CONTACT, true); // Get result Result result = this.getBackend().doSelectByCriteria(critera); @@ -275,4 +276,15 @@ public class AddressbookContactDatabaseFrontend extends BaseDatabaseFrontend imp // Bad state, should not be reached throw new IllegalStateException("This should not be reached"); } + + @Override + public Storeable toStoreable (final Map map) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + throw new UnsupportedOperationException("Not supported yet: map=" + map); + } + + @Override + public String getIdName () { + // Return id column + return AddressbookContactDatabaseConstants.COLUMN_ID; + } } -- 2.39.5