Skip to content

Commit

Permalink
XNeo4jDriver, minor improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-brandizi committed Mar 14, 2024
1 parent 31c8c68 commit 7a49daf
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.concurrent.CompletionStage;

import org.apache.commons.lang3.ObjectUtils;
import org.neo4j.driver.AuthToken;
import org.neo4j.driver.BaseSession;
import org.neo4j.driver.BookmarkManager;
Expand All @@ -23,7 +24,7 @@
* some utilities, such as keeping a default DB name and using it with a
* {@link #defaultSessionConfig()}.
*
* TODO:
* TODO: write tests.
*
* @author Marco Brandizi
* <dl><dt>Date:</dt><dd>13 Mar 2024</dd></dl>
Expand Down Expand Up @@ -85,7 +86,8 @@ public SessionConfig defaultSessionConfig ()
public SessionConfig.Builder sessionConfigBuilder ()
{
SessionConfig.Builder builder = SessionConfig.builder ();
if ( databaseName != null ) builder = builder.withDatabase ( databaseName );
if ( !ObjectUtils.isEmpty ( databaseName ) )
builder = builder.withDatabase ( databaseName );
return builder;
}

Expand Down

0 comments on commit 7a49daf

Please sign in to comment.