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); } }
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; } } }
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)); }
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)); }
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); }