Package org.jboss.ejb.plugins.cmp.jdbc2.schema

Examples of org.jboss.ejb.plugins.cmp.jdbc2.schema.Schema


            foreignKeyFields[i].setValueInternal(ctx, null, fkConstraint == null);
         }

         if(fkConstraint != null)
         {
            PersistentContext pctx = (PersistentContext)ctx.getPersistenceContext();
            pctx.nullForeignKey(fkConstraint);
         }
      }
View Full Code Here


            foreignKeyFields[i].setValueInternal(ctx, fieldValue, markDirty);
         }

         if(fkConstraint != null)
         {
            PersistentContext pctx = (PersistentContext)ctx.getPersistenceContext();
            if(relatedId == null)
            {
               pctx.nullForeignKey(fkConstraint);
            }
            else
            {
               pctx.nonNullForeignKey(fkConstraint);
            }
         }
      }
View Full Code Here

/*     */     }
/*     */   }
/*     */
/*     */   public void initInstance(EntityEnterpriseContext ctx)
/*     */   {
/* 234 */     ctx.setPersistenceContext(new PersistentContext(this, this.table.getRow(ctx.getId())));
/* 235 */     for (int i = 0; i < this.tableFields.length; i++)
/*     */     {
/* 237 */       this.tableFields[i].initInstance(ctx);
/*     */     }
/*     */
View Full Code Here

/* 267 */     return fields;
/*     */   }
/*     */
/*     */   public boolean isStoreRequired(EntityEnterpriseContext instance)
/*     */   {
/* 272 */     PersistentContext pctx = (PersistentContext)instance.getPersistenceContext();
/* 273 */     return pctx.isDirty();
/*     */   }
View Full Code Here

/* 273 */     return pctx.isDirty();
/*     */   }
/*     */
/*     */   public boolean isModified(EntityEnterpriseContext instance)
/*     */   {
/* 278 */     PersistentContext pctx = (PersistentContext)instance.getPersistenceContext();
/* 279 */     boolean modified = pctx.isDirty();
/*     */
/* 281 */     if ((!modified) && (this.cmrFields != null))
/*     */     {
/* 283 */       for (int i = 0; i < this.cmrFields.length; i++)
/*     */       {
/* 285 */         JDBCCMRFieldBridge2.FieldState cmrState = pctx.getCMRState(i);
/* 286 */         if ((cmrState == null) || (!cmrState.isModified()))
/*     */           continue;
/* 288 */         modified = true;
/* 289 */         break;
/*     */       }
View Full Code Here

/* 1033 */       return this.value;
/*      */     }
/*      */
/*      */     public void cacheValue(EntityEnterpriseContext ctx)
/*      */     {
/* 1038 */       PersistentContext pctx = (PersistentContext)ctx.getPersistenceContext();
/* 1039 */       pctx.cacheRelations(JDBCCMRFieldBridge2.this.cmrIndex, this);
/*      */     }
View Full Code Here

/* 1080 */       return this.value;
/*      */     }
/*      */
/*      */     private void loadOnlyFromCache(EntityEnterpriseContext ctx)
/*      */     {
/* 1085 */       PersistentContext pctx = (PersistentContext)ctx.getPersistenceContext();
/* 1086 */       if (pctx == null)
/*      */       {
/* 1088 */         throw new EJBException("Persistence context is not available! Make sure the CMR collection is accessed in the transaction it was obtained.");
/*      */       }
/* 1090 */       pctx.loadCachedRelations(JDBCCMRFieldBridge2.this.cmrIndex, this);
/*      */     }
View Full Code Here

/*  809 */       return this.value == null ? NULL_VALUE : this.value;
/*      */     }
/*      */
/*      */     public void cacheValue(EntityEnterpriseContext ctx)
/*      */     {
/*  814 */       PersistentContext pctx = (PersistentContext)ctx.getPersistenceContext();
/*  815 */       pctx.cacheRelations(JDBCCMRFieldBridge2.this.cmrIndex, this);
/*      */     }
View Full Code Here

/*      */
/*      */     private Object getLoadedValue(EntityEnterpriseContext ctx)
/*      */     {
/*  834 */       if (!this.loaded)
/*      */       {
/*  836 */         PersistentContext pctx = (PersistentContext)ctx.getPersistenceContext();
/*  837 */         pctx.loadCachedRelations(JDBCCMRFieldBridge2.this.cmrIndex, this);
/*  838 */         if (!this.loaded)
/*      */         {
/*  840 */           JDBCCMRFieldBridge2.this.loader.load(ctx, this);
/*  841 */           this.loaded = true;
/*  842 */           cacheValue(ctx);
View Full Code Here

/*      */     }
/*      */   }
/*      */
/*      */   private FieldState getFieldState(EntityEnterpriseContext ctx)
/*      */   {
/*  533 */     PersistentContext pctx = (PersistentContext)ctx.getPersistenceContext();
/*  534 */     FieldState state = pctx.getCMRState(this.cmrIndex);
/*  535 */     if (state == null)
/*      */     {
/*  537 */       if (isSingleValued())
/*      */       {
/*  539 */         state = new SingleValuedFieldState();
/*      */       }
/*      */       else
/*      */       {
/*  543 */         state = new CollectionValuedFieldState();
/*      */       }
/*  545 */       pctx.setCMRState(this.cmrIndex, state);
/*      */     }
/*  547 */     return state;
/*      */   }
View Full Code Here

TOP

Related Classes of org.jboss.ejb.plugins.cmp.jdbc2.schema.Schema

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.