@@ -12,7 +12,7 @@ The SprocWrapper provides and efficient and easy-to-use mechanimism for translat
12
12
13
13
Here are some examples!
14
14
15
- Using a basic types:
15
+ Using basic types:
16
16
17
17
``` java
18
18
@SProcService
@@ -26,8 +26,8 @@ public interface CustomerSProcService {
26
26
CREATE FUNCTION register_customer (p_name text , p_email text )
27
27
RETURNS int AS
28
28
$$
29
- INSERT INTO z_data .customer (c_email, c_gender )
30
- VALUES (p_email, p_gender )
29
+ INSERT INTO z_data .customer (c_name, c_email )
30
+ VALUES (p_name, p_email )
31
31
RETURNING c_id
32
32
$$
33
33
LANGUAGE ' sql' SECURITY DEFINER;
63
63
LANGUAGE ' sql' SECURITY DEFINER;
64
64
```
65
65
66
- SprocWrapper supports the following data types:
66
+ Please check [ unit/integration tests ] ( tree/master/src/test/java/de/zalando/sprocwrapper ) for more examples.
67
67
68
- | Database | Java |
68
+ The following table shows the mapping between a database type and a Java type:
69
+
70
+ | Database | Java Type |
69
71
| ---------------- | ------------------------------------------------- |
70
72
| smallint | int |
71
73
| integer | int |
@@ -84,14 +86,11 @@ SprocWrapper supports the following data types:
84
86
| time | java.sql.Timestamp |
85
87
| boolean | boolean |
86
88
| enum | java.lang.Enum |
87
- | array | java.util.List/ java.util.Set |
89
+ | array | java.util.List / java.util.Set |
88
90
| hstore | java.util.Map<java.lang.String, java.lang.String> |
89
91
90
-
91
92
Note: Sprocwrapper doesn't support functions returning arrays as a single output. If one wants to return a collection, please return a SETOF instead.
92
93
93
- Please check unit/integration tests for more examples.
94
-
95
94
Prerequisites
96
95
-------------
97
96
@@ -155,3 +154,4 @@ distributed under the License is distributed on an "AS IS" BASIS,
155
154
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
156
155
See the License for the specific language governing permissions and
157
156
limitations under the License.
157
+
0 commit comments