@@ -148,7 +148,7 @@ In these cases, you must explicitly tell Hibernate the `BasicType` to use, via t
148
148
[[basic-type-annotation-example]]
149
149
.Using `@org.hibernate.annotations.Type`
150
150
====
151
- [source, JAVA , indent=0]
151
+ [source, java, , indent=0]
152
152
----
153
153
include::{sourcedir}/basic/ExplicitTypeTest.java[tags=basic-type-annotation-example]
154
154
----
@@ -193,7 +193,7 @@ First, we need to extend the `AbstractSingleColumnStandardBasicType` like this:
193
193
[[basic-custom-type-BitSetType-example]]
194
194
.Custom `BasicType` implementation
195
195
====
196
- [source, JAVA , indent=0]
196
+ [source, java, , indent=0]
197
197
----
198
198
include::{sourcedir}/basic/bitset/BitSetType.java[tags=basic-custom-type-BitSetType-example]
199
199
----
@@ -206,7 +206,7 @@ On the Java side, we need to use a `BitSetJavaType` instance which can be implem
206
206
[[basic-custom-type-BitSetJavaType-example]]
207
207
.Custom `JavaType` implementation
208
208
====
209
- [source, JAVA , indent=0]
209
+ [source, java, , indent=0]
210
210
----
211
211
include::{sourcedir}/basic/bitset/BitSetJavaType.java[tags=basic-bitset-example-java-type]
212
212
----
@@ -219,14 +219,14 @@ The `BasicType` must be registered, and this can be done at bootstrapping time:
219
219
[[basic-custom-type-register-BasicType-example]]
220
220
.Register a Custom `BasicType` implementation
221
221
====
222
- [source, JAVA , indent=0]
222
+ [source, java, , indent=0]
223
223
----
224
224
include::{sourcedir}/basic/bitset/BitSetTypeTest.java[tags=basic-custom-type-register-BasicType-example]
225
225
----
226
226
227
227
or using the `MetadataBuilder`
228
228
229
- [source, JAVA , indent=0]
229
+ [source, java, , indent=0]
230
230
----
231
231
include::{sourcedir}/../bootstrap/BootstrapTest.java[tags=basic-custom-type-register-BasicType-example]
232
232
----
@@ -237,7 +237,7 @@ With the new `BitSetType` being registered as `bitset`, the entity mapping looks
237
237
[[basic-custom-type-BitSetType-mapping-example]]
238
238
.Custom `BasicType` mapping
239
239
====
240
- [source, JAVA , indent=0]
240
+ [source, java, , indent=0]
241
241
----
242
242
include::{sourcedir}/basic/bitset/BitSetTypeTest.java[tags=basic-custom-type-BitSetType-mapping-example]
243
243
----
@@ -248,7 +248,7 @@ To validate this new `BasicType` implementation, we can test it as follows:
248
248
[[basic-custom-type-BitSetType-persistence-example]]
249
249
.Persisting the custom `BasicType`
250
250
====
251
- [source, JAVA , indent=0]
251
+ [source, java, , indent=0]
252
252
----
253
253
include::{sourcedir}/basic/bitset/BitSetTypeTest.java[tags=basic-custom-type-BitSetType-persistence-example]
254
254
----
@@ -259,7 +259,7 @@ When executing this unit test, Hibernate generates the following SQL statements:
259
259
[[basic-custom-type-BitSetType-persistence-sql-example]]
260
260
.Persisting the custom `BasicType`
261
261
====
262
- [source, JAVA , indent=0]
262
+ [source, java, , indent=0]
263
263
----
264
264
include::{originalextrasdir}/basic/basic-custom-type-BitSetType-persistence-sql-example.sql[]
265
265
----
@@ -275,7 +275,7 @@ The second approach is to implement the `UserType` interface.
275
275
[[basic-custom-type-BitSetUserType-example]]
276
276
.Custom `UserType` implementation
277
277
====
278
- [source, JAVA , indent=0]
278
+ [source, java, , indent=0]
279
279
----
280
280
include::{sourcedir}/basic/bitset/BitSetUserType.java[tags=basic-custom-type-BitSetUserType-example]
281
281
----
@@ -286,7 +286,7 @@ The entity mapping looks as follows:
286
286
[[basic-custom-type-BitSetUserType-mapping-example]]
287
287
.Custom `UserType` mapping
288
288
====
289
- [source, JAVA , indent=0]
289
+ [source, java, , indent=0]
290
290
----
291
291
include::{sourcedir}/basic/bitset/BitSetUserTypeTest.java[tags=basic-custom-type-BitSetUserType-mapping-example]
292
292
----
@@ -297,14 +297,14 @@ In this example, the `UserType` is registered under the `bitset` name, and this
297
297
[[basic-custom-type-register-UserType-example]]
298
298
.Register a Custom `UserType` implementation
299
299
====
300
- [source, JAVA , indent=0]
300
+ [source, java, , indent=0]
301
301
----
302
302
include::{sourcedir}/basic/bitset/BitSetUserTypeTest.java[tags=basic-custom-type-register-UserType-example]
303
303
----
304
304
305
305
or using the `MetadataBuilder`
306
306
307
- [source, JAVA , indent=0]
307
+ [source, java, , indent=0]
308
308
----
309
309
include::{sourcedir}/../bootstrap/BootstrapTest.java[tags=basic-custom-type-register-UserType-example]
310
310
----
@@ -315,7 +315,7 @@ When running the previous test case against the `BitSetUserType` entity mapping,
315
315
[[basic-custom-type-BitSetUserType-persistence-sql-example]]
316
316
.Persisting the custom `BasicType`
317
317
====
318
- [source, JAVA , indent=0]
318
+ [source, java, , indent=0]
319
319
----
320
320
include::{originalextrasdir}/basic/basic-custom-type-BitSetUserType-persistence-sql-example.sql[]
321
321
----
0 commit comments