Skip to content

Commit f3c6c19

Browse files
committed
HHH-19619 - Add TeradataDialect
1 parent 97a0c68 commit f3c6c19

File tree

1 file changed

+3
-379
lines changed

1 file changed

+3
-379
lines changed

whats-new.adoc

Lines changed: 3 additions & 379 deletions
Original file line numberDiff line numberDiff line change
@@ -10,383 +10,7 @@ Describes the new features and capabilities added to Hibernate ORM in 7.1.
1010

1111
If migrating from earlier versions, be sure to also check out the link:{migrationGuide}[Migration Guide] for discussion of impactful changes.
1212

13-
[[relicense]]
14-
== Apache License
13+
[[Teradata]]
14+
== TeradataDialect
1515

16-
Starting with 7.0, Hibernate ORM will be licensed under the Apache License 2.0.
17-
18-
Details can be seen at https://hibernate.atlassian.net/browse/HHH-19145.
19-
20-
As part of this effort, the Hibernate team reached out to the authors of
21-
"non-trivial" contributions to request permission to relicense their
22-
work under the Apache License. The response was overwhelming positive, although
23-
we never heard back from some contributors and another explicitly disagreed.
24-
This required a few actions on our part:
25-
26-
* Dropping `hibernate-ucp` - see https://hibernate.atlassian.net/browse/HHH-19162
27-
* Dropping `TeradataDialect` - see https://hibernate.atlassian.net/browse/HHH-19057
28-
29-
[[java-17]]
30-
== Java 17
31-
32-
Java 17 is the new baseline Java version.
33-
34-
35-
[[jpa-32]]
36-
== Jakarta Persistence 3.2
37-
38-
7.0 migrates to Jakarta Persistence 3.2, which is fairly disruptive.
39-
See this https://in.relation.to/2024/04/01/jakarta-persistence-3/[blog post] for a good discussion of the changes.
40-
41-
- https://ci.hibernate.org/view/ORM/job/hibernate-orm-tck-3.2/job/wip%252F7.0/24/[TCK Results] with Java 17
42-
- https://ci.hibernate.org/view/ORM/job/hibernate-orm-tck-3.2/job/wip%252F7.0/25/[TCK Results] with Java 21
43-
44-
45-
[[hibernate-models]]
46-
== Hibernate Models
47-
48-
For many years Hibernate has used the Hibernate Commons Annotations (HCANN) library for handling various low-level tasks
49-
related to understanding the structure of an application domain model, reading annotations and weaving in XML
50-
mapping documents.
51-
The https://github.com/hibernate/hibernate-models[Hibernate Models] project was developed to be a better alternative
52-
to HCANN.
53-
7.0 uses Hibernate Models in place of HCANN.
54-
55-
[[soft-delete-timestamp]]
56-
== @SoftDelete with TIMESTAMP
57-
58-
Soft-delete now supports the strategy of tracking the timestamp at which the soft-delete occurred,
59-
in addition to the previous truth-based strategies.
60-
See the link:{userGuideBase}#soft-delete[User Guide] for details.
61-
62-
[[embedded-column-naming]]
63-
== @EmbeddedColumnNaming
64-
65-
A long-requested feature for both Hibernate and Jakarta Persistence has been the ability to
66-
define a prefix for the names of columns associated with an embedded value.
67-
68-
7.0 adds support for this using the new `@EmbeddedColumnNaming` annotation. The annotation
69-
accepts a format pattern, so is more flexible than just a prefix.
70-
71-
[source,java]
72-
----
73-
@Embeddable
74-
class Address {
75-
String street;
76-
String city;
77-
...
78-
}
79-
80-
@Entity
81-
class Person {
82-
...
83-
@Embedded
84-
@EmbeddedColumnNaming("home_%")
85-
Address homeAddress;
86-
87-
@Embedded
88-
@EmbeddedColumnNaming("work_%")
89-
Address workAddress;
90-
}
91-
----
92-
93-
[NOTE]
94-
====
95-
This feature is considered incubating.
96-
====
97-
98-
See the link:{userGuideBase}#embeddable-column-naming[User Guide] for details.
99-
100-
101-
[[NamedEntityGraph]]
102-
== @NamedEntityGraph
103-
104-
A new annotation (`@org.hibernate.annotations.NamedEntityGraph`) has been added to allow
105-
specifying a named entity-graph using Hibernate's ability to parse a string representation of the graph.
106-
107-
108-
[source,java]
109-
----
110-
@Entity
111-
@NamedEntityGraph( graph="title, isbn, author(name, phoneNumber)" )
112-
class Book {
113-
// ...
114-
}
115-
----
116-
117-
118-
See `org.hibernate.graph.GraphParser` for details on the syntax and the
119-
link:{userGuideBase}#fetching-strategies-dynamic-fetching-entity-graph-parsing-annotation[User Guide] for additional details.
120-
121-
122-
[[session-find-multiple]]
123-
== findMultiple() and getMultiple()
124-
125-
The new operations `Session.findMultiple()` and `StatelessSession.getMultiple()` provide a convenient way to fetch a batch of entities by id.
126-
Combined with the `BatchSize` option, allows breaking up the JDBC calls into "batches".
127-
128-
129-
[[operation-options]]
130-
== FindOption, LockOption, RefreshOption
131-
132-
As a more typesafe replacement for hints, Jakarta Persistence now allows for "option objects" which indicate these hints. Not only is it more typesafe, but also more concise - a double win!
133-
134-
These "option objects" come in 3 flavors depending on what operation is being performed -
135-
136-
FindOption:: Used to indicate options for find operations :
137-
* `Session.find`
138-
* `Session.findMultiple`
139-
* etc
140-
LockOption:: Used to indicate options for `Session.lock`
141-
RefreshOption:: Used to indicate options for `Session.refresh`
142-
143-
Each of these are interfaces. Jakarta Persistence does provide some built-in options:
144-
145-
CacheRetrieveMode:: Is now a `FindOption`.
146-
CacheStoreMode:: Is now a `FindOption` and a `RefreshOption`.
147-
LockModeType:: Is now a `FindOption` and a `RefreshOption`.
148-
Timeout (new):: Is a `FindOption`, a `RefreshOption` and a `LockOption`. See also `org.hibernate.Timeouts` for some magic values.
149-
PessimisticLockScope:: Is now a `FindOption`, a `RefreshOption` and a `LockOption`
150-
151-
Hibernate provides a few additional options:
152-
153-
ReadOnlyMode (new):: Is a `FindOption` which indicates whether the entities and collections being loaded should be considered read-only.
154-
EnabledFetchProfile (new):: Is a `FindOption` indicating a fetch-profile to be enabled for the find operation.
155-
LockMode:: Is now a `FindOption` and a `RefreshOption` (expanded version of JPA's `LockModeType`).
156-
CacheMode:: Is now a `FindOption`.
157-
BatchSize (new):: Is now a `FindOption`.
158-
159-
160-
All operations which accept options (which previously accepted hints) accept a varargs grouping of them. E.g.
161-
162-
====
163-
[source, java, indent=0]
164-
----
165-
Book loaded = session.find(
166-
Book.class,
167-
1,
168-
LockMode.PESSIMISTIC_WRITE,
169-
Timeouts.NO_WAIT,
170-
new EnabledFetchProfile("with-authors")
171-
);
172-
----
173-
====
174-
175-
176-
[[QuerySpecification]]
177-
== QuerySpecification, Restriction, and Range
178-
179-
A new API has been added for incremental definition of a query, with support for selections -
180-
181-
====
182-
[source, java, indent=0]
183-
----
184-
SelectionQuery<Book> qry = SelectionSpecification.create(
185-
Book.class,
186-
"from Book"
187-
).restrict(
188-
Restriction.restrict(
189-
Book_.suggestedCost,
190-
Range.closed(10.00, 19.99)
191-
)
192-
).sort(
193-
Order.asc(Book_.suggestedCost)
194-
).createQuery(session);
195-
----
196-
====
197-
198-
as well as mutations -
199-
200-
====
201-
[source, java, indent=0]
202-
----
203-
MutationQuery<Book> qry = MutationSpecification.create(
204-
Book.class,
205-
"delete Book"
206-
).restrict(
207-
Restriction.restrict(
208-
Book_.suggestedCost,
209-
Range.closed(10.00, 19.99)
210-
)
211-
).createQuery(session);
212-
----
213-
====
214-
215-
[NOTE]
216-
====
217-
This feature is considered incubating.
218-
====
219-
220-
See the link:{userGuideBase}#QuerySpecification[User Guide] for details.
221-
222-
223-
[[session-managed-entities]]
224-
== Direct access to first-level cache
225-
226-
The new operation `Session.getManagedEntities()` allows the application to iterate over all entities in the first-level cache, or over all entities of a given type.
227-
228-
[NOTE]
229-
====
230-
This feature is considered incubating.
231-
====
232-
233-
234-
[[metamode-param-binding]]
235-
== Use of metamodel in query parameter binding
236-
237-
When an argument to a query parameter is of ambiguous type, the static metamodel may now be used to disambiguate.
238-
239-
[source,java]
240-
session.createSelectionQuery("from Thing where uniqueKey = ?1")
241-
.setParameter(1, key, Thing_.uniqueKey.getType())
242-
.getSingleResult();
243-
244-
245-
[[enum-checks]]
246-
== Converted Enums and Check Constraints
247-
248-
Hibernate previously added support for generating check constraints for enums mapped using `@Enumerated`
249-
as part of schema generation. 7.0 adds the same capability for enums mapped using an `AttributeConverter`,
250-
by asking the converter to convert all the enum constants on start up.
251-
252-
253-
[[json-xml-functions]]
254-
== JSON and XML functions
255-
256-
Support for most of the JSON and XML functions that the SQL standard specifies was added to HQL/Criteria.
257-
The implementations retain the SQL standard semantics and will throw an error if emulation on a database is impossible.
258-
259-
New functions include:
260-
261-
* construction functions like `json_array()`, `json_object()`, `xmlelement()` and `xmlforest()`
262-
* query functions like `json_value()`, `json_query()` and `xmlquery()`
263-
* aggregation functions like `json_agg()`, `json_object_agg()` and `xmlagg()`
264-
* manipulation functions like `json_set()`, `json_mergepatch()`
265-
* many others
266-
267-
268-
[[set-returning-functions]]
269-
== Set-returning Functions
270-
271-
A set-returning function is a new type of function that can return rows and is exclusive to the `from` clause.
272-
The concept is known in many different database SQL dialects and is sometimes referred to as table valued function or table function.
273-
274-
Custom set-returning functions can be registered via a `FunctionContributor`.
275-
Out-of-the-box, some common set-returning functions are already supported or emulated
276-
277-
* `unnest()` - allows to turn an array into rows
278-
* `generate_series()` - can be used to create a series of values as rows
279-
* `json_table()` - turns a JSON document into rows
280-
* `xmltable()` - turns an XML document into rows
281-
282-
283-
[[any-discriminator]]
284-
== @AnyDiscriminatorImplicitValues
285-
286-
The new `@AnyDiscriminatorImplicitValues` offers 2 related improvements for the mapping of discriminator values
287-
for `@Any` and `ManyToAny` associations.
288-
289-
First, it allows control over how Hibernate determines the discriminator value to store in the database for
290-
implicit discriminator mappings. Historically, Hibernate would always use the full name of the associated
291-
entity.
292-
293-
Second, it allows mixing of explicit and implicit value strategies.
294-
295-
[NOTE]
296-
====
297-
This feature is considered incubating.
298-
====
299-
300-
See the link:{userGuideBase}#associations-any[User Guide] for details.
301-
302-
303-
[[stateless-session-multiple]]
304-
== StatelessSession and Batch Operations
305-
306-
`StatelessSession` now supports explicit batch operations via `insertMultiple()`, `updateMultiple()`, or `deleteMultiple()`.
307-
308-
[NOTE]
309-
====
310-
This feature is considered incubating.
311-
====
312-
313-
314-
[[stateless-session-cache]]
315-
== StatelessSession and Second Level Cache
316-
317-
Previously, stateless sessions never interacted with the second-level cache.
318-
This reflected their original intended role in bulk processing.
319-
With the advent of Jakarta Data and Hibernate Data Repositories, the responsibilities of `StatelessSession` have now expanded, and this behavior is no longer appropriate.
320-
Thus, a stateless session now makes use of the second-level cache by default.
321-
322-
See the link:{migrationGuide}#stateless-session-cache[Migration Guide] for additional details.
323-
324-
325-
326-
[[stateless-session-jdbc-batching]]
327-
== StatelessSession and JDBC Batching
328-
329-
Automatic JDBC batching has the side effect of delaying the execution of the batched operation, and this undermines the synchronous nature of operations performed through a stateless session.
330-
In Hibernate 7, the configuration property `hibernate.jdbc.batch_size` now has no effect on a stateless session.
331-
Automatic batching may be enabled by explicitly calling `setJdbcBatchSize()`.
332-
However, the preferred approach is to <<stateless-session-multiple,explicitly batch operations>> via `insertMultiple()`, `updateMultiple()`, or `deleteMultiple()`.
333-
334-
335-
[[transaction-api]]
336-
== Improvements to Transaction
337-
338-
The `Transaction` interface leaks the SPI type `TransactionStatus` via `getStatus()`, and the JTA-defined type `Synchronization` via `registerSynchronization()`, which breaks layering in a fairly harmless way.
339-
New operations were added to the `Transaction` interface, allowing code to inspect the status of the transaction or register callbacks without the use of layer-breaking operations.
340-
341-
[NOTE]
342-
====
343-
This feature is considered incubating.
344-
====
345-
346-
[[collection-id-java-class]]
347-
== @CollectionIdJavaClass
348-
349-
`@CollectionIdJavaClass` is an alternative to `@CollectionIdJavaType` for simpler cases of id-bag mappings. E.g.
350-
351-
====
352-
[source, java, indent=0]
353-
----
354-
@Bag
355-
@CollectionId(generator="increment")
356-
@CollectionIdJavaClass(Integer.class)
357-
Collection<Person> authors;
358-
----
359-
====
360-
361-
362-
[[schema-manager-populate]]
363-
== Data population
364-
365-
Setting `jakarta.persistence.schema-generation.database.action=populate` or calling `SchemaManager.populate()` populates an existing schema with initial data in `/import.sql` or other SQL scripts specified via `jakarta.persistence.sql-load-script-source`.
366-
367-
368-
[[xml-mapping]]
369-
== XML mappings
370-
371-
Hibernate's legacy `hbm.xml` mapping schema has been deprecated for quite some time, replaced by a new `mapping.xml`
372-
schema, which is now stabilized and should be prefered.
373-
Support for `hbm.xml` mappings will be removed in 8.0.
374-
375-
We offer a transformation of `hbm.xml` files into `mapping.xml` files, which is available both at build-time (Gradle plugin) and at run-time (using `hibernate.transform_hbm_xml.enabled=true`).
376-
377-
378-
[[OSON-support]]
379-
== OSON support
380-
381-
382-
Starting in 21c, link:https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-oracle-database.html[Oracle JSON binary format] (also known as OSON) can now be used in Hibernate to store `JSON` data. It brings a performance boost by replacing the actual to/from String conversion.
383-
To enable the OSON support, the link:https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-jackson-oson/README.md[Oracle JDBC extension] must be added to the application classpath.
384-
Here is an example using Gradle build system
385-
```
386-
runtimeOnly ('com.oracle.database.jdbc:ojdbc-provider-jackson-oson:1.0.4')
387-
{
388-
exclude group: 'com.oracle.database.jdbc', module: 'ojdbc8'
389-
}
390-
```
391-
392-
The use of OSON can be disabled by setting the following hibernate property `hibernate.dialect.oracle.oson_format_disabled=true`
16+
7.1 adds a Dialect for the Teradata database, supporting version 12 and higher.

0 commit comments

Comments
 (0)