Skip to content

Update MutinyGenerator#generate signature #1742

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

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

DavideD
Copy link
Member

@DavideD DavideD commented Aug 31, 2023

Fix #1741

@gavinking Does it make sense? Or am I missing something?
This is the change: d8e08d7

We `Uni<?>` we can avoid an additional redundant conversion
before returning the value in some situations.

For example, if the return value is the result of a native
query:
```
return session.createNativeQuery("...", Long.class).getSingleResult();
```

This is useful because with native queries we don't always know in advance
what value will be returned. And using Object.class might cause
ClassCastExceptions along the way.
@DavideD DavideD requested a review from gavinking August 31, 2023 09:10
@DavideD DavideD self-assigned this Aug 31, 2023
throw new UnsupportedOperationException( "Use generate(Mutiny.Session, Object, Object, EventType) instead" );
}

public abstract Uni<Object> generate(Mutiny.Session session, Object owner, Object currentValue,
EventType eventType);
public abstract Uni<?> generate(Mutiny.Session session, Object owner, Object currentValue, EventType eventType);

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'owner' is never used.
throw new UnsupportedOperationException( "Use generate(Mutiny.Session, Object, Object, EventType) instead" );
}

public abstract Uni<Object> generate(Mutiny.Session session, Object owner, Object currentValue,
EventType eventType);
public abstract Uni<?> generate(Mutiny.Session session, Object owner, Object currentValue, EventType eventType);

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'currentValue' is never used.
throw new UnsupportedOperationException( "Use generate(Mutiny.Session, Object, Object, EventType) instead" );
}

public abstract Uni<Object> generate(Mutiny.Session session, Object owner, Object currentValue,
EventType eventType);
public abstract Uni<?> generate(Mutiny.Session session, Object owner, Object currentValue, EventType eventType);

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'eventType' is never used.
@DavideD DavideD force-pushed the 1741-MutinyGenerator branch from 175c764 to ef44883 Compare August 31, 2023 09:20
@DavideD DavideD force-pushed the 1741-MutinyGenerator branch from ef44883 to 7ba0431 Compare August 31, 2023 09:30
@DavideD DavideD merged commit 2fea5e7 into hibernate:main Sep 1, 2023
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.

Revisit the MutinyGenerator Api
1 participant