Examples of JDBCCMPFieldMetaData


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

/*      */
/*  168 */     JDBCOptimisticLockingMetaData lockMetaData = this.metadata.getOptimisticLocking();
/*  169 */     if ((lockMetaData != null) && (lockMetaData.getLockingField() != null))
/*      */     {
/*  171 */       Integer strategy = lockMetaData.getLockingStrategy();
/*  172 */       JDBCCMPFieldMetaData versionMD = lockMetaData.getLockingField();
/*      */
/*  174 */       this.versionField = getCMPFieldByName(versionMD.getFieldName());
/*  175 */       boolean hidden = this.versionField == null;
/*  176 */       if (strategy == JDBCOptimisticLockingMetaData.VERSION_COLUMN_STRATEGY)
/*      */       {
/*  178 */         if (hidden)
/*  179 */           this.versionField = new JDBCLongVersionFieldBridge(this.manager, versionMD);
/*      */         else
/*  181 */           this.versionField = new JDBCLongVersionFieldBridge((JDBCCMP2xFieldBridge)this.versionField);
/*      */       }
/*  183 */       else if (strategy == JDBCOptimisticLockingMetaData.TIMESTAMP_COLUMN_STRATEGY)
/*      */       {
/*  185 */         if (hidden)
/*  186 */           this.versionField = new JDBCTimestampVersionFieldBridge(this.manager, versionMD);
/*      */         else
/*  188 */           this.versionField = new JDBCTimestampVersionFieldBridge((JDBCCMP2xFieldBridge)this.versionField);
/*      */       }
/*  190 */       else if (strategy == JDBCOptimisticLockingMetaData.KEYGENERATOR_COLUMN_STRATEGY)
/*      */       {
/*  192 */         if (hidden) {
/*  193 */           this.versionField = new JDBCKeyGenVersionFieldBridge(this.manager, versionMD, lockMetaData.getKeyGeneratorFactory());
/*      */         }
/*      */         else {
/*  196 */           this.versionField = new JDBCKeyGenVersionFieldBridge((JDBCCMP2xFieldBridge)this.versionField, lockMetaData.getKeyGeneratorFactory());
/*      */         }
/*      */       }
/*      */
/*  200 */       if (hidden)
/*  201 */         addCMPField(this.versionField);
/*      */       else {
/*  203 */         this.tableFields[this.versionField.getTableIndex()] = this.versionField;
/*      */       }
/*      */     }
/*      */
/*  207 */     JDBCAuditMetaData auditMetaData = this.metadata.getAudit();
/*  208 */     if (auditMetaData != null)
/*      */     {
/*  210 */       JDBCCMPFieldMetaData auditField = auditMetaData.getCreatedPrincipalField();
/*  211 */       if (auditField != null)
/*      */       {
/*  213 */         this.createdPrincipalField = getCMPFieldByName(auditField.getFieldName());
/*  214 */         if (this.createdPrincipalField == null)
/*      */         {
/*  216 */           this.createdPrincipalField = new JDBCCMP2xFieldBridge(this.manager, auditField);
/*  217 */           addCMPField(this.createdPrincipalField);
/*      */         }
/*      */       }
/*      */       else
/*      */       {
/*  222 */         this.createdPrincipalField = null;
/*      */       }
/*      */
/*  225 */       auditField = auditMetaData.getCreatedTimeField();
/*  226 */       if (auditField != null)
/*      */       {
/*  228 */         this.createdTimeField = getCMPFieldByName(auditField.getFieldName());
/*  229 */         if (this.createdTimeField == null)
/*      */         {
/*  231 */           this.createdTimeField = new JDBCCMP2xFieldBridge(this.manager, auditField, JDBCTypeFactory.EQUALS, false);
/*  232 */           addCMPField(this.createdTimeField);
/*      */         }
/*      */         else
/*      */         {
/*  237 */           this.createdTimeField = new JDBCCMP2xFieldBridge((JDBCCMP2xFieldBridge)this.createdTimeField, JDBCTypeFactory.EQUALS, false);
/*      */
/*  239 */           this.tableFields[this.createdTimeField.getTableIndex()] = this.createdTimeField;
/*      */         }
/*      */       }
/*      */       else
/*      */       {
/*  244 */         this.createdTimeField = null;
/*      */       }
/*      */
/*  247 */       auditField = auditMetaData.getUpdatedPrincipalField();
/*  248 */       if (auditField != null)
/*      */       {
/*  250 */         this.updatedPrincipalField = getCMPFieldByName(auditField.getFieldName());
/*  251 */         if (this.updatedPrincipalField == null)
/*      */         {
/*  253 */           this.updatedPrincipalField = new JDBCCMP2xUpdatedPrincipalFieldBridge(this.manager, auditField);
/*  254 */           addCMPField(this.updatedPrincipalField);
/*      */         }
/*      */         else
/*      */         {
/*  258 */           this.updatedPrincipalField = new JDBCCMP2xUpdatedPrincipalFieldBridge((JDBCCMP2xFieldBridge)this.updatedPrincipalField);
/*      */
/*  260 */           this.tableFields[this.updatedPrincipalField.getTableIndex()] = this.updatedPrincipalField;
/*      */         }
/*      */       }
/*      */       else
/*      */       {
/*  265 */         this.updatedPrincipalField = null;
/*      */       }
/*      */
/*  268 */       auditField = auditMetaData.getUpdatedTimeField();
/*  269 */       if (auditField != null)
/*      */       {
/*  271 */         this.updatedTimeField = getCMPFieldByName(auditField.getFieldName());
/*  272 */         if (this.updatedTimeField == null)
/*      */         {
/*  274 */           this.updatedTimeField = new JDBCCMP2xUpdatedTimeFieldBridge(this.manager, auditField);
/*  275 */           addCMPField(this.updatedTimeField);
/*      */         }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.