Package nexj.core.meta.persistence.sql

Examples of nexj.core.meta.persistence.sql.RelationalPrimitiveDenorm


      if (mapping instanceof RelationalPrimitiveMapping)
      {
         for (int i = 0, n = mapping.getDenormCount(); i < n; ++i)
         {
            RelationalPrimitiveDenorm denorm = (RelationalPrimitiveDenorm)mapping.getDenorm(i);
            Column column = denorm.getColumn();
            SQLWork work = findWork(uow, instance, column.getTable());

            if (work != null)
            {
               work.setValue(column, value);
            }
         }
      }
      else
      {
         Instance assoc = null;

         if (value instanceof InstanceList)
         {
            InstanceList list = (InstanceList)value;

            if (!list.isEmpty())
            {
               assoc = list.getInstance(0);
            }
         }
         else
         {
            assoc = (Instance)value;
         }

         for (int i = 0, n = mapping.getDenormCount(); i < n; ++i)
         {
            RelationalClassDenorm denorm = (RelationalClassDenorm)mapping.getDenorm(i);
            Key dstKey = ((RelationalClassMapping)denorm.getMapping()).getDestinationKey();

            SQLWork work = findWork(uow, instance, denorm.getSourceKey().getTable());

            if (work != null)
            {
               if (assoc != null && assoc.getOID() == null)
               {
                  addDependency(uow, work, assoc, denorm.getSourceKey(), dstKey, true);
               }
               else
               {
                  work.setKeyValue(denorm.getSourceKey(), dstKey, assoc);
               }
            }
         }
      }
   }
View Full Code Here

TOP

Related Classes of nexj.core.meta.persistence.sql.RelationalPrimitiveDenorm

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.