@Override public BasicType basic(String name) { return typeResolver.basic( name ); }
@Override public BasicType basic(Class javaType) { BasicType type = typeResolver.basic( javaType.getName() ); if ( type == null ) { final Class variant = resolvePrimitiveOrPrimitiveWrapperVariantJavaType( javaType ); if ( variant != null ) { type = typeResolver.basic( variant.getName() ); } } return type; }
private boolean isRegisteredAsBasicType(Class cl) { return producer.getFactory().getTypeResolver().basic( cl.getName() ) != null; } }
Type type = basic( typeName ); if ( type != null ) { return type;
private NativeSQLQuerySpecification createSpec() { String blah = "blah"; String select = "select blah from blah"; NativeSQLQueryReturn[] queryReturns = new NativeSQLQueryScalarReturn[] { new NativeSQLQueryScalarReturn( blah, sessionFactory().getTypeResolver().basic( "int" ) ) }; return new NativeSQLQuerySpecification( select, queryReturns, null ); } }
@Test public void testExtensionPoints() throws Exception { final ServiceReference sr = bundleContext.getServiceReference( SessionFactory.class.getName() ); final SessionFactoryImplementor sfi = (SessionFactoryImplementor) bundleContext.getService( sr ); assertTrue( TestIntegrator.passed() ); Class impl = sfi.getServiceRegistry().getService( StrategySelector.class ).selectStrategyImplementor( Calendar.class, TestStrategyRegistrationProvider.GREGORIAN ); assertNotNull( impl ); BasicType basicType = sfi.getTypeResolver().basic( TestTypeContributor.NAME ); assertNotNull( basicType ); }
&& simpleValue.getMetadata().getTypeResolver().basic( simpleValue.getTypeName() ) == null ) { try { Class typeClass = buildingContext.getBootstrapContext().getClassLoaderAccess().classForName( simpleValue.getTypeName() );
private void resolveLob(final SingularAttributeSourceBasic attributeSource, SimpleValue value) { // Resolves whether the property is LOB based on the type attribute on the attribute property source. // Essentially this expects the type to map to a CLOB/NCLOB/BLOB sql type internally and compares. if ( !value.isLob() && value.getTypeName() != null ) { final TypeResolver typeResolver = attributeSource.getBuildingContext().getMetadataCollector().getTypeResolver(); final BasicType basicType = typeResolver.basic( value.getTypeName() ); if ( basicType instanceof AbstractSingleColumnStandardBasicType ) { if ( isLob( ( (AbstractSingleColumnStandardBasicType) basicType ).getSqlTypeDescriptor().getSqlType(), null ) ) { value.makeLob(); } } } // If the prior check didn't set the lob flag, this will inspect the column sql-type attribute value and // if this maps to CLOB/NCLOB/BLOB then the value will be marked as lob. if ( !value.isLob() ) { for ( RelationalValueSource relationalValueSource : attributeSource.getRelationalValueSources() ) { if ( ColumnSource.class.isInstance( relationalValueSource ) ) { if ( isLob( null, ( (ColumnSource) relationalValueSource ).getSqlType() ) ) { value.makeLob(); } } } } }
/** * {@inheritDoc} */ public BasicType basic(String name) { return typeResolver.basic( name ); }
/** * {@inheritDoc} */ public BasicType basic(String name) { return typeResolver.basic( name ); }
/** * {@inheritDoc} */ public BasicType basic(Class javaType) { BasicType type = typeResolver.basic( javaType.getName() ); if ( type == null ) { final Class variant = resolvePrimitiveOrPrimitiveWrapperVariantJavaType( javaType ); if ( variant != null ) { type = typeResolver.basic( variant.getName() ); } } return type; }
/** * {@inheritDoc} */ public BasicType basic(Class javaType) { BasicType type = typeResolver.basic( javaType.getName() ); if ( type == null ) { final Class variant = resolvePrimitiveOrPrimitiveWrapperVariantJavaType( javaType ); if ( variant != null ) { type = typeResolver.basic( variant.getName() ); } } return type; }
@SuppressWarnings("unchecked") public static boolean supports(@SuppressWarnings("rawtypes") Class enumClass) { if (!isEnabled()) return false; if (GrailsClassUtils.isJdk5Enum(enumClass)) { try { Method idAccessor = enumClass.getMethod(ENUM_ID_ACCESSOR); int mods = idAccessor.getModifiers(); if (Modifier.isPublic(mods) && !Modifier.isStatic(mods)) { Class<?> returnType = idAccessor.getReturnType(); return returnType != null && typeResolver.basic(returnType.getName()) instanceof AbstractStandardBasicType; } } catch (NoSuchMethodException e) { // ignore } } return false; }
@SuppressWarnings("unchecked") public void setParameterValues(Properties properties) { try { enumClass = (Class<? extends Enum<?>>)Thread.currentThread().getContextClassLoader().loadClass( (String)properties.get(PARAM_ENUM_CLASS)); if (LOG.isDebugEnabled()) { LOG.debug(String.format("Building ID-mapping for Enum Class %s", enumClass.getName())); } bidiMap = getBidiEnumMap(enumClass); type = (AbstractStandardBasicType<?>)typeResolver.basic(bidiMap.keyType.getName()); if (LOG.isDebugEnabled()) { LOG.debug(String.format("Mapped Basic Type is %s", type)); } sqlTypes = type.sqlTypes(null); } catch (Exception e) { throw new MappingException("Error mapping Enum Class using IdentifierEnumType", e); } }
Type type = basic( typeName ); if ( type != null ) { return type;
Type type = basic( typeName ); if ( type != null ) { return type;
Type intermediaryORMType = typeResolver.basic( databaseColumnJavaType.getName() ); if ( intermediaryORMType == null ) { throw log.cannotFindTypeForAttributeConverter( specificType.getAttributeConverter().getClass(), databaseColumnJavaType );
if (sqlFunction != null) { TypeResolver typeResolver = getTypeResolver(sessionFactory); BasicType basic = typeResolver.basic(pp.getType().getName()); if (basic != null && datastoreCriterion instanceof PropertyCriterion) { Object value = pc.getValue(); if (value != null) { sqlRestriction = Restrictions.sqlRestriction(root + op + "?", value, typeResolver.basic(value.getClass().getName()));
if (sqlFunction != null) { TypeResolver typeResolver = impl.getTypeResolver(); BasicType basic = typeResolver.basic(pp.getType().getName()); if (basic != null && datastoreCriterion instanceof PropertyCriterion) { Object value = pc.getValue(); if (value != null) { sqlRestriction = Restrictions.sqlRestriction(root + op + "?", value, typeResolver.basic(value.getClass().getName()));
Type type = mappings.getTypeResolver().basic(className); if (type != null) { typeName = type.getName();