CARVIEW |
Select Language
HTTP/2 200
date: Wed, 30 Jul 2025 07:14:34 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/neo4j/neo4j-java-driver.git
etag: W/"8d933a440cdc6199edaa8dd98fea16b5"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=oraR80LWVWnJjYHiW7nNzX561L%2FJOgkbtQIzXQ7gz7IP42WWo2Co7so9PRBS7wqlXtfm62TN332iElYRPRGoCZ7fB49G8%2FPgWZu06%2BeJI%2BjW8a9w9f7wSAbmv86%2FbntVvPwdcJ1r2ZxaZV2NroDus6lDK%2FLbWUEczsRZYUZMUWWj4y3ZfwtrJbHtRjOKrgH5%2BEnBmLRYGjYP26bOWsCokuqNY3IsghwiNj3FHum9X4gSKAUf8bTrEDfvezRi%2BYM5dUKXVu%2BO813A6dhyWQ4jIQ%3D%3D--e2xGG7I3D6Yq65p%2F--XwEYupb4U5J%2BQn0SoNrOdA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1714004375.1753859673; Path=/; Domain=github.com; Expires=Thu, 30 Jul 2026 07:14:33 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 30 Jul 2026 07:14:33 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 87C4:3CFA5:14A1C16:18E79CD:6889C659
feat(object-mapping): support mapping types with restricted access (#… · neo4j/neo4j-java-driver@26731c6 · GitHub
Copy file name to clipboardExpand all lines: driver/src/main/java/org/neo4j/driver/Value.java
Copy file name to clipboardExpand all lines: driver/src/main/java/org/neo4j/driver/internal/value/mapping/ConstructorFinder.java
Copy file name to clipboardExpand all lines: driver/src/main/java/org/neo4j/driver/internal/value/mapping/ObjectInstantiator.java
Copy file name to clipboardExpand all lines: driver/src/main/java/org/neo4j/driver/internal/value/mapping/ObjectMapper.java
Copy file name to clipboardExpand all lines: driver/src/test/java/org/neo4j/driver/ObjectMappingTests.java
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit 26731c6
authored
feat(object-mapping): support mapping types with restricted access (#1668)
The updated Object Mapping implementation attempts to make constructors with restricted access available to it. If successful, it considers them during the constructor search. However, it prefers constructors that are accessible by default when they have the same number of matched and mismatched properties.
Given the objective of providing an easy and type-safe way of accessing user-defined values in `MapAccessor`, it would would sometimes to convenient to define the target type and map to it within the same method. For example:
```java
record Movie(String title, String tagline, long released) {}
var movies = driver.executableQuery("MATCH (movie:Movie) RETURN movie")
.execute()
.records()
.stream()
.map(record -> record.get("movie").as(Movie.class))
.toList();
```
However, such Java `record` has restricted access from Object Mapping implementation perspective. This update makes it possible to map to such types.
In addition, the following bugs have been fixed:
- `null` type name was used in exception message when local `record` mapping failed
- nonexistent properties were considered as matched on nodes and relationships1 parent 891ca3f commit 26731c6Copy full SHA for 26731c6
File tree
Expand file treeCollapse file tree
5 files changed
+176
-21
lines changedFilter options
- driver/src
- main/java/org/neo4j/driver
- internal/value/mapping
- test/java/org/neo4j/driver
Expand file treeCollapse file tree
5 files changed
+176
-21
lines changeddriver/src/main/java/org/neo4j/driver/Value.java
Copy file name to clipboardExpand all lines: driver/src/main/java/org/neo4j/driver/Value.java+9-2Lines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| 19 | + | |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
| |||
724 | 725 |
| |
725 | 726 |
| |
726 | 727 |
| |
727 |
| - | |
728 |
| - | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
729 | 736 |
| |
730 | 737 |
| |
731 | 738 |
| |
|
driver/src/main/java/org/neo4j/driver/internal/value/mapping/ConstructorFinder.java
Copy file name to clipboardExpand all lines: driver/src/main/java/org/neo4j/driver/internal/value/mapping/ConstructorFinder.java+48-17Lines changed: 48 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
| 23 | + | |
| 24 | + | |
24 | 25 |
| |
25 | 26 |
| |
26 | 27 |
| |
| 28 | + | |
| 29 | + | |
27 | 30 |
| |
28 | 31 |
| |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 |
| |
30 | 37 |
| |
31 | 38 |
| |
32 | 39 |
| |
33 | 40 |
| |
34 | 41 |
| |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 | 42 |
| |
45 | 43 |
| |
46 | 44 |
| |
47 | 45 |
| |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
48 | 61 |
| |
49 | 62 |
| |
50 | 63 |
| |
| |||
66 | 79 |
| |
67 | 80 |
| |
68 | 81 |
| |
69 |
| - | |
70 |
| - | |
| 82 | + | |
71 | 83 |
| |
72 | 84 |
| |
73 | 85 |
| |
74 | 86 |
| |
75 | 87 |
| |
76 |
| - | |
77 |
| - | |
78 |
| - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
79 | 110 |
| |
80 |
| - | |
81 | 111 |
| |
82 | 112 |
| |
83 |
| - | |
| 113 | + | |
| 114 | + | |
84 | 115 |
|
driver/src/main/java/org/neo4j/driver/internal/value/mapping/ObjectInstantiator.java
Copy file name to clipboardExpand all lines: driver/src/main/java/org/neo4j/driver/internal/value/mapping/ObjectInstantiator.java+1-1Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
|
driver/src/main/java/org/neo4j/driver/internal/value/mapping/ObjectMapper.java
Copy file name to clipboardExpand all lines: driver/src/main/java/org/neo4j/driver/internal/value/mapping/ObjectMapper.java+1-1Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
|
driver/src/test/java/org/neo4j/driver/ObjectMappingTests.java
Copy file name to clipboardExpand all lines: driver/src/test/java/org/neo4j/driver/ObjectMappingTests.java+117Lines changed: 117 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
| |||
37 | 38 |
| |
38 | 39 |
| |
39 | 40 |
| |
| 41 | + | |
40 | 42 |
| |
41 | 43 |
| |
42 | 44 |
| |
| |||
189 | 191 |
| |
190 | 192 |
| |
191 | 193 |
| |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
192 | 309 |
|
You can’t perform that action at this time.
0 commit comments