Exemplo n.º 1
0
        IPersistentAssociationAttribute GetPersistentAssociationAttribute(Column column)
        {
            var persistentAssociationAttribute = _objectSpace.CreateWCObject <IPersistentAssociationAttribute>();

            persistentAssociationAttribute.AssociationName = _foreignKeyCalculator.GetForeignKeyName(column.Name, (Table)column.Parent);
            return(persistentAssociationAttribute);
        }
Exemplo n.º 2
0
        IPersistentCoreTypeMemberInfo CreatePersistentCoreTypeMemberInfo(Column column, IPersistentClassInfo owner, TemplateType templateType)
        {
            var persistentCoreTypeMemberInfo = _objectSpace.CreateWCObject <IPersistentCoreTypeMemberInfo>();

            persistentCoreTypeMemberInfo.Name     = column.Name;
            persistentCoreTypeMemberInfo.DataType = _dataTypeMapper.GetDataType(column);
            owner.OwnMembers.Add(persistentCoreTypeMemberInfo);
            persistentCoreTypeMemberInfo.SetDefaultTemplate(templateType);
            return(persistentCoreTypeMemberInfo);
        }
Exemplo n.º 3
0
        public void CreateCollection(IPersistentReferenceMemberInfo persistentReferenceMemberInfo, IPersistentClassInfo owner)
        {
            var persistentCollectionMemberInfo = _objectSpace.CreateWCObject <IPersistentCollectionMemberInfo>();

            persistentReferenceMemberInfo.ReferenceClassInfo.OwnMembers.Add(persistentCollectionMemberInfo);
            persistentCollectionMemberInfo.Name  = persistentReferenceMemberInfo.Owner.Name + persistentReferenceMemberInfo.Name + "s";
            persistentCollectionMemberInfo.Owner = persistentReferenceMemberInfo.ReferenceClassInfo;
            persistentCollectionMemberInfo.CollectionClassInfo = owner;
            persistentCollectionMemberInfo.SetDefaultTemplate(TemplateType.XPCollectionMember);
            var persistentAssociationAttribute = _objectSpace.CreateWCObject <IPersistentAssociationAttribute>();

            persistentCollectionMemberInfo.TypeAttributes.Add(persistentAssociationAttribute);
            persistentAssociationAttribute.AssociationName = persistentReferenceMemberInfo.TypeAttributes.OfType <IPersistentAssociationAttribute>().Single().AssociationName;
        }
Exemplo n.º 4
0
        IPersistentClassInfo CreateNew(string name)
        {
            var persistentClassInfo = _objectSpace.CreateWCObject <IPersistentClassInfo>();

            persistentClassInfo.Name = name;
            return(persistentClassInfo);
        }