Skip to content
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

How about add setComment(String) to JPAQuery? #28

Closed
keesun opened this issue Oct 13, 2011 · 5 comments
Closed

How about add setComment(String) to JPAQuery? #28

keesun opened this issue Oct 13, 2011 · 5 comments

Comments

@keesun
Copy link

@keesun keesun commented Oct 13, 2011

Now, we can set a query comment with JPAQuery.setHint("org.hibernate.comment", "hint"). I think, It would be nice to also be able to do something like this:

JPAQuery.setComment("hint');

What do you think about this?

@timowest
Copy link
Member

@timowest timowest commented Oct 13, 2011

No, that's problematic, since org.hibernate.comment is a Hibernate specific key. How would you implement JPAQuery.setComment(String) ?

You can put comment key into a static final constant :

private static final String COMMENT_KEY = "org.hibernate.comment";

and use it like this

query.setHint(COMMENT_KEY, "hint");
@keesun
Copy link
Author

@keesun keesun commented Oct 13, 2011

That's right. I agree with you. Then, How about add that method to HibernateQuery?

@timowest
Copy link
Member

@timowest timowest commented Oct 14, 2011

Ok. I will do so.

@keesun
Copy link
Author

@keesun keesun commented Oct 14, 2011

Thank you, Timo.

timowest added a commit that referenced this issue Oct 14, 2011
@timowest
Copy link
Member

@timowest timowest commented Oct 23, 2011

Released in 2.2.4

@timowest timowest closed this Oct 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants