package org.mxchange.addressbook.database.frontend.contact;
import java.io.IOException;
+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;
import org.mxchange.jcore.contact.Contact;
import org.mxchange.jcore.contact.Gender;
import org.mxchange.jcore.criteria.searchable.SearchCriteria;
-import org.mxchange.jcore.criteria.searchable.SearchableCritera;
+import org.mxchange.jcore.criteria.searchable.SearchableCriteria;
import org.mxchange.jcore.database.frontend.BaseDatabaseFrontend;
import org.mxchange.jcore.database.result.Result;
import org.mxchange.jcore.database.storage.Storeable;
import org.mxchange.jcore.exceptions.BadTokenException;
+import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException;
import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException;
/**
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));
* Checks whether own contact is found in database
*
* @return Whether own contact is found
- * @throws java.io.IOException If any IO error occurs
- * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found
+ * @throws org.mxchange.jcore.exceptions.BadTokenException Continued throw
+ * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged
+ * @throws java.lang.NoSuchMethodException If a method cannot be found
+ * @throws java.lang.IllegalAccessException If a method is not accessible
+ * @throws java.lang.reflect.InvocationTargetException Any other problems?
*/
@Override
- public boolean isOwnContactFound () throws SQLException, IOException, BadTokenException {
+ public boolean isOwnContactFound () throws SQLException, IOException, BadTokenException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
// Get search criteria instance
- SearchableCritera critera = new SearchCriteria();
+ SearchableCriteria critera = new SearchCriteria();
// Add condition
- critera.addCriteria(AddressbookContactDatabaseConstants.COLUMN_NAME_OWN_CONTACT, true);
+ critera.addCriteria(AddressbookContactDatabaseConstants.COLUMN_OWN_CONTACT, true);
// Get result
Result<? extends Storeable> result = this.getBackend().doSelectByCriteria(critera);
// Bad state, should not be reached
throw new IllegalStateException("This should not be reached");
}
+
+ @Override
+ public Storeable toStoreable (final Map<String, String> 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;
+ }
}