Skip to content

Conversation

gavinking
Copy link
Member

No description provided.


@Entity(name = "Thing")
@Table(name = "thingy_table")
public class Thing {

Check notice

Code scanning / CodeQL

Inner class could be static

Thing should be made static, since the enclosing instance is not used.
@hibernate-github-bot
Copy link

hibernate-github-bot bot commented May 28, 2023

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [be5366d, 9d72aca, 70e714e]

› This message was automatically generated.


This is bearable, but let's explore some other options.

JPA lets us specify that we want each query result packaged as an instance of `javax.persistence.Tuple`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jakarta. perhaps instead of javax.?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, thanks, I'm still in denial...

.getResultList();
for (var list : results) {
String title = (String) list.get(0);
String preamble = (String) tuple.get(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume tuple should be list

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, thanks.

[source, java]
[%unbreakable]
----
var results =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it would be nicer to have the full type instead of var

[source, java]
[%unbreakable]
----
var results =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it would be nicer to have the full type instead of var

Map.class)
.getResultList();
for (var map : results) {
String title = (String) tuple.get("title");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume map instead of tupple

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@gavinking gavinking closed this May 29, 2023
@gavinking gavinking deleted the implicit-instantiation branch May 29, 2023 11:59
@gavinking
Copy link
Member Author

Note that this PR was superseded by #6685.

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.

2 participants