-
Notifications
You must be signed in to change notification settings - Fork 95
Create QueryProducer interface for Stage and Mutiny #2130
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
Conversation
|
...ate-reactive-core/src/main/java/org/hibernate/reactive/session/ReactiveStatelessSession.java
Fixed
Show fixed
Hide fixed
hibernate-reactive-core/src/main/java/org/hibernate/reactive/stage/Stage.java
Dismissed
Show dismissed
Hide dismissed
hibernate-reactive-core/src/main/java/org/hibernate/reactive/stage/Stage.java
Dismissed
Show dismissed
Hide dismissed
Also, please don't move |
Also not sure it's a good idea to move |
OK, I'm going to revert back the |
d1d85a2
to
2e42d90
Compare
Done |
By the way, why do we have |
hibernate-reactive-core/src/main/java/org/hibernate/reactive/mutiny/Mutiny.java
Fixed
Show fixed
Hide fixed
* | ||
* @throws IllegalArgumentException if the given instance is not managed | ||
* @see org.hibernate.Hibernate#unproxy(Object) |
Check notice
Code scanning / CodeQL
Confusing overloading of methods Note
refresh
Just avoids an array instantiation in the overwhelmingly more common case that you're only passing one entity. That's unlikely to be a huge overhead, but the overload doesn't cause any problems that I'm aware of. |
Should I close this PR or are we going to merge it if the shared contract has a different name? |
I think if it were called |
2e42d90
to
c9057e6
Compare
I've renamed the interface <R> SelectionQuery<R> createSelectionQuery(String queryString, Class<R> resultType);
<R> Query<R> createQuery(TypedQueryReference<R> typedQueryReference);
MutationQuery createMutationQuery(String queryString);
MutationQuery createMutationQuery(CriteriaUpdate<?> updateQuery);
MutationQuery createMutationQuery(CriteriaDelete<?> deleteQuery);
MutationQuery createMutationQuery(JpaCriteriaInsert<?> insert);
<R> Query<R> createQuery(String queryString);
<R> SelectionQuery<R> createQuery(String queryString, Class<R> resultType);
<R> SelectionQuery<R> createQuery(CriteriaQuery<R> criteriaQuery);
<R> MutationQuery createQuery(CriteriaUpdate<R> criteriaUpdate);
<R> MutationQuery createQuery(CriteriaDelete<R> criteriaDelete);
<R> Query<R> createNamedQuery(String queryName);
<R> SelectionQuery<R> createNamedQuery(String queryName, Class<R> resultType);
<R> Query<R> createNativeQuery(String queryString);
<R> Query<R> createNativeQuery(String queryString, AffectedEntities affectedEntities);
<R> SelectionQuery<R> createNativeQuery(String queryString, Class<R> resultType);
<R> SelectionQuery<R> createNativeQuery(String queryString, Class<R> resultType, AffectedEntities affectedEntities);
<R> SelectionQuery<R> createNativeQuery(String queryString, ResultSetMapping<R> resultSetMapping);
<R> SelectionQuery<R> createNativeQuery(String queryString, ResultSetMapping<R> resultSetMapping, AffectedEntities affectedEntities);
CriteriaBuilder getCriteriaBuilder();
<T> EntityGraph<T> getEntityGraph(Class<T> rootType, String graphName);
<T> EntityGraph<T> createEntityGraph(Class<T> rootType);
<T> EntityGraph<T> createEntityGraph(Class<T> rootType, String graphName);
Object getIdentifier(Object entity);
<T> ResultSetMapping<T> getResultSetMapping(Class<T> resultType, String mappingName);
<T> Uni<T> unproxy(T association); |
hibernate-reactive-core/src/main/java/org/hibernate/reactive/mutiny/Mutiny.java
Fixed
Show fixed
Hide fixed
hibernate-reactive-core/src/main/java/org/hibernate/reactive/mutiny/Mutiny.java
Fixed
Show fixed
Hide fixed
Let's not pull this one up, it's nothing to do with queries, and in ORM it's not pulled up because it has different semantics between
Why pull up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
81e50ef
to
65098e6
Compare
65098e6
to
e43220e
Compare
I removed them from |
@gavinking I think we can merge it now, but can you give it another look and let me know if there's more to change, please? |
If anything, this should be at least a good starting point |
Fine, I mean the diff is utterly unreadable, so it's pretty hard to give much feedback. |
Merged, thanks! |
A first draft of the shared session contract. I've basically collected the methods we already have in both sessions.
See Mutiny.SharedSessionContract (or Stage.SharedSessionContract).
Personally, I like knowing which methods are not specific to a session.