-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-20028 - Update to Jakarta Persistence 4.0 #11558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Check notice
Code scanning / CodeQL
Unread local variable
| @@ -114,7 +114,7 @@ | |||
| // no-ops | |||
| session.getTransaction().begin(); | |||
|
|
|||
| Number customerCount = (Number) session.createSelectionQuery("select count(c) from Customer c").uniqueResult(); | |||
| Number customerCount = session.createSelectionQuery("select count(c) from Customer c", Number.class).uniqueResult(); | |||
Check notice
Code scanning / CodeQL
Unread local variable
| @@ -176,7 +176,7 @@ | |||
| session.getTransaction().begin(); | |||
|
|
|||
| session.persist(new Customer()); | |||
| Customer customer = (Customer) session.createSelectionQuery("select c from Customer c").uniqueResult(); | |||
| Customer customer = (Customer) session.createSelectionQuery("select c from Customer c", Customer.class).uniqueResult(); | |||
Check notice
Code scanning / CodeQL
Unread local variable
| /// @author Steve Ebersole | ||
| public class TimeoutMarshalling { | ||
| public static Timeout fromXml(String value) { | ||
| return value == null ? null : Timeout.seconds( Integer.parseInt( value ) ); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException
| if ( hasMapKeyProperty ) { | ||
| // JPA says: if missing, use primary key of associated entity | ||
| mapKeyPropertyName = nullIfEmpty( key.name() ); | ||
| mapKeyPropertyName = coalesce( key.value(), key.name() ); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
| } | ||
|
|
||
| @Override | ||
| public void setTimeout(int timeout) { |
Check notice
Code scanning / CodeQL
Confusing overloading of methods
|
|
||
| JpaRoot<BookList> root = query.from( BookList.class ); | ||
| Join<Object, Object> join = root.join( "book", JoinType.INNER ); | ||
| Join<BookList, Object> join = root.join( "book", JoinType.INNER ); |
Check notice
Code scanning / CodeQL
Unread local variable
| //tag::example-hql-selection-query[] | ||
| // can be validated while creating the SelectionQuery | ||
| SelectionQuery<?> badQuery = session.createSelectionQuery( "delete Person" ); | ||
| SelectionQuery<?> badQuery = session.createSelectionQuery( "delete Person", Person.class ); |
Check notice
Code scanning / CodeQL
Unread local variable
| //tag::example-hql-named-selection-query[] | ||
| // can be validated while creating the SelectionQuery | ||
| SelectionQuery<?> badQuery = session.getNamedQuery( "delete_Person" ); | ||
| SelectionQuery<?> badQuery = session.createNamedQuery( "delete_Person" ); |
Check notice
Code scanning / CodeQL
Unread local variable
| public static class StringToIntConverter implements AttributeConverter<String,Integer> { | ||
| @Override | ||
| public Integer convertToDatabaseColumn(String domainValue) { | ||
| return domainValue == null ? null : Integer.parseInt( domainValue ); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException
| */ | ||
| FetchBuilder resolve(Parent parent, Consumer<String> querySpaceConsumer, ResultSetMappingResolutionContext context); | ||
|
|
||
| default MemberMapping<?> toJpaMemberMapping(Parent parent, SessionFactory sessionFactory) { |
Check notice
Code scanning / CodeQL
Useless parameter
|
|
||
| ResultBuilder resolve(Consumer<String> querySpaceConsumer, ResultSetMappingResolutionContext context); | ||
|
|
||
| default <R> boolean canBeTreatedAsResultSetMapping(Class<R> resultType, SessionFactory sessionFactory) { |
Check notice
Code scanning / CodeQL
Useless parameter
|
|
||
| <R> ResultSetMapping<R> toJpaMapping(SessionFactory sessionFactory); | ||
|
|
||
| default <R> MappingElement<R> toJpaMappingElement(SessionFactory sessionFactory) { |
Check notice
Code scanning / CodeQL
Useless parameter
| NavigablePath attributePath, | ||
| EntityPersister entityDescriptor, | ||
| BasicAttributeMapping attributeMapping, | ||
| SessionFactoryImplementor factory) { |
Check notice
Code scanning / CodeQL
Useless parameter
| FieldMapping<?, ?> basicMapping, | ||
| NavigablePath attributePath, | ||
| EntityPersister entityDescriptor, | ||
| BasicAttributeMapping attributeMapping, |
Check notice
Code scanning / CodeQL
Useless parameter
| public static FetchMementoBasicStandard from( | ||
| FieldMapping<?, ?> basicMapping, | ||
| NavigablePath attributePath, | ||
| EntityPersister entityDescriptor, |
Check notice
Code scanning / CodeQL
Useless parameter
|
|
||
| public static FetchMementoBasicStandard from( | ||
| FieldMapping<?, ?> basicMapping, | ||
| NavigablePath attributePath, |
Check notice
Code scanning / CodeQL
Useless parameter
| } | ||
|
|
||
| public static FetchMementoBasicStandard from( | ||
| FieldMapping<?, ?> basicMapping, |
Check notice
Code scanning / CodeQL
Useless parameter
| } | ||
| } | ||
|
|
||
| public <T> T fromAppliedGraph(GraphSemantic semantic, RootGraphImplementor<?> graph, Supplier<T> action) { |
Check notice
Code scanning / CodeQL
Useless parameter
| } | ||
| } | ||
|
|
||
| public <T> T fromAppliedGraph(GraphSemantic semantic, RootGraphImplementor<?> graph, Supplier<T> action) { |
Check notice
Code scanning / CodeQL
Useless parameter
| graph = null; | ||
| } | ||
|
|
||
| public void withAppliedGraph(GraphSemantic semantic, RootGraphImplementor<?> graph, Runnable action) { |
Check notice
Code scanning / CodeQL
Useless parameter
| graph = null; | ||
| } | ||
|
|
||
| public void withAppliedGraph(GraphSemantic semantic, RootGraphImplementor<?> graph, Runnable action) { |
Check notice
Code scanning / CodeQL
Useless parameter
# Conflicts: # hibernate-core/src/main/java/org/hibernate/internal/NaturalIdMultiLoadAccessStandard.java # hibernate-core/src/main/java/org/hibernate/internal/find/AbstractFindMultipleByKeyOperation.java # hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java # hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/PersistenceXmlParser.java # hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java
HHH-20028 - Update to Jakarta Persistence 4.0
Initial work...
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.
https://hibernate.atlassian.net/browse/HHH-20028