Skip to content

Changed session parameters to builder pattern #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2019

Conversation

zhenlineo
Copy link
Contributor

@zhenlineo zhenlineo commented Jul 2, 2019

The new builder pattern looks like:

SessionConfig config = SessionConfig.builder()
    .withDatabase( "neo4j" )
    .withDefaultAccessMode( AccessMode.WRITE )
    .withBookmarks( bookmark1, bookmark2 )
    .build();
try ( Session session = driver.session( config ) )
{}

A syntax sugar for database name is available:

try ( Session session = driver.session( SessionConfig.forDatabase( "neo4j" ) ) )
{}

@zhenlineo zhenlineo requested a review from ali-ince July 2, 2019 14:06
Copy link
Contributor

@ali-ince ali-ince left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I'm not merging this to leave the preferred timing to you (before or after the previous PR's).

@zhenlineo zhenlineo force-pushed the 2.0-session-config branch from 38fd02e to 756197e Compare July 2, 2019 20:45
Added a shortcut to specify database name on session
@zhenlineo zhenlineo force-pushed the 2.0-session-config branch from 756197e to 98436c1 Compare July 3, 2019 08:29
@zhenlineo zhenlineo merged commit d508e3c into neo4j:2.0 Jul 3, 2019
@zhenlineo zhenlineo deleted the 2.0-session-config branch July 3, 2019 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants