Package org.jboss.ejb.plugins.cmp.jdbc.metadata

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCUserTypeMappingMetaData


      CMPFieldStateFactory stateFactory;

      // if the state factory is not provided on the field level use the one from the user type mapping if any
      if(implClassName == null)
      {
         JDBCUserTypeMappingMetaData userMapping = (JDBCUserTypeMappingMetaData)factory.userTypeMappings.get(clazz.getName());
         if(userMapping != null)
         {
            implClassName = userMapping.getStateFactory();
         }
      }

      if(implClassName != null)
      {
View Full Code Here


   public static final boolean checkDirtyAfterGet(JDBCTypeFactory factory, byte checkDirtyAfterGet, Class fieldType)
   {
      boolean result;
      if(checkDirtyAfterGet == JDBCCMPFieldMetaData.CHECK_DIRTY_AFTER_GET_NOT_PRESENT)
      {
         JDBCUserTypeMappingMetaData userMapping = (JDBCUserTypeMappingMetaData)factory.
            userTypeMappings.get(fieldType.getName());
         if(userMapping != null &&
            userMapping.checkDirtyAfterGet() != JDBCCMPFieldMetaData.CHECK_DIRTY_AFTER_GET_NOT_PRESENT)
         {
            result = userMapping.checkDirtyAfterGet() == JDBCCMPFieldMetaData.CHECK_DIRTY_AFTER_GET_TRUE;
         }
         else
         {
            result = !isDefaultImmutable(fieldType);
         }
View Full Code Here

      else
      {
         JDBCTypeSimple type = (JDBCTypeSimple)mappedSimpleTypes.get(javaType);
         if(type == null)
         {
            JDBCUserTypeMappingMetaData userTypeMapping =
               (JDBCUserTypeMappingMetaData)userTypeMappings.get(javaType.getName());
            Mapper mapper = null;
            if(userTypeMapping != null)
            {
               ClassLoader cl = Thread.currentThread().getContextClassLoader();
               try
               {
                  javaType = cl.loadClass(userTypeMapping.getMappedType());
               }
               catch(ClassNotFoundException e)
               {
                  throw new IllegalStateException("Failed to load mapped type: " + userTypeMapping.getMappedType());
               }

               try
               {
                  mapper = (Mapper)newInstance(userTypeMapping.getMapper());
               }
               catch(DeploymentException e)
               {
                  throw new IllegalStateException("Failed to create Mapper instance of " + userTypeMapping.getMapper());
               }
            }

            JDBCMappingMetaData typeMappingMD = typeMapping.getTypeMappingMetaData(javaType);
            String sqlType = typeMappingMD.getSqlType();
View Full Code Here

      boolean notNull = cmpField.isNotNull();
      boolean autoIncrement = cmpField.isAutoIncrement();

      Mapper mapper = null;
      JDBCUserTypeMappingMetaData userTypeMapping = (JDBCUserTypeMappingMetaData)userTypeMappings.get(javaType.getName());
      if(userTypeMapping != null)
      {
         String mappedTypeStr = userTypeMapping.getMappedType();
         try
         {
            final ClassLoader contextClassLoader = TCLAction.UTIL.getContextClassLoader();
            Class mapperClass = contextClassLoader.loadClass(userTypeMapping.getMapper());
            mapper = (Mapper)mapperClass.newInstance();
            javaType = contextClassLoader.loadClass(mappedTypeStr);
            if(cmpField.getSQLType() == null)
            {
               JDBCMappingMetaData mappingMD = typeMapping.getTypeMappingMetaData(javaType);
               sqlType = mappingMD.getSqlType();
               jdbcType = mappingMD.getJdbcType();
               paramSetter = mappingMD.getParamSetter();
               resultReader = mappingMD.getResultReader();
            }
         }
         catch(ClassNotFoundException e)
         {
            throw new DeploymentException("Class not found for mapper: " + userTypeMapping.getMapper(), e);
         }
         catch(Exception e)
         {
            throw new DeploymentException("Could not instantiate mapper: " + userTypeMapping.getMapper(), e);
         }
      }

      JDBCParameterSetter paramSetterImpl;
      if(paramSetter == null)
View Full Code Here

/*     */   public static final CMPFieldStateFactory getCMPFieldStateFactory(JDBCTypeFactory factory, String implClassName, Class clazz)
/*     */     throws DeploymentException
/*     */   {
/* 217 */     if (implClassName == null)
/*     */     {
/* 219 */       JDBCUserTypeMappingMetaData userMapping = (JDBCUserTypeMappingMetaData)factory.userTypeMappings.get(clazz.getName());
/* 220 */       if (userMapping != null)
/*     */       {
/* 222 */         implClassName = userMapping.getStateFactory();
/*     */       }
/*     */     }
/*     */     CMPFieldStateFactory stateFactory;
/*     */     CMPFieldStateFactory stateFactory;
/* 226 */     if (implClassName != null)
View Full Code Here

/*     */   {
/*     */     boolean result;
/*     */     boolean result;
/* 272 */     if (checkDirtyAfterGet == 4)
/*     */     {
/* 274 */       JDBCUserTypeMappingMetaData userMapping = (JDBCUserTypeMappingMetaData)factory.userTypeMappings.get(fieldType.getName());
/*     */       boolean result;
/* 276 */       if ((userMapping != null) && (userMapping.checkDirtyAfterGet() != 4))
/*     */       {
/* 279 */         result = userMapping.checkDirtyAfterGet() == 1;
/*     */       }
/*     */       else
/*     */       {
/* 283 */         result = !isDefaultImmutable(fieldType);
/*     */       }
View Full Code Here

/*     */     }
/*     */
/* 442 */     JDBCTypeSimple type = (JDBCTypeSimple)this.mappedSimpleTypes.get(javaType);
/* 443 */     if (type == null)
/*     */     {
/* 445 */       JDBCUserTypeMappingMetaData userTypeMapping = (JDBCUserTypeMappingMetaData)this.userTypeMappings.get(javaType.getName());
/*     */
/* 447 */       Mapper mapper = null;
/* 448 */       if (userTypeMapping != null)
/*     */       {
/* 450 */         ClassLoader cl = Thread.currentThread().getContextClassLoader();
/*     */         try
/*     */         {
/* 453 */           javaType = cl.loadClass(userTypeMapping.getMappedType());
/*     */         }
/*     */         catch (ClassNotFoundException e)
/*     */         {
/* 457 */           throw new IllegalStateException("Failed to load mapped type: " + userTypeMapping.getMappedType());
/*     */         }
/*     */
/*     */         try
/*     */         {
/* 462 */           mapper = (Mapper)newInstance(userTypeMapping.getMapper());
/*     */         }
/*     */         catch (DeploymentException e)
/*     */         {
/* 466 */           throw new IllegalStateException("Failed to create Mapper instance of " + userTypeMapping.getMapper());
/*     */         }
/*     */       }
/*     */
/* 470 */       JDBCMappingMetaData typeMappingMD = this.typeMapping.getTypeMappingMetaData(javaType);
/* 471 */       String sqlType = typeMappingMD.getSqlType();
View Full Code Here

/*     */
/* 579 */     boolean notNull = cmpField.isNotNull();
/* 580 */     boolean autoIncrement = cmpField.isAutoIncrement();
/*     */
/* 582 */     Mapper mapper = null;
/* 583 */     JDBCUserTypeMappingMetaData userTypeMapping = (JDBCUserTypeMappingMetaData)this.userTypeMappings.get(javaType.getName());
/* 584 */     if (userTypeMapping != null)
/*     */     {
/* 586 */       String mappedTypeStr = userTypeMapping.getMappedType();
/*     */       try
/*     */       {
/* 589 */         ClassLoader contextClassLoader = TCLAction.UTIL.getContextClassLoader();
/* 590 */         Class mapperClass = contextClassLoader.loadClass(userTypeMapping.getMapper());
/* 591 */         mapper = (Mapper)mapperClass.newInstance();
/* 592 */         javaType = contextClassLoader.loadClass(mappedTypeStr);
/* 593 */         if (cmpField.getSQLType() == null)
/*     */         {
/* 595 */           JDBCMappingMetaData mappingMD = this.typeMapping.getTypeMappingMetaData(javaType);
/* 596 */           sqlType = mappingMD.getSqlType();
/* 597 */           jdbcType = mappingMD.getJdbcType();
/* 598 */           paramSetter = mappingMD.getParamSetter();
/* 599 */           resultReader = mappingMD.getResultReader();
/*     */         }
/*     */       }
/*     */       catch (ClassNotFoundException e)
/*     */       {
/* 604 */         throw new DeploymentException("Class not found for mapper: " + userTypeMapping.getMapper(), e);
/*     */       }
/*     */       catch (Exception e)
/*     */       {
/* 608 */         throw new DeploymentException("Could not instantiate mapper: " + userTypeMapping.getMapper(), e);
/*     */       }
/*     */     }
/*     */     JDBCParameterSetter paramSetterImpl;
/*     */     JDBCParameterSetter paramSetterImpl;
/* 613 */     if (paramSetter == null)
View Full Code Here

TOP

Related Classes of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCUserTypeMappingMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.