/** * INTERNAL: * Create and return a session broker. * Used internally to set the Names by Class from the parent. Reduces garbage. */ protected SessionBroker(Map sessionNames) { super(new org.eclipse.persistence.sessions.DatabaseLogin()); this.sessionsByName = new HashMap<String, AbstractSession>(); this.sessionNamesByClass = sessionNames; }
/** * INTERNAL: * Create and return a session broker. * Used internally to set the Names by Class from the parent. Reduces garbage. */ protected SessionBroker(Map sessionNames) { super(new org.eclipse.persistence.sessions.DatabaseLogin()); this.sessionsByName = new HashMap<String, AbstractSession>(); this.sessionNamesByClass = sessionNames; }
/** * INTERNAL: * Create and return a session broker. * Used internally to set the Names by Class from the parent. Reduces garbage. */ protected SessionBroker(Map sessionNames) { super(new org.eclipse.persistence.sessions.DatabaseLogin()); this.sessionsByName = new HashMap<String, AbstractSession>(); this.sessionNamesByClass = sessionNames; }
/** * PUBLIC: * Create and return a session broker. * Because a session broker has multiple sessions it does not used a login. */ public SessionBroker() { super(new org.eclipse.persistence.sessions.DatabaseLogin()); this.sessionsByName = new HashMap<String, AbstractSession>(); this.sessionNamesByClass = new HashMap<Class, String>(); }
/** * PUBLIC: * Create and return a session broker. * Because a session broker has multiple sessions it does not used a login. */ public SessionBroker() { super(new org.eclipse.persistence.sessions.DatabaseLogin()); this.sessionsByName = new HashMap<String, AbstractSession>(); this.sessionNamesByClass = new HashMap<Class, String>(); }
/** * PUBLIC: * Create and return a session broker. * Because a session broker has multiple sessions it does not used a login. */ public SessionBroker() { super(new org.eclipse.persistence.sessions.DatabaseLogin()); this.sessionsByName = new HashMap<String, AbstractSession>(); this.sessionNamesByClass = new HashMap<Class, String>(); }
/** * Try to print the SQL. */ public String toString() { StringWriter writer = new StringWriter(); writer.write(Helper.getShortClassName(getClass())); writer.write("("); try { DatabaseCall call = buildCall(new DatabaseSessionImpl(new org.eclipse.persistence.sessions.DatabaseLogin())); writer.write(call.getSQLString()); } catch (Exception exception) { } writer.write(")"); return writer.toString(); } }
/** * Try to print the SQL. */ public String toString() { StringWriter writer = new StringWriter(); writer.write(Helper.getShortClassName(getClass())); writer.write("("); try { DatabaseCall call = buildCall(new DatabaseSessionImpl(new org.eclipse.persistence.sessions.DatabaseLogin())); writer.write(call.getSQLString()); } catch (Exception exception) { } writer.write(")"); return writer.toString(); } }
/** * Try to print the SQL. */ public String toString() { StringWriter writer = new StringWriter(); writer.write(Helper.getShortClassName(getClass())); writer.write("("); try { DatabaseCall call = buildCall(new DatabaseSessionImpl(new org.eclipse.persistence.sessions.DatabaseLogin())); writer.write(call.getSQLString()); } catch (Exception exception) { } writer.write(")"); return writer.toString(); } }
/** * INTERNAL: * We preserve state from each processor run by holding static references * to projects. */ public MetadataProject getMetadataProject(SEPersistenceUnitInfo puInfo) { if (! metadataProjects.containsKey(puInfo.getPersistenceUnitName())) { MetadataProject project = new MetadataProject(puInfo, new ServerSession(new Project(new DatabaseLogin())), false, false, false, false, false); metadataProjects.put(puInfo.getPersistenceUnitName(), project); return project; } else { return metadataProjects.get(puInfo.getPersistenceUnitName()); } }
/** * INTERNAL: * We preserve state from each processor run by holding static references * to projects. */ public MetadataProject getMetadataProject(SEPersistenceUnitInfo puInfo) { if (! metadataProjects.containsKey(puInfo.getPersistenceUnitName())) { MetadataProject project = new MetadataProject(puInfo, new ServerSession(new Project(new DatabaseLogin())), false, false, false, false, false); metadataProjects.put(puInfo.getPersistenceUnitName(), project); return project; } else { return metadataProjects.get(puInfo.getPersistenceUnitName()); } }
/** * INTERNAL: * Return the correct session type from the sessionConfig */ protected void prepareProjectLogin(Project project, Login login) { if (login != null) { project.setLogin(login); } else if (project.getDatasourceLogin() == null) { // dummy login that needs to be set, otherwise session creation will fail project.setLogin(new DatabaseLogin()); } else { // we read a login from the deployment xml of java, don't overwrite } }
/** * INTERNAL: * Return the correct session type from the sessionConfig */ protected void prepareProjectLogin(Project project, Login login) { if (login != null) { project.setLogin(login); } else if (project.getDatasourceLogin() == null) { // dummy login that needs to be set, otherwise session creation will fail project.setLogin(new DatabaseLogin()); } else { // we read a login from the deployment xml of java, don't overwrite } }
/** * INTERNAL: * Return the correct session type from the sessionConfig */ protected void prepareProjectLogin(Project project, Login login) { if (login != null) { project.setLogin(login); } else if (project.getDatasourceLogin() == null) { // dummy login that needs to be set, otherwise session creation will fail project.setLogin(new DatabaseLogin()); } else { // we read a login from the deployment xml of java, don't overwrite } }
/** * This method provides client with access to add a new connection pool to a EclipseLink * ServerSession. * @param poolName the name of the new pool * @param maxSize the maximum number of connections in the pool * @param minSize the minimum number of connections in the pool * @param platform the fully qualified name of the EclipseLink platform to use with this pool. * @param driverClassName the fully qualified name of the JDBC driver class * @param url the URL of the database to connect to * @param userName the user name to connect to the database with * @param password the password to connect to the database with * @exception ClassNotFoundException if any of the class names are misspelled. */ public void addNewConnectionPool(String poolName, int maxSize, int minSize, String platform, String driverClassName, String url, String userName, String password) throws ClassNotFoundException { if (ClassConstants.ServerSession_Class.isAssignableFrom(getSession().getClass())) { DatabaseLogin login = new DatabaseLogin(); login.setPlatformClassName(platform); login.setDriverClassName(driverClassName); login.setConnectionString(url); login.setUserName(userName); login.setEncryptedPassword(password); ((ServerSession)getSession()).addConnectionPool(poolName, login, minSize, maxSize); } }
/** * This method provides client with access to add a new connection pool to a EclipseLink * ServerSession. * @param poolName the name of the new pool * @param maxSize the maximum number of connections in the pool * @param minSize the minimum number of connections in the pool * @param platform the fully qualified name of the EclipseLink platform to use with this pool. * @param driverClassName the fully qualified name of the JDBC driver class * @param url the URL of the database to connect to * @param userName the user name to connect to the database with * @param password the password to connect to the database with * @exception ClassNotFoundException if any of the class names are misspelled. */ public void addNewConnectionPool(String poolName, int maxSize, int minSize, String platform, String driverClassName, String url, String userName, String password) throws ClassNotFoundException { if (ClassConstants.ServerSession_Class.isAssignableFrom(getSession().getClass())) { DatabaseLogin login = new DatabaseLogin(); login.setPlatformClassName(platform); login.setDriverClassName(driverClassName); login.setConnectionString(url); login.setUserName(userName); login.setEncryptedPassword(password); ((ServerSession)getSession()).addConnectionPool(poolName, login, minSize, maxSize); } }
/** * This method provides client with access to add a new connection pool to a EclipseLink * ServerSession. * @param poolName the name of the new pool * @param maxSize the maximum number of connections in the pool * @param minSize the minimum number of connections in the pool * @param platform the fully qualified name of the EclipseLink platform to use with this pool. * @param driverClassName the fully qualified name of the JDBC driver class * @param url the URL of the database to connect to * @param userName the user name to connect to the database with * @param password the password to connect to the database with * @exception ClassNotFoundException if any of the class names are misspelled. */ public void addNewConnectionPool(String poolName, int maxSize, int minSize, String platform, String driverClassName, String url, String userName, String password) throws ClassNotFoundException { if (ClassConstants.ServerSession_Class.isAssignableFrom(getSession().getClass())) { DatabaseLogin login = new DatabaseLogin(); login.setPlatformClassName(platform); login.setDriverClassName(driverClassName); login.setConnectionString(url); login.setUserName(userName); login.setEncryptedPassword(password); ((ServerSession)getSession()).addConnectionPool(poolName, login, minSize, maxSize); } }
if (login == null) { if (project.getLogin() == null) { project.setLogin(new DatabaseLogin());
if (login == null) { if (project.getLogin() == null) { project.setLogin(new DatabaseLogin());
public static Project loadDynamicProject(Project project, DatabaseLogin login, DynamicClassLoader dynamicClassLoader) { if (project != null) { if (login == null) { if (project.getLogin() == null) { project.setLogin(new DatabaseLogin()); } } else { project.setLogin(login); } if (project.getLogin().getPlatform() == null) { project.getLogin().setPlatform(new DatabasePlatform()); } project.getLogin().getPlatform().getConversionManager().setLoader(dynamicClassLoader); for (Iterator<?> i = project.getAliasDescriptors().values().iterator(); i.hasNext();) { ClassDescriptor descriptor = (ClassDescriptor) i.next(); if (descriptor.getJavaClass() == null) { createType(dynamicClassLoader, descriptor, project); } } project.convertClassNamesToClasses(dynamicClassLoader); } return project; }