org.eclipse.persistence.sessions.DatabaseLogin Java Examples

The following examples show how to use org.eclipse.persistence.sessions.DatabaseLogin. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KradEclipseLinkCustomizer.java    From rice with Educational Community License v2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void customize(Session session) throws Exception {
    String sessionName = session.getName();

    // double-checked locking on ConcurrentMap
    List<Sequence> sequences = sequenceMap.get(sessionName);
    if (sequences == null) {
        sequences = sequenceMap.putIfAbsent(sessionName, loadSequences(session));
        if (sequences == null) {
            sequences = sequenceMap.get(sessionName);
        }
    }

    loadQueryCustomizers(session);

    DatabaseLogin login = session.getLogin();
    for (Sequence sequence : sequences) {
        login.addSequence(sequence);
    }

    handleDescriptorModifications(session);

}