You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Library to make PostgreSQL stored procedures(SProcs) available through simple Java "SProcService" interfaces including
10
+
automatic object serialization and deserialization (using typemapper and convention-over-configuration).
9
11
10
-
11
-
Library to make PostgreSQL stored procedures(SProcs) available through simple Java "SProcService" interfaces including automatic object serialization and deserialization (using typemapper and convention-over-configuration).
12
-
13
-
Supports horizontal database sharding (partition/access logic lies within application), easy use of `pg_advisory_lock` through annotations to ensure single Java node execution, configurable statement timeouts per stored procedure, and PostgreSQL types including enums and hstore.
12
+
Supports horizontal database sharding (partition/access logic lies within application), easy use of `pg_advisory_lock`
13
+
through annotations to ensure single Java node execution, configurable statement timeouts per stored procedure, and
14
+
PostgreSQL types including enums and hstore.
14
15
15
16
Usage
16
17
------------
17
18
To use SProcWrapper, add the following lines to your pom.xml:
18
19
19
20
```xml
21
+
20
22
<dependency>
21
23
<groupId>org.zalando</groupId>
22
24
<artifactId>zalando-sprocwrapper</artifactId>
@@ -27,59 +29,64 @@ To use SProcWrapper, add the following lines to your pom.xml:
27
29
Type Mapping
28
30
------------
29
31
30
-
SProcWrapper provides an efficient and easy-to-use mechanism for translating values from database to Java objects and vice-versa. It allows us to map not only primitive types, but also complex types (Java domain objects).
32
+
SProcWrapper provides an efficient and easy-to-use mechanism for translating values from database to Java objects and
33
+
vice-versa. It allows us to map not only primitive types, but also complex types (Java domain objects).
* To compile, one should use [Maven](http://maven.apache.org/)2.1.0 or above
148
+
* Java 11
149
+
* To compile, one should use [Maven](http://maven.apache.org/)3.0.0 or above
120
150
121
151
Dependencies
122
152
------------
123
153
124
-
* Spring Framework
125
-
* PostgreSQL JDBC driver ;)
126
-
* Google Guava
127
-
* and more see [pom.xml](pom.xml) for details
154
+
* Spring Framework 5.x
155
+
* PostgreSQL JDBC driver ;)
156
+
* Google Guava
157
+
158
+
See [pom.xml](pom.xml) for the full list of dependencies.
128
159
129
160
How to run integration tests
130
161
----------------------------
131
162
132
163
The provided helper script will start a PostgreSQL instance with Docker on port 5432 and run integration tests:
133
-
134
-
./test.sh
135
-
136
-
You can use the provided Vagrant box to run the script in.
164
+
```shell
165
+
./test.sh
166
+
```
137
167
138
168
Known issues
139
169
------------
140
170
141
-
* PostgreSQL JDBC driver does not honor identical type names in different schemas, this may lead to issues if typemapper is used where types are present with equal name in more than one schema (this problem is solved now with the commit [3ca94e64d6322fa91c477200bfb3719deaeac153](https://github.com/pgjdbc/pgjdbc/commit/3ca94e64d6322fa91c477200bfb3719deaeac153) to [pgjdbc](https://github.com/pgjdbc/pgjdbc/) driver);
171
+
* PostgreSQL JDBC driver does not honor identical type names in different schemas, this may lead to issues if typemapper
172
+
is used where types are present with equal name in more than one schema (this problem is solved now with the
to [pgjdbc](https://github.com/pgjdbc/pgjdbc/) driver);
142
175
* PostgreSQL domains are not supported as for now;
143
-
* PostgreSQL `hstore` type is mapped from and to `Map<String,String>`, there is no way to use `Map` of different types for now;
144
-
* Two different datasources with the same JDBC URL and different search paths might not work properly when we have types with the identical name;
145
-
* SProcWrapper relies on the search path to resolve conflicting types with the same name (right now, we are not checking the schema). If one specifies the schema of the stored procedure's return type, SProcWrapper might end up using the wrong one, because it will use the `search_path` to resolve the conflict. For more info check test: `SimpleIT.testTypeLookupBugWithSchema`;
146
-
* For integration with Spring's transaction management use the `TransactionAwareDataSourceProxy` as the data source injected into the data source provider.
176
+
* PostgreSQL `hstore` type is mapped from and to `Map<String,String>`, there is no way to use `Map` of different types
177
+
for now;
178
+
* Two different datasources with the same JDBC URL and different search paths might not work properly when we have types
179
+
with the identical name;
180
+
* SProcWrapper relies on the search path to resolve conflicting types with the same name (right now, we are not checking
181
+
the schema). If one specifies the schema of the stored procedure's return type, SProcWrapper might end up using the
182
+
wrong one, because it will use the `search_path` to resolve the conflict. For more info check
183
+
test: `SimpleIT.testTypeLookupBugWithSchema`;
184
+
* For integration with Spring's transaction management use the `TransactionAwareDataSourceProxy` as the data source
0 commit comments