|
|
@ -54,6 +54,7 @@ import com.fr.third.org.hibernate.type.PrimitiveCharacterArrayNClobType; |
|
|
|
import com.fr.third.org.hibernate.type.SerializableToBlobType; |
|
|
|
import com.fr.third.org.hibernate.type.SerializableToBlobType; |
|
|
|
import com.fr.third.org.hibernate.type.StandardBasicTypes; |
|
|
|
import com.fr.third.org.hibernate.type.StandardBasicTypes; |
|
|
|
import com.fr.third.org.hibernate.type.StringNVarcharType; |
|
|
|
import com.fr.third.org.hibernate.type.StringNVarcharType; |
|
|
|
|
|
|
|
import com.fr.third.org.hibernate.type.StringType; |
|
|
|
import com.fr.third.org.hibernate.type.WrappedMaterializedBlobType; |
|
|
|
import com.fr.third.org.hibernate.type.WrappedMaterializedBlobType; |
|
|
|
import com.fr.third.org.hibernate.usertype.DynamicParameterizedType; |
|
|
|
import com.fr.third.org.hibernate.usertype.DynamicParameterizedType; |
|
|
|
|
|
|
|
|
|
|
@ -89,6 +90,14 @@ public class SimpleValueBinder { |
|
|
|
|
|
|
|
|
|
|
|
private AttributeConverterDescriptor attributeConverterDescriptor; |
|
|
|
private AttributeConverterDescriptor attributeConverterDescriptor; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String DRIVER_CLASS; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String DB2_PREFIX = "db2"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void setDriverClass(String driverClass) { |
|
|
|
|
|
|
|
DRIVER_CLASS = driverClass; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setReferencedEntityName(String referencedEntityName) { |
|
|
|
public void setReferencedEntityName(String referencedEntityName) { |
|
|
|
this.referencedEntityName = referencedEntityName; |
|
|
|
this.referencedEntityName = referencedEntityName; |
|
|
|
} |
|
|
|
} |
|
|
@ -278,7 +287,7 @@ public class SimpleValueBinder { |
|
|
|
else if ( isNationalized ) { |
|
|
|
else if ( isNationalized ) { |
|
|
|
if ( buildingContext.getBuildingOptions().getReflectionManager().equals( returnedClassOrElement, String.class ) ) { |
|
|
|
if ( buildingContext.getBuildingOptions().getReflectionManager().equals( returnedClassOrElement, String.class ) ) { |
|
|
|
// nvarchar
|
|
|
|
// nvarchar
|
|
|
|
type = StringNVarcharType.INSTANCE.getName(); |
|
|
|
type = DRIVER_CLASS != null && DRIVER_CLASS.contains(DB2_PREFIX) ? StringType.INSTANCE.getName() : StringNVarcharType.INSTANCE.getName(); |
|
|
|
explicitType = type; |
|
|
|
explicitType = type; |
|
|
|
} |
|
|
|
} |
|
|
|
else if ( buildingContext.getBuildingOptions().getReflectionManager().equals( returnedClassOrElement, Character.class ) || |
|
|
|
else if ( buildingContext.getBuildingOptions().getReflectionManager().equals( returnedClassOrElement, Character.class ) || |
|
|
@ -454,7 +463,7 @@ public class SimpleValueBinder { |
|
|
|
|
|
|
|
|
|
|
|
public void fillSimpleValue() { |
|
|
|
public void fillSimpleValue() { |
|
|
|
LOG.debugf( "Starting fillSimpleValue for %s", propertyName ); |
|
|
|
LOG.debugf( "Starting fillSimpleValue for %s", propertyName ); |
|
|
|
|
|
|
|
|
|
|
|
if ( attributeConverterDescriptor != null ) { |
|
|
|
if ( attributeConverterDescriptor != null ) { |
|
|
|
if ( ! BinderHelper.isEmptyAnnotationValue( explicitType ) ) { |
|
|
|
if ( ! BinderHelper.isEmptyAnnotationValue( explicitType ) ) { |
|
|
|
throw new AnnotationException( |
|
|
|
throw new AnnotationException( |
|
|
@ -531,7 +540,7 @@ public class SimpleValueBinder { |
|
|
|
if ( timeStampVersionType != null ) { |
|
|
|
if ( timeStampVersionType != null ) { |
|
|
|
simpleValue.setTypeName( timeStampVersionType ); |
|
|
|
simpleValue.setTypeName( timeStampVersionType ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ( simpleValue.getTypeName() != null && simpleValue.getTypeName().length() > 0 |
|
|
|
if ( simpleValue.getTypeName() != null && simpleValue.getTypeName().length() > 0 |
|
|
|
&& simpleValue.getMetadata().getTypeResolver().basic( simpleValue.getTypeName() ) == null ) { |
|
|
|
&& simpleValue.getMetadata().getTypeResolver().basic( simpleValue.getTypeName() ) == null ) { |
|
|
|
try { |
|
|
|
try { |
|
|
|