示例#1
0
 public EntityFacade(CslaGeneratorUnit parent)
     : base(parent)
 {
     if (parent != null && parent.Params != null)
     {
         Parent = parent;
     }
 }
示例#2
0
        public AssociativeEntity(CslaGeneratorUnit parent)
            : base(parent)
        {
            MainLazyLoad           = true;
            SecondaryLazyLoad      = true;
            MainLoadingScheme      = LoadingScheme.ParentLoad;
            SecondaryLoadingScheme = LoadingScheme.ParentLoad;

            if (parent != null && parent.Params != null)
            {
                Parent       = parent;
                _cslaObjects = Parent.CslaObjects;
            }
        }
        /// <summary>
        /// Initializes a new instance of the ObjectFactory class.
        /// </summary>
        /// <param name="currentUnit">The current unit.</param>
        /// <param name="entity">The associative entity.</param>
        public ObjectRelationsFactory(CslaGeneratorUnit currentUnit, AssociativeEntity entity)
        {
            _currentUnit               = currentUnit;
            _cslaObjects               = _currentUnit.CslaObjects;
            _entity                    = entity;
            MainObjectInfo             = _cslaObjects.Find(_entity.MainObject);
            MainRootCriteriaProperties = GetCriteriaProperties(MainObjectInfo);

            if (entity.RelationType == ObjectRelationType.ManyToMany)
            {
                SecondaryObjectInfo             = _cslaObjects.Find(_entity.SecondaryObject);
                SecondaryRootCriteriaProperties = GetCriteriaProperties(SecondaryObjectInfo);

                _associativeTable = FindAssociativeTable(MainObjectInfo, SecondaryObjectInfo);

                _resultSet = new TableResultSet(
                    _associativeTable.ResultIndex,
                    _associativeTable.Columns,
                    _associativeTable.Type);

                _dbObject = new TableDataBaseObject(
                    _associativeTable.ObjectCatalog,
                    _associativeTable.ObjectName,
                    _associativeTable.ObjectSchema,
                    _associativeTable.Catalog);
            }
            else
            {
                var mainItemObjectInfo = _cslaObjects.Find(_entity.MainItemTypeName);

                _associatedTable = FindAssociatedTable(MainObjectInfo, mainItemObjectInfo);

                _resultSet = new TableResultSet(
                    _associatedTable.ResultIndex,
                    _associatedTable.Columns,
                    _associatedTable.Type);

                _dbObject = new TableDataBaseObject(
                    _associatedTable.ObjectCatalog,
                    _associatedTable.ObjectName,
                    _associatedTable.ObjectSchema,
                    _associatedTable.Catalog);
            }
        }
示例#4
0
            public EntityFacade(CslaGeneratorUnit parent, ObjectRelationType relationType, string objectName,
                                string propertyName, string collectionTypeName, string itemTypeName, LoadingScheme loadingScheme,
                                CriteriaPropertyCollection loadProperties, ParameterCollection loadParameters, bool lazyLoad)
                : base(parent)
            {
                RelationType       = relationType;
                ObjectName         = objectName;
                PropertyName       = propertyName;
                CollectionTypeName = collectionTypeName;
                ItemTypeName       = itemTypeName;
                LazyLoad           = lazyLoad;
                LoadingScheme      = loadingScheme;
                LoadProperties     = CriteriaPropertyCollection.Clone(loadProperties);
                LoadParameters     = loadParameters;

                if (parent != null && parent.Params != null)
                {
                    Parent = parent;
                }
            }
 public CslaGeneratorComponent(CslaGeneratorUnit parent)
 {
     _parent = parent;
 }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the ObjectFactory class.
 /// </summary>
 /// <param name="currentUnit"></param>
 /// <param name="type"></param>
 public ObjectFactory(CslaGeneratorUnit currentUnit, CslaObjectType type)
 {
     _currentUnit                  = currentUnit;
     _currentCslaObject            = new CslaObjectInfo(_currentUnit);
     _currentCslaObject.ObjectType = type;
 }
示例#7
0
 /// <summary>
 /// Initializes a new instance of the ObjectFactory class.
 /// </summary>
 /// <param name="currentUnit"></param>
 /// <param name="currentCslaObject"></param>
 public ObjectFactory(CslaGeneratorUnit currentUnit, CslaObjectInfo currentCslaObject)
 {
     _currentUnit       = currentUnit;
     _currentCslaObject = currentCslaObject;
 }