Skip to content

Commit

Permalink
Add support for GraalVM native images #343
Browse files Browse the repository at this point in the history
  • Loading branch information
edudar authored and vladmihalcea committed Sep 5, 2022
1 parent 8bb8ae9 commit c6ab395
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public JsonTypeDescriptor(final ObjectMapperWrapper objectMapperWrapper, Type ty
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
Type type = (xProperty instanceof JavaXMember) ?
ReflectionUtils.invokeGetter(xProperty, "javaType") :
((JavaXMember) xProperty).getJavaType() :
((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
setPropertyClass(type);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.vladmihalcea.hibernate.type.range;

import com.vladmihalcea.hibernate.type.ImmutableType;
import com.vladmihalcea.hibernate.util.ReflectionUtils;
import org.hibernate.HibernateException;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.annotations.common.reflection.java.JavaXMember;
Expand Down Expand Up @@ -128,7 +127,7 @@ private static String determineRangeType(Range<?> range) {
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
if (xProperty instanceof JavaXMember) {
type = ReflectionUtils.invokeGetter(xProperty, "javaType");
type = ((JavaXMember) xProperty).getJavaType();
} else {
type = ((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.google.common.collect.BoundType;
import com.google.common.collect.Range;
import com.vladmihalcea.hibernate.type.ImmutableType;
import com.vladmihalcea.hibernate.util.ReflectionUtils;
import org.hibernate.HibernateException;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.annotations.common.reflection.java.JavaXMember;
Expand Down Expand Up @@ -515,7 +514,7 @@ private String asString(Object value) {
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
if (xProperty instanceof JavaXMember) {
type = ReflectionUtils.invokeGetter(xProperty, "javaType");
type = ((JavaXMember) xProperty).getJavaType();
} else {
type = ((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.vladmihalcea.hibernate.type.search.internal;

import com.vladmihalcea.hibernate.util.ReflectionUtils;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.annotations.common.reflection.java.JavaXMember;
import org.hibernate.type.descriptor.WrapperOptions;
Expand All @@ -24,7 +23,7 @@ public PostgreSQLTSVectorTypeDescriptor() {
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
if (xProperty instanceof JavaXMember) {
type = ReflectionUtils.invokeGetter(xProperty, "javaType");
type = ((JavaXMember) xProperty).getJavaType();
} else {
type = ((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public JsonTypeDescriptor(final ObjectMapperWrapper objectMapperWrapper, Type ty
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
Type type = (xProperty instanceof JavaXMember) ?
ReflectionUtils.invokeGetter(xProperty, "javaType") :
((JavaXMember) xProperty).getJavaType() :
((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
setPropertyClass(type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.vladmihalcea.hibernate.type.ImmutableType;
import com.vladmihalcea.hibernate.type.util.Configuration;
import com.vladmihalcea.hibernate.util.ReflectionUtils;
import org.hibernate.HibernateException;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.annotations.common.reflection.java.JavaXMember;
Expand Down Expand Up @@ -133,7 +132,7 @@ private static String determineRangeType(Range<?> range) {
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
if (xProperty instanceof JavaXMember) {
type = ReflectionUtils.invokeGetter(xProperty, "javaType");
type = ((JavaXMember) xProperty).getJavaType();
} else {
type = ((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.google.common.collect.BoundType;
import com.google.common.collect.Range;
import com.vladmihalcea.hibernate.type.ImmutableType;
import com.vladmihalcea.hibernate.util.ReflectionUtils;
import org.hibernate.HibernateException;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.annotations.common.reflection.java.JavaXMember;
Expand Down Expand Up @@ -515,7 +514,7 @@ private String asString(Object value) {
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
if (xProperty instanceof JavaXMember) {
type = ReflectionUtils.invokeGetter(xProperty, "javaType");
type = ((JavaXMember) xProperty).getJavaType();
} else {
type = ((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.vladmihalcea.hibernate.type.search.internal;

import com.vladmihalcea.hibernate.util.ReflectionUtils;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.annotations.common.reflection.java.JavaXMember;
import org.hibernate.type.descriptor.WrapperOptions;
Expand All @@ -24,7 +23,7 @@ public PostgreSQLTSVectorTypeDescriptor() {
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
if (xProperty instanceof JavaXMember) {
type = ReflectionUtils.invokeGetter(xProperty, "javaType");
type = ((JavaXMember) xProperty).getJavaType();
} else {
type = ((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
}
Expand Down
6 changes: 6 additions & 0 deletions hibernate-types-60/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
<artifactId>ehcache</artifactId>
<version>${ehcache.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public JsonJavaTypeDescriptor(final ObjectMapperWrapper objectMapperWrapper, Typ
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
Type type = (xProperty instanceof JavaXMember) ?
ReflectionUtils.invokeGetter(xProperty, "javaType") :
((JavaXMember) xProperty).getJavaType() :
((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
setPropertyClass(type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.vladmihalcea.hibernate.type.ImmutableType;
import com.vladmihalcea.hibernate.type.util.Configuration;
import com.vladmihalcea.hibernate.util.ReflectionUtils;
import org.hibernate.HibernateException;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.annotations.common.reflection.java.JavaXMember;
Expand Down Expand Up @@ -133,7 +132,7 @@ private static String determineRangeType(Range<?> range) {
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
if (xProperty instanceof JavaXMember) {
type = ReflectionUtils.invokeGetter(xProperty, "javaType");
type = ((JavaXMember) xProperty).getJavaType();
} else {
type = ((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.google.common.collect.BoundType;
import com.google.common.collect.Range;
import com.vladmihalcea.hibernate.type.ImmutableType;
import com.vladmihalcea.hibernate.util.ReflectionUtils;
import org.hibernate.HibernateException;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.annotations.common.reflection.java.JavaXMember;
Expand Down Expand Up @@ -515,7 +514,7 @@ private String asString(Object value) {
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
if (xProperty instanceof JavaXMember) {
type = ReflectionUtils.invokeGetter(xProperty, "javaType");
type = ((JavaXMember) xProperty).getJavaType();
} else {
type = ((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.vladmihalcea.hibernate.type.search.internal;

import com.vladmihalcea.hibernate.util.ReflectionUtils;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.annotations.common.reflection.java.JavaXMember;
import org.hibernate.type.descriptor.WrapperOptions;
Expand All @@ -24,7 +23,7 @@ public PostgreSQLTSVectorTypeDescriptor() {
public void setParameterValues(Properties parameters) {
final XProperty xProperty = (XProperty) parameters.get(DynamicParameterizedType.XPROPERTY);
if (xProperty instanceof JavaXMember) {
type = ReflectionUtils.invokeGetter(xProperty, "javaType");
type = ((JavaXMember) xProperty).getJavaType();
} else {
type = ((ParameterType) parameters.get(PARAMETER_TYPE)).getReturnedClass();
}
Expand Down

0 comments on commit c6ab395

Please sign in to comment.