Beispiel #1
0
        public virtual void RegisterEntity(Net.Vpc.Upa.Entity item, Net.Vpc.Upa.Package parent)
        {
            Net.Vpc.Upa.NamingStrategy namingStrategy = unit.GetNamingStrategy();
            string s = item.GetName();

            s = namingStrategy.GetUniformValue(s);
            Net.Vpc.Upa.Entity entity = (Net.Vpc.Upa.Entity)item;
            entities[s] = item;
            System.Type entityType = entity.GetEntityType();
            if (!entityManagerByEntityTypeAmbiguity.Contains(entityType))
            {
                if (entityManagerByEntityType.ContainsKey(entityType))
                {
                    entityManagerByEntityType.Remove(entityType);
                    entityManagerByEntityTypeAmbiguity.Add(entityType);
                }
                else
                {
                    entityManagerByEntityType[entityType] = entity;
                }
            }
            System.Type idType = Net.Vpc.Upa.Impl.Util.PlatformUtils.ToRefType(entity.GetIdType());
            if (!entityManagerByIdTypeAmbiguity.Contains(idType))
            {
                if (entityManagerByIdType.ContainsKey(idType))
                {
                    entityManagerByIdType.Remove(idType);
                    entityManagerByIdTypeAmbiguity.Add(idType);
                }
                else
                {
                    entityManagerByIdType[idType] = entity;
                }
            }
        }
Beispiel #2
0
        public virtual int CompareTo(object other)
        {
            if (other == this)
            {
                return(0);
            }
            if (other == null)
            {
                return(1);
            }
            Net.Vpc.Upa.Field          f    = (Net.Vpc.Upa.Field)other;
            Net.Vpc.Upa.NamingStrategy comp = GetEntity().GetPersistenceUnit().GetNamingStrategy();
            string s1 = entity != null?comp.GetUniformValue(entity.GetName()) : "";

            string s2 = f.GetName() != null?comp.GetUniformValue(f.GetEntity().GetName()) : "";

            int i = s1.CompareTo(s2);

            if (i != 0)
            {
                return(i);
            }
            else
            {
                string s3 = GetName() != null?comp.GetUniformValue(GetName()) : "";

                string s4 = f.GetName() != null?comp.GetUniformValue(f.GetName()) : "";

                i = s3.CompareTo(s4);
                return(i);
            }
        }
Beispiel #3
0
        public virtual bool ContainsEntity(Net.Vpc.Upa.Entity item, Net.Vpc.Upa.Package parent)
        {
            Net.Vpc.Upa.NamingStrategy namingStrategy = unit.GetNamingStrategy();
            string s = item.GetName();

            s = namingStrategy.GetUniformValue(s);
            return(entities.ContainsKey(s));
        }
Beispiel #4
0
        public virtual Net.Vpc.Upa.Entity FindEntity(string name) /* throws Net.Vpc.Upa.Exceptions.UPAException */
        {
            Net.Vpc.Upa.NamingStrategy namingStrategy = unit.GetNamingStrategy();
            string s = name;

            name = namingStrategy.GetUniformValue(s);
            return(Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <string, Net.Vpc.Upa.Entity>(entities, name));
        }
Beispiel #5
0
        public virtual Net.Vpc.Upa.Entity GetEntity(string name) /* throws Net.Vpc.Upa.Exceptions.UPAException */
        {
            Net.Vpc.Upa.NamingStrategy namingStrategy = unit.GetNamingStrategy();
            string s = name;

            name = namingStrategy.GetUniformValue(s);
            Net.Vpc.Upa.Entity item = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <string, Net.Vpc.Upa.Entity>(entities, name);
            if (item == null)
            {
                throw new Net.Vpc.Upa.Exceptions.NoSuchEntityException(s, null);
            }
            return(item);
        }