Skip to content

Commit 9995a82

Browse files
author
Zhen
committed
Added license header and changed to java 7
1 parent 1656cb4 commit 9995a82

22 files changed

+438
-72
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

driver/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,6 @@
9393

9494
<build>
9595
<plugins>
96-
<plugin>
97-
<groupId>com.mycila</groupId>
98-
<artifactId>license-maven-plugin</artifactId>
99-
<configuration>
100-
<header>../driver/src/main/resources/license-header.txt</header>
101-
<mapping>
102-
<java>SLASHSTAR_STYLE</java>
103-
</mapping>
104-
</configuration>
105-
</plugin>
10696
<plugin>
10797
<artifactId>maven-compiler-plugin</artifactId>
10898
<version>2.3.2</version>

examples/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,6 @@
123123
</execution>
124124
</executions>
125125
</plugin>
126-
<plugin>
127-
<groupId>org.apache.maven.plugins</groupId>
128-
<artifactId>maven-compiler-plugin</artifactId>
129-
<configuration>
130-
<source>1.8</source>
131-
<target>1.8</target>
132-
</configuration>
133-
</plugin>
134126
</plugins>
135127
</build>
136128

examples/src/main/java/org/neo4j/docs/driver/AutocommitTransactionExample.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (c) 2002-2017 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
119
package org.neo4j.docs.driver;
220

321
// tag::autocommit-transaction-import[]

examples/src/main/java/org/neo4j/docs/driver/BaseApplication.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (c) 2002-2017 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
119
package org.neo4j.docs.driver;
220

321

examples/src/main/java/org/neo4j/docs/driver/BasicAuthExample.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (c) 2002-2017 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
119
package org.neo4j.docs.driver;
220

321
// tag::basic-auth-import[]

examples/src/main/java/org/neo4j/docs/driver/ConfigConnectionTimeoutExample.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (c) 2002-2017 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
119
package org.neo4j.docs.driver;
220

321
// tag::config-connection-timeout-import[]

examples/src/main/java/org/neo4j/docs/driver/ConfigMaxRetryTimeExample.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (c) 2002-2017 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
119
package org.neo4j.docs.driver;
220

321
// tag::config-max-retry-time-import[]

examples/src/main/java/org/neo4j/docs/driver/ConfigTrustExample.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (c) 2002-2017 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
119
package org.neo4j.docs.driver;
220

321
// tag::config-trust-import[]

examples/src/main/java/org/neo4j/docs/driver/ConfigUnencryptedExample.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (c) 2002-2017 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
119
package org.neo4j.docs.driver;
220

321
// tag::config-unencrypted-import[]

examples/src/main/java/org/neo4j/docs/driver/CustomAuthExample.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1+
/*
2+
* Copyright (c) 2002-2017 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
119
package org.neo4j.docs.driver;
220

321
// tag::custom-auth-import[]
22+
import java.util.Map;
23+
424
import org.neo4j.driver.v1.AuthTokens;
525
import org.neo4j.driver.v1.Driver;
626
import org.neo4j.driver.v1.GraphDatabase;
7-
8-
import java.util.Map;
927
// end::custom-auth-import[]
1028

1129
public class CustomAuthExample implements AutoCloseable

examples/src/main/java/org/neo4j/docs/driver/CypherErrorExample.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1+
/*
2+
* Copyright (c) 2002-2017 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
119
package org.neo4j.docs.driver;
220

321
// tag::cypher-error-import[]
422

523
import org.neo4j.driver.v1.Session;
624
import org.neo4j.driver.v1.StatementResult;
725
import org.neo4j.driver.v1.Transaction;
26+
import org.neo4j.driver.v1.TransactionWork;
827
import org.neo4j.driver.v1.exceptions.ClientException;
928

1029
import static org.neo4j.driver.v1.Values.parameters;
@@ -18,11 +37,18 @@ public CypherErrorExample(String uri, String user, String password)
1837
}
1938

2039
// tag::cypher-error[]
21-
public int getEmployeeNumber(String name)
40+
public int getEmployeeNumber(final String name)
2241
{
2342
try (Session session = driver.session())
2443
{
25-
return session.readTransaction((tx) -> selectEmployee(tx, name));
44+
return session.readTransaction( new TransactionWork<Integer>()
45+
{
46+
@Override
47+
public Integer execute( Transaction tx )
48+
{
49+
return CypherErrorExample.this.selectEmployee( tx, name );
50+
}
51+
} );
2652
}
2753
}
2854

examples/src/main/java/org/neo4j/docs/driver/DriverLifecycleExample.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (c) 2002-2017 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
119
package org.neo4j.docs.driver;
220

321
// tag::driver-lifecycle-import[]

examples/src/main/java/org/neo4j/docs/driver/HelloWorld.java

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
/**
1+
/*
22
* Copyright (c) 2002-2017 "Neo Technology,"
33
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4-
* <p>
4+
*
55
* This file is part of Neo4j.
6-
* <p>
6+
*
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
* <p>
11-
* http://www.apache.org/licenses/LICENSE-2.0
12-
* <p>
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
*/
19-
2019
package org.neo4j.docs.driver;
2120

2221
// tag::hello-world-import[]
@@ -26,6 +25,8 @@
2625
import org.neo4j.driver.v1.GraphDatabase;
2726
import org.neo4j.driver.v1.Session;
2827
import org.neo4j.driver.v1.StatementResult;
28+
import org.neo4j.driver.v1.Transaction;
29+
import org.neo4j.driver.v1.TransactionWork;
2930

3031
import static org.neo4j.driver.v1.Values.parameters;
3132
// end::hello-world-import[]
@@ -46,18 +47,22 @@ public void close() throws Exception
4647
driver.close();
4748
}
4849

49-
public void printGreeting(String message)
50+
public void printGreeting(final String message)
5051
{
5152
try (Session session = driver.session())
5253
{
53-
String greeting = session.writeTransaction((tx) ->
54+
String greeting = session.writeTransaction( new TransactionWork<String>()
5455
{
55-
StatementResult result = tx.run("CREATE (a:Greeting) " +
56-
"SET a.message = $message " +
57-
"RETURN a.message + ', from node ' + id(a)",
58-
parameters("message", message));
59-
return result.single().get(0).asString();
60-
});
56+
@Override
57+
public String execute( Transaction tx )
58+
{
59+
StatementResult result = tx.run( "CREATE (a:Greeting) " +
60+
"SET a.message = $message " +
61+
"RETURN a.message + ', from node ' + id(a)",
62+
parameters( "message", message ) );
63+
return result.single().get( 0 ).asString();
64+
}
65+
} );
6166
System.out.println(greeting);
6267
}
6368
}

0 commit comments

Comments
 (0)