Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the working code.</p> <pre><code>private static ISessionFactory CreateSessionFactory() { try { var cfg = OracleClientConfiguration.Oracle10.ConnectionString(c =&gt; c.Is("Data Source=XXXXXXX;User ID=XXXXX;Password=XXXX;")); FluentConfiguration configuration = Fluently.Configure() .Database(cfg) .Mappings(m =&gt; m.AutoMappings.Add(CreateAutomappings)) .ExposeConfiguration(x =&gt; x.SetProperty("hbm2ddl.keywords", "auto-quote")) .ExposeConfiguration(BuildSchema); return configuration.BuildSessionFactory(); } catch (Exception ex) { Console.WriteLine(ex.InnerException.Message); throw ex; } } </code></pre> <p>Remember.. You still need to limit the column length to 30 characters. I have modified the IColumnInstances to add ColumnName method and added a Convention. Here is the code for that</p> <p>Add this code in ColumnInstance class of FluentNHibernate. I have also added the respective interface methods.</p> <pre><code> public void ColumnName(string columnname) { mapping.Set(x =&gt; x.Name, Layer.Conventions, columnname); } </code></pre> <p>Add this implementation code in your code.</p> <pre><code>public class ColumnNameConvention : IColumnConvention, IColumnConventionAcceptance { public void Accept(IAcceptanceCriteria&lt;IColumnInspector&gt; criteria) { criteria.Expect(x =&gt; x.Name.Length &gt; 30); } public void Apply(IColumnInstance instance) { try { instance.ColumnName(instance.Name.Substring(instance.Name.Length - 25, 25)); } catch (System.Exception ex) { throw ex; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload