/** * Returns the {@link GridType} representing the {@link Type}. * * @param type the Type that needs conversion * * @return the corresponding GridType */ public GridType convert(Type type) { if ( type instanceof CustomType ) { CustomType customType = (CustomType) type; if ( customType.getUserType() instanceof EnumType ) { EnumType enumType = (EnumType) customType.getUserType(); return ( new RedisHashEnumType( customType, enumType ) ); } } if ( type instanceof SerializableToBlobType ) { return new SerializableAsStringType( ( (SerializableToBlobType) type ).getJavaTypeDescriptor() ); } return conversionMap.get( type ); }
/** * Returns the {@link GridType} representing the {@link Type}. * * @param type the Type that needs conversion * * @return the corresponding GridType */ public GridType convert(Type type) { if ( type instanceof SerializableToBlobType ) { SerializableToBlobType<?> exposedType = (SerializableToBlobType<?>) type; return new RedisSerializableType<>( exposedType.getJavaTypeDescriptor() ); } return (AbstractGenericBasicType<Object>) conversionMap.get( type ); }
@Override public String resolveHibernateTypeName(AnnotationInstance annotationInstance) { if ( annotationInstance == null ) { return null; } String type = null; if ( Clob.class.isAssignableFrom( mappedAttribute.getAttributeType() ) ) { type = StandardBasicTypes.CLOB.getName(); } else if ( Blob.class.isAssignableFrom( mappedAttribute.getAttributeType() ) ) { type = StandardBasicTypes.BLOB.getName(); } else if ( String.class.isAssignableFrom( mappedAttribute.getAttributeType() ) ) { type = StandardBasicTypes.MATERIALIZED_CLOB.getName(); } else if ( Character[].class.isAssignableFrom( mappedAttribute.getAttributeType() ) ) { type = CharacterArrayClobType.class.getName(); } else if ( char[].class.isAssignableFrom( mappedAttribute.getAttributeType() ) ) { type = PrimitiveCharacterArrayClobType.class.getName(); } else if ( Byte[].class.isAssignableFrom( mappedAttribute.getAttributeType() ) ) { type = WrappedMaterializedBlobType.class.getName(); } else if ( byte[].class.isAssignableFrom( mappedAttribute.getAttributeType() ) ) { type = StandardBasicTypes.MATERIALIZED_BLOB.getName(); } else if ( Serializable.class.isAssignableFrom( mappedAttribute.getAttributeType() ) ) { type = SerializableToBlobType.class.getName(); } else { type = "blob"; } return type; }
@Override protected Map<String, String> resolveHibernateTypeParameters(AnnotationInstance annotationInstance) { if ( getExplicitHibernateTypeName().equals( SerializableToBlobType.class.getName() ) ) { HashMap<String, String> typeParameters = new HashMap<String, String>(); typeParameters.put( SerializableToBlobType.CLASS_NAME, mappedAttribute.getAttributeType().getName() ); return typeParameters; } return null; }
@Column(name = "EXECUTER_INFORMATION_DATA", length = Integer.MAX_VALUE) @Cascade(CascadeType.ALL) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @org.hibernate.annotations.Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) @OnDelete(action = OnDeleteAction.CASCADE) public ExecuterInformationData getExecuterInformationData() { return executerInformationData; }
@Column(name = "JVM_ARGUMENTS") @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @org.hibernate.annotations.Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public List<String> getJvmArguments() { return jvmArguments; }
@Column(name = "CLASSPATH") @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @org.hibernate.annotations.Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public List<String> getAdditionalClasspath() { return additionalClasspath; }
@Column(name = "GENERIC_INFO", updatable = false) @Type(type = "org.ow2.proactive.scheduler.core.db.types.NonEmptyMapToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public Map<String, String> getGenericInformation() { return genericInformation; }
@Column(name = "GENERIC_INFO", length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public Map<String, String> getGenericInformation() { return genericInformation; }
@Column(name = "PROPAGATED_VARIABLES", length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public Map<String, byte[]> getPropagatedVariables() { return propagatedVariables; }
@Column(name = "METADATA", length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public Map<String, String> getMetadata() { return metadata; }
@Column(name = "PARAMETERS") @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public List<Serializable> getScriptParameters() { return scriptParameters; }
@Column(name = "PARAMETERS", length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public List<Serializable> getScriptParameters() { return scriptParameters; }
@Column(length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public Object[] getInfrastructureParameters() { return infrastructureParameters; }
@Column(length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public Object[] getPolicyParameters() { return policyParameters; }
@Column(length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public Client getProvider() { return provider; }
@Column(length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public Map<String, Serializable> getInfrastructureVariables() { return infrastructureVariables; }
@Column(length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public Client getOwner() { return owner; }
@Column(length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public Permission getUserPermission() { return userPermission; }
@Column(length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public NodeState getState() { return state; }
@Column(length = Integer.MAX_VALUE) @Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object")) public String[] getJmxUrls() { return jmxUrls; }