private void BindSimpleValue(HbmDiscriminator discriminatorSchema, SimpleValue discriminator)
        {
            if (discriminatorSchema.type != null)
            {
                discriminator.TypeName = discriminatorSchema.type;
            }

            if (discriminatorSchema.formula != null)
            {
                var f = new Formula {
                    FormulaString = discriminatorSchema.formula
                };
                discriminator.AddFormula(f);
            }
            else
            {
                new ColumnsBinder(discriminator, Mappings).Bind(discriminatorSchema.Columns, false,
                                                                () =>
                                                                new HbmColumn
                {
                    name =
                        mappings.NamingStrategy.PropertyToColumnName(
                            RootClass.DefaultDiscriminatorColumnName),
                    length           = discriminatorSchema.length,
                    notnull          = discriminatorSchema.notnull,
                    notnullSpecified = true
                });
            }
        }
Beispiel #2
0
 public void linkWithValue(SimpleValue value)
 {
     if (formula != null)
     {
         value.AddFormula(formula);
     }
     else
     {
         MappingColumn.Value = value;
         value.AddColumn(MappingColumn);
         value.Table.AddColumn(MappingColumn);
         AddColumnBinding(value);
         table = value.Table;
     }
 }
        private void BindSimpleValue(HbmDiscriminator discriminatorSchema, SimpleValue discriminator)
        {
            if (discriminatorSchema.type != null)
            {
                discriminator.TypeName = discriminatorSchema.type;
            }

            if (discriminatorSchema.formula != null)
            {
                Formula f = new Formula();
                f.FormulaString = discriminatorSchema.formula;
                discriminator.AddFormula(f);
            }
            else
            {
                BindColumns(discriminatorSchema, discriminator);
            }
        }
 private void BindFormula(HbmFormula formula)
 {
     value.AddFormula(new Formula {
         FormulaString = formula.Text.LinesToString()
     });
 }