Skip to content

Conversation

@sebersole
Copy link
Member

@sebersole sebersole commented Jan 6, 2026

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

Check notice

Code scanning / CodeQL

Unread local variable

Variable 'List<> l' is never read.
@@ -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

Variable 'Number customerCount' is never read.
@@ -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

Variable 'Customer customer' is never read.
/// @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

Potential uncaught 'java.lang.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

Invoking [MapKey.name](1) should be avoided because it has been deprecated.
}

@Override
public void setTimeout(int timeout) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods

Method QueryOptionsImpl.setTimeout(..) could be confused with overloaded method [setTimeout](1), since dispatch depends on static types.

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

Variable 'Join<BookList,Object> join' is never read.
//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

Variable 'SelectionQuery<?> badQuery' is never read.
//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

Variable 'SelectionQuery<?> badQuery' is never read.
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

Potential uncaught 'java.lang.NumberFormatException'.
*/
FetchBuilder resolve(Parent parent, Consumer<String> querySpaceConsumer, ResultSetMappingResolutionContext context);

default MemberMapping<?> toJpaMemberMapping(Parent parent, SessionFactory sessionFactory) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'sessionFactory' is never used.

ResultBuilder resolve(Consumer<String> querySpaceConsumer, ResultSetMappingResolutionContext context);

default <R> boolean canBeTreatedAsResultSetMapping(Class<R> resultType, SessionFactory sessionFactory) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'sessionFactory' is never used.

<R> ResultSetMapping<R> toJpaMapping(SessionFactory sessionFactory);

default <R> MappingElement<R> toJpaMappingElement(SessionFactory sessionFactory) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'sessionFactory' is never used.
NavigablePath attributePath,
EntityPersister entityDescriptor,
BasicAttributeMapping attributeMapping,
SessionFactoryImplementor factory) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'factory' is never used.
FieldMapping<?, ?> basicMapping,
NavigablePath attributePath,
EntityPersister entityDescriptor,
BasicAttributeMapping attributeMapping,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'attributeMapping' is never used.
public static FetchMementoBasicStandard from(
FieldMapping<?, ?> basicMapping,
NavigablePath attributePath,
EntityPersister entityDescriptor,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'entityDescriptor' is never used.

public static FetchMementoBasicStandard from(
FieldMapping<?, ?> basicMapping,
NavigablePath attributePath,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'attributePath' is never used.
}

public static FetchMementoBasicStandard from(
FieldMapping<?, ?> basicMapping,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'basicMapping' is never used.
}
}

public <T> T fromAppliedGraph(GraphSemantic semantic, RootGraphImplementor<?> graph, Supplier<T> action) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'graph' is never used.
}
}

public <T> T fromAppliedGraph(GraphSemantic semantic, RootGraphImplementor<?> graph, Supplier<T> action) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'semantic' is never used.
graph = null;
}

public void withAppliedGraph(GraphSemantic semantic, RootGraphImplementor<?> graph, Runnable action) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'graph' is never used.
graph = null;
}

public void withAppliedGraph(GraphSemantic semantic, RootGraphImplementor<?> graph, Runnable action) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'semantic' is never used.
private final NavigablePath rootPath;

public ComplexIdentifierFetchHandler(
EntityPersister entityDescriptor,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'entityDescriptor' is never used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant