@Test public void testColumnCreation() throws Exception { deployContrib("org.nuxeo.ecm.directory.sql.tests", "test-sql-directories-alteration-config.xml"); AbstractDirectory dirtmp1 = null; AbstractDirectory dirtmp2 = null; try { dirtmp1 = (AbstractDirectory) getDirectory("tmpdirectory1"); assertNotNull(dirtmp1); Session session = dirtmp1.getSession(); String schema1 = "tmpschema1"; DocumentModel entry = BaseSession.createEntryModel(null, schema1, null, null); entry.setProperty(schema1, "id", "john"); entry.setProperty(schema1, "label", "monLabel"); assertNull(session.getEntry("john")); entry = session.createEntry(entry); assertEquals("john", entry.getId()); assertNotNull(session.getEntry("john")); dirtmp2 = (AbstractDirectory) getDirectory("tmpdirectory2"); assertNotNull(dirtmp2); session = dirtmp2.getSession(); assertNotNull(session.getEntry("john")); } finally { if (dirtmp1 != null) { dirtmp1.shutdown(); } if (dirtmp2 != null) { dirtmp2.shutdown(); } } }
@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; }