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

Fix for hibernate 5 #12

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Fix for hibernate 5 #12

wants to merge 8 commits into from

Conversation

rtisma
Copy link

@rtisma rtisma commented Apr 12, 2018

Addresses issue #11

Copy link
Owner

@velo velo left a comment

Choose a reason for hiding this comment

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

What about we delete the old method?!

@@ -68,7 +68,6 @@ public boolean isMutable() {
return true;
}

@Override
public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException {
Copy link
Owner

Choose a reason for hiding this comment

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

if this method is no longer part of the implementation, I think it's safe to take it out.

@@ -79,7 +78,14 @@ public void nullSafeSet(PreparedStatement st, Object value, int index, SessionIm
st.setObject(index, dataObject);
}

@Override
public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException {
return nullSafeGet(rs, names, (SessionImplementor) session, owner);
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think this cast is either safe nor necessary.

Copy link
Author

Choose a reason for hiding this comment

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

right. I blindly copied the fix from my other project, which has jsonb working with hibernate using sprint boot 2.0.1. ill update this.

@rtisma
Copy link
Author

rtisma commented Apr 13, 2018

not too sure why its failing with

queryJson(com.marvinformatics.hibernate.json.JsonExpressionsTest)  Time elapsed: 1.73 sec  <<< ERROR!
java.lang.NoSuchMethodError: org.hibernate.Session.createQuery(Ljava/lang/String;)Lorg/hibernate/Query;
	at com.querydsl.jpa.hibernate.DefaultSessionHolder.createQuery(DefaultSessionHolder.java:36)
	at com.querydsl.jpa.hibernate.AbstractHibernateQuery.createQuery(AbstractHibernateQuery.java:104)
	at com.querydsl.jpa.hibernate.AbstractHibernateQuery.createQuery(AbstractHibernateQuery.java:97)
	at com.querydsl.jpa.hibernate.AbstractHibernateQuery.fetch(AbstractHibernateQuery.java:174)
	at com.marvinformatics.hibernate.json.JsonExpressionsTest.queryJson(JsonExpressionsTest.java:104)

when hibernate-core 5.2.16-Final has the method
https://github.com/hibernate/hibernate-orm/blob/5.2.16/hibernate-core/src/main/java/org/hibernate/Session.java#L1142

and hibernate-core 5.2.16-Final is loaded on the classpath

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