/** * PUBLIC: * Add the descriptors to the session. * All persistent classes must have a descriptor registered for them with the session. * This method allows for a batch of descriptors to be added at once so that EclipseLink * can resolve the dependencies between the descriptors and perform initialization optimally. */ public void addDescriptors(Collection descriptors) { // Reset cached data, as may be invalid later on. this.lastDescriptorAccessed = null; getProject().addDescriptors(descriptors, this); }
/** * PUBLIC: * Add the descriptors to the session from the Project. * This can be used to combine the descriptors from multiple projects into a single session. * This can be called after the session has been connected as long as there are no external dependencies. */ @Override public void addDescriptors(org.eclipse.persistence.sessions.Project project) { // Reset cached data, as may be invalid later on. this.lastDescriptorAccessed = null; getProject().addDescriptors(project, this); }
/** * PUBLIC: * Merge the descriptors from another project into this one. * All persistent classes must have a descriptor registered for them with the session. * This method allows for a batch of descriptors to be added at once so that EclipseLink * can resolve the dependencies between the descriptors and perform initialization optimally. */ public void addDescriptors(Project project, DatabaseSessionImpl session) { addDescriptors(project.getDescriptors().values(), session); }
/** * PUBLIC: * Add the descriptors to the session from the Project. * This can be used to combine the descriptors from multiple projects into a single session. * This can be called after the session has been connected as long as there are no external dependencies. */ public void addDescriptors(org.eclipse.persistence.sessions.Project project) { // Reset cached data, as may be invalid later on. this.lastDescriptorAccessed = null; getProject().addDescriptors(project, this); }
/** * PUBLIC: * Merge the descriptors from another project into this one. * All persistent classes must have a descriptor registered for them with the session. * This method allows for a batch of descriptors to be added at once so that EclipseLink * can resolve the dependencies between the descriptors and perform initialization optimally. */ public void addDescriptors(Project project, DatabaseSessionImpl session) { addDescriptors(project.getDescriptors().values(), session); }
/** * PUBLIC: * Add the descriptors to the session from the Project. * This can be used to combine the descriptors from multiple projects into a single session. * This can be called after the session has been connected as long as there are no external dependencies. */ public void addDescriptors(org.eclipse.persistence.sessions.Project project) { // Reset cached data, as may be invalid later on. this.lastDescriptorAccessed = null; getProject().addDescriptors(project, this); }
/** * PUBLIC: * Add the descriptors to the session. * All persistent classes must have a descriptor registered for them with the session. * This method allows for a batch of descriptors to be added at once so that EclipseLink * can resolve the dependencies between the descriptors and perform initialization optimally. */ @Override public void addDescriptors(final Collection descriptors) { // Reset cached data, as may be invalid later on. this.lastDescriptorAccessed = null; // Bug# 429760: Add descriptors to the session when session Map exists and is not the same as in the project. if (this.descriptors != null && this.descriptors != getProject().getDescriptors()) { for (ClassDescriptor descriptor : (Collection<ClassDescriptor>) descriptors) { this.descriptors.put(descriptor.getJavaClass(), descriptor); } } getProject().addDescriptors(descriptors, this); }
/** * PUBLIC: * Add the descriptors to the session. * All persistent classes must have a descriptor registered for them with the session. * This method allows for a batch of descriptors to be added at once so that EclipseLink * can resolve the dependencies between the descriptors and perform initialization optimally. * @param descriptors The descriptors to be added to the session and project. */ @Override public void addDescriptors(final Collection descriptors) { // Reset cached data, as may be invalid later on. this.lastDescriptorAccessed = null; // Bug# 429760: Add descriptors to the session when session Map exists and is not the same as in the project. if (this.descriptors != null && this.descriptors != getProject().getDescriptors()) { for (ClassDescriptor descriptor : (Collection<ClassDescriptor>) descriptors) { this.descriptors.put(descriptor.getJavaClass(), descriptor); } } getProject().addDescriptors(descriptors, this); }
/** * INTERNAL: * Return a DatabaseSession object from it's config object using either * the project classes or project XML files. */ protected DatabaseSessionImpl createSession(DatabaseSessionConfig sessionConfig, Login login) { Project primaryProject; if (sessionConfig.getPrimaryProject() != null) { primaryProject = loadProjectConfig(sessionConfig.getPrimaryProject()); } else { primaryProject = new Project();// Build a session from an empty project } prepareProjectLogin(primaryProject, login); DatabaseSessionImpl sessionToReturn = getSession(sessionConfig, primaryProject); // Append descriptors from all subsequent project.xml and project classes // to the mainProject if (sessionConfig.getAdditionalProjects() != null) { Enumeration additionalProjects = sessionConfig.getAdditionalProjects().elements(); while (additionalProjects.hasMoreElements()) { Project subProject = loadProjectConfig((ProjectConfig)additionalProjects.nextElement()); primaryProject.addDescriptors(subProject, sessionToReturn); } } return sessionToReturn; }
/** * INTERNAL: * Return a DatabaseSession object from it's config object using either * the project classes or project XML files. */ protected DatabaseSessionImpl createSession(DatabaseSessionConfig sessionConfig, Login login) { Project primaryProject; if (sessionConfig.getPrimaryProject() != null) { primaryProject = loadProjectConfig(sessionConfig.getPrimaryProject()); } else { primaryProject = new Project();// Build a session from an empty project } prepareProjectLogin(primaryProject, login); DatabaseSessionImpl sessionToReturn = getSession(sessionConfig, primaryProject); // Append descriptors from all subsequent project.xml and project classes // to the mainProject if (sessionConfig.getAdditionalProjects() != null) { Enumeration<ProjectConfig> additionalProjects = sessionConfig.getAdditionalProjects().elements(); while (additionalProjects.hasMoreElements()) { Project subProject = loadProjectConfig(additionalProjects.nextElement()); primaryProject.addDescriptors(subProject, sessionToReturn); } } return sessionToReturn; }
/** * INTERNAL: * Return a DatabaseSession object from it's config object using either * the project classes or project XML files. */ protected DatabaseSessionImpl createSession(DatabaseSessionConfig sessionConfig, Login login) { Project primaryProject; if (sessionConfig.getPrimaryProject() != null) { primaryProject = loadProjectConfig(sessionConfig.getPrimaryProject()); } else { primaryProject = new Project();// Build a session from an empty project } prepareProjectLogin(primaryProject, login); DatabaseSessionImpl sessionToReturn = getSession(sessionConfig, primaryProject); // Append descriptors from all subsequent project.xml and project classes // to the mainProject if (sessionConfig.getAdditionalProjects() != null) { Enumeration<ProjectConfig> additionalProjects = sessionConfig.getAdditionalProjects().elements(); while (additionalProjects.hasMoreElements()) { Project subProject = loadProjectConfig(additionalProjects.nextElement()); primaryProject.addDescriptors(subProject, sessionToReturn); } } return sessionToReturn; }