Creating Help Fluent NHibernate creates an oracle sequence for each table

I am using the Fluent NHibernate (1.0 RTM) automatic function to create my oracle database schema. My problem is that all tables use the same "sleep sequence", while I would prefer (and my boss required) a sequence generator for each table.

Any ideas?

+4
source share
1 answer

I managed to solve my own decision. Here is the code:

public class OraclePrimaryKeySequenceConvention : IIdConvention { public void Apply(IIdentityInstance instance) { instance.GeneratedBy.Sequence(string.Format("Sequence_{0}", instance.EntityType.Name)); } } 

Yay. :-)

+8
source

Source: https://habr.com/ru/post/1309869/


All Articles