Exemplo n.º 1
0
        public MapeamentoCarga(PropertyInfo prop, int ordinal, DBMappedClass mapeamento, string mapeadopara)
        {
            IdsChaveEstrangeira = new Dictionary <long, object>();

            Prop = prop;

            PropName    = prop.Name;
            Ordinal     = ordinal;
            TipoCarga   = TipoPropriedade.Dominio;
            Mapeamento  = mapeamento;
            MapeadoPara = mapeadopara;
        }
Exemplo n.º 2
0
            private string ForeignKey(DBMappedClass map, PropertyInfo prop)
            {
                DBMappedClass referenceMap  = GetClassMap(prop.PropertyType);
                Map           propReference = null;

                string[] args = new string[] { (DatabaseContext == SupportedDatabases.MySQL ? map.Table.ToLower() : map.Table)
                                               , referenceMap.Table
                                               , ((propReference = GetPropMap(prop, typeof(DBMappedTo))) != null ? ((DBMappedTo)propReference).Column : "Id" + prop.Name)
                                               , referenceMap.PrimaryKey };

                if (DatabaseContext == SupportedDatabases.SQLServer)
                {
                    return(string.Format(SqlScriptMaker.SQLServerFK, args));
                }
                else if (DatabaseContext == SupportedDatabases.MySQL)
                {
                    return(string.Format(SqlScriptMaker.MySqlFK, args));
                }
                else
                {
                    throw new DBBrokerException("Unknown database context. ");
                }
            }
Exemplo n.º 3
0
 public Relationship(DBMappedList map, DBMappedClass parentMap, DBMappedClass childrenMap)
 {
     Map         = map;
     ParentMap   = parentMap;
     ChildrenMap = childrenMap;
 }