@SuppressWarnings("unchecked") @Test public void testQuery1() throws Exception { Session session = getSession(); try { Map<String, Serializable> filter = new HashMap<String, Serializable>(); filter.put("username", "user_1"); filter.put("firstName", "f"); DocumentModelList list = session.query(filter); assertEquals(1, list.size()); DocumentModel docModel = list.get(0); assertNotNull(docModel); assertEquals("user_1", docModel.getProperty(SCHEMA, "username")); assertEquals("f", docModel.getProperty(SCHEMA, "firstName")); List<String> groups = (List<String>) docModel.getProperty(SCHEMA, "groups"); assertTrue(groups.isEmpty()); list = session.query(filter, null, null, true); assertEquals(1, list.size()); docModel = list.get(0); assertNotNull(docModel); assertEquals("user_1", docModel.getProperty(SCHEMA, "username")); assertEquals("f", docModel.getProperty(SCHEMA, "firstName")); groups = (List<String>) docModel.getProperty(SCHEMA, "groups"); assertEquals(2, groups.size()); assertTrue(groups.contains("members")); assertTrue(groups.contains("group_1")); } finally { session.close(); } }
@Override public synchronized Session getSession() throws DirectoryException { if (dialect == null) { initConnection(); } SQLSession session = new SQLSession(this, config, managedSQLSession); addSession(session); return session; }
SQLDirectory extends AbstractDirectory { @Override public synchronized Session getSession() throws DirectoryException { if (dialect == null) { initConnection(); } SQLSession session = new SQLSession(this, config, managedSQLSession); addSession(session); return session; } }
SQLDirectory extends AbstractDirectory { @Override public synchronized Session getSession() throws DirectoryException { if (dialect == null) { initConnection(); } SQLSession session = new SQLSession(this, config, managedSQLSession); addSession(session); return session; } SQLDirectory(SQLDirectoryDescriptor config); }
SQLDirectory extends AbstractDirectory { @Override public synchronized Session getSession() throws DirectoryException { if (dialect == null) { initConnection(); } SQLSession session = new SQLSession(this, config, managedSQLSession); addSession(session); return session; } SQLDirectory(SQLDirectoryDescriptor config); SQLDirectoryDescriptor getConfig(); Connection getConnection(); @Override String getName(); @Override String getSchema(); @Override String getParentDirectory(); @Override String getIdField(); @Override String getPasswordField(); @Override synchronized Session getSession(); Map<String, Field> getSchemaFieldMap(); List<String> getStoredFieldNames(); Table getTable(); Dialect getDialect(); boolean useNativeCase(); @Override boolean isMultiTenant(); @Override String toString(); }
SQLDirectory extends AbstractDirectory { @Override public synchronized Session getSession() throws DirectoryException { if (dialect == null) { initConnection(); } SQLSession session = new SQLSession(this, config, managedSQLSession); addSession(session); return session; } SQLDirectory(SQLDirectoryDescriptor config); SQLDirectoryDescriptor getConfig(); Connection getConnection(); @Override String getName(); @Override String getSchema(); @Override String getParentDirectory(); @Override String getIdField(); @Override String getPasswordField(); @Override synchronized Session getSession(); Map<String, Field> getSchemaFieldMap(); List<String> getStoredFieldNames(); Table getTable(); Dialect getDialect(); boolean useNativeCase(); @Override boolean isMultiTenant(); @Override String toString(); static final Log log; static final String TENANT_ID_FIELD; static final int MAX_CONNECTION_TRIES; }