neo4j-java-driver 0.3.5-java → 1.7.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jruby/neo4j/driver.rb +3 -1
- data/jruby/neo4j/driver/ext/config_converter.rb +2 -4
- data/jruby/neo4j/driver/ext/exception_checkable.rb +13 -2
- data/jruby/neo4j/driver/ext/exception_mapper.rb +1 -8
- data/jruby/neo4j/driver/ext/{map_accessor.rb → internal_entity.rb} +6 -2
- data/jruby/neo4j/driver/ext/internal_keys.rb +15 -0
- data/jruby/neo4j/driver/ext/internal_record.rb +10 -2
- data/jruby/neo4j/driver/ext/internal_statement_result.rb +2 -1
- data/jruby/neo4j/driver/ext/map_converter.rb +1 -1
- data/jruby/neo4j/driver/ext/ruby_converter.rb +1 -1
- data/lib/neo4j/driver/exceptions/neo4j_exception.rb +1 -2
- data/lib/neo4j/driver/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e81fce8c0fbbb53c241d69d389d080b937a21196083c84d8af4aa08d063d4def
|
4
|
+
data.tar.gz: 98ccbc63152681cba9b0abfacf8f4411a407f35dbdae043090aec840b0d508e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a96853c233c87cb214a655f26ef1eea9207585b4a3a3836719fd5e033572753db5f89df6f69f4396b46c9f543ac9fce572f887c194008bb0b9299dedd2550c2c
|
7
|
+
data.tar.gz: dc69debcd6fdfcd018c367f0b72da7c97d0a04a7685243f20b50539cac0e18edc188bf27056cb96fd33968576dddf87e6857e7940bbdbb179fbe3366b45e723a
|
data/jruby/neo4j/driver.rb
CHANGED
@@ -9,6 +9,8 @@ module Neo4j
|
|
9
9
|
module Driver
|
10
10
|
include_package 'org.neo4j.driver.v1'
|
11
11
|
|
12
|
+
Record = Java::OrgNeo4jDriverInternal::InternalRecord
|
13
|
+
StatementResult = Java::OrgNeo4jDriverInternal::InternalStatementResult
|
12
14
|
Transaction = Java::OrgNeo4jDriverInternal::ExplicitTransaction
|
13
15
|
|
14
16
|
module Net
|
@@ -40,7 +42,7 @@ end
|
|
40
42
|
Loader.load
|
41
43
|
|
42
44
|
Java::OrgNeo4jDriverInternal::InternalDriver.prepend Neo4j::Driver::Ext::InternalDriver
|
43
|
-
Java::OrgNeo4jDriverInternal::InternalEntity.include Neo4j::Driver::Ext::
|
45
|
+
Java::OrgNeo4jDriverInternal::InternalEntity.include Neo4j::Driver::Ext::InternalEntity
|
44
46
|
Java::OrgNeo4jDriverInternal::InternalNode.prepend Neo4j::Driver::Ext::InternalNode
|
45
47
|
Java::OrgNeo4jDriverInternal::InternalPath.include Neo4j::Driver::Ext::StartEndNaming
|
46
48
|
Java::OrgNeo4jDriverInternal::InternalPath::SelfContainedSegment.include Neo4j::Driver::Ext::StartEndNaming
|
@@ -17,10 +17,8 @@ module Neo4j
|
|
17
17
|
unit = nil
|
18
18
|
case key.to_s
|
19
19
|
when 'encryption'
|
20
|
-
unless value
|
21
|
-
|
22
|
-
value = nil
|
23
|
-
end
|
20
|
+
method = :without_encryption unless value
|
21
|
+
value = nil
|
24
22
|
when 'timeout'
|
25
23
|
value = java.time.Duration.ofMillis(Driver::Internal::DurationNormalizer.milliseconds(value))
|
26
24
|
when /time(out)?$/
|
@@ -20,8 +20,19 @@ module Neo4j
|
|
20
20
|
|
21
21
|
def reverse_check
|
22
22
|
yield
|
23
|
-
rescue
|
24
|
-
raise(e.cause ||
|
23
|
+
rescue Neo4j::Driver::Exceptions::ServiceUnavailableException => e
|
24
|
+
raise(throwable(e.cause) || org.neo4j.driver.v1.exceptions.ServiceUnavailableException.new(e.message))
|
25
|
+
rescue Neo4j::Driver::Exceptions::Neo4jException,
|
26
|
+
Neo4j::Driver::Exceptions::NoSuchRecordException,
|
27
|
+
Neo4j::Driver::Exceptions::UntrustedServerException,
|
28
|
+
Neo4j::Driver::Exceptions::IllegalStateException => e
|
29
|
+
raise(throwable(e.cause) || e)
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def throwable(e)
|
35
|
+
e if e.is_a? Java::JavaLang::Throwable
|
25
36
|
end
|
26
37
|
end
|
27
38
|
end
|
@@ -23,14 +23,7 @@ module Neo4j
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def arguments
|
26
|
-
[code, message,
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.reverse_exception_class(exception)
|
30
|
-
case exception
|
31
|
-
when Neo4j::Driver::Exceptions::ServiceUnavailableException
|
32
|
-
ServiceUnavailableException
|
33
|
-
end
|
26
|
+
[code, message, suppressed.map(&method(:mapped_exception))]
|
34
27
|
end
|
35
28
|
|
36
29
|
private
|
@@ -3,14 +3,18 @@
|
|
3
3
|
module Neo4j
|
4
4
|
module Driver
|
5
5
|
module Ext
|
6
|
-
module
|
6
|
+
module InternalEntity
|
7
7
|
include MapConverter
|
8
8
|
|
9
|
-
alias properties
|
9
|
+
alias properties to_h
|
10
10
|
|
11
11
|
def [](key)
|
12
12
|
get(key.to_s).as_ruby_object
|
13
13
|
end
|
14
|
+
|
15
|
+
def ==(other)
|
16
|
+
java_method(:isEqual).call(other)
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -4,12 +4,20 @@ module Neo4j
|
|
4
4
|
module Driver
|
5
5
|
module Ext
|
6
6
|
module InternalRecord
|
7
|
+
include MapConverter
|
8
|
+
include InternalKeys
|
9
|
+
|
7
10
|
def values
|
8
11
|
java_send(:values).map(&:as_ruby_object)
|
9
12
|
end
|
10
13
|
|
11
|
-
|
12
|
-
|
14
|
+
def [](key)
|
15
|
+
case key
|
16
|
+
when Integer
|
17
|
+
java_method(:get, [Java::int]).call(key)
|
18
|
+
else
|
19
|
+
java_method(:get, [java.lang.String]).call(key.to_s)
|
20
|
+
end.as_ruby_object
|
13
21
|
end
|
14
22
|
|
15
23
|
def first
|
@@ -6,8 +6,9 @@ module Neo4j
|
|
6
6
|
module InternalStatementResult
|
7
7
|
include Enumerable
|
8
8
|
include ExceptionCheckable
|
9
|
+
include InternalKeys
|
9
10
|
|
10
|
-
%i[has_next? next
|
11
|
+
%i[has_next? next single consume summary peek].each do |method|
|
11
12
|
define_method(method) do |*args, &block|
|
12
13
|
check { super(*args, &block) }
|
13
14
|
end
|
@@ -11,7 +11,7 @@ module Neo4j
|
|
11
11
|
when Java::OrgNeo4jDriverInternalTypes::TypeConstructor::LIST
|
12
12
|
values(&:itself).map(&:as_ruby_object)
|
13
13
|
when Java::OrgNeo4jDriverInternalTypes::TypeConstructor::MAP
|
14
|
-
|
14
|
+
to_h
|
15
15
|
when Java::OrgNeo4jDriverInternalTypes::TypeConstructor::DATE
|
16
16
|
date = as_local_date
|
17
17
|
Date.new(date.year, date.month_value, date.day_of_month)
|
@@ -4,12 +4,11 @@ module Neo4j
|
|
4
4
|
module Driver
|
5
5
|
module Exceptions
|
6
6
|
class Neo4jException < RuntimeError
|
7
|
-
attr_reader :code, :
|
7
|
+
attr_reader :code, :suppressed
|
8
8
|
|
9
9
|
def initialize(*args)
|
10
10
|
@code = args.shift if args.count > 1
|
11
11
|
message = args.shift
|
12
|
-
@cause = args.shift
|
13
12
|
@suppressed = args.shift
|
14
13
|
super(message)
|
15
14
|
end
|
data/lib/neo4j/driver/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-java-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.7.3
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Heinrich Klobuczek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -218,12 +218,13 @@ files:
|
|
218
218
|
- jruby/neo4j/driver/ext/graph_database.rb
|
219
219
|
- jruby/neo4j/driver/ext/internal/summary/internal_result_summary.rb
|
220
220
|
- jruby/neo4j/driver/ext/internal_driver.rb
|
221
|
+
- jruby/neo4j/driver/ext/internal_entity.rb
|
222
|
+
- jruby/neo4j/driver/ext/internal_keys.rb
|
221
223
|
- jruby/neo4j/driver/ext/internal_node.rb
|
222
224
|
- jruby/neo4j/driver/ext/internal_record.rb
|
223
225
|
- jruby/neo4j/driver/ext/internal_relationship.rb
|
224
226
|
- jruby/neo4j/driver/ext/internal_statement_result.rb
|
225
227
|
- jruby/neo4j/driver/ext/logger.rb
|
226
|
-
- jruby/neo4j/driver/ext/map_accessor.rb
|
227
228
|
- jruby/neo4j/driver/ext/map_converter.rb
|
228
229
|
- jruby/neo4j/driver/ext/neo_converter.rb
|
229
230
|
- jruby/neo4j/driver/ext/network_session.rb
|