4

I am using Fluent NHibernate's (1.0 RTM) automapping feature to create my oracle database schema. My issue is that all the tables are using a single "hibernate-sequence", whereas I would prefer (and my boss would demand) a sequence generator for each table.

Any ideas?

1 Answer 1

8

Managed to solve my own solution. Here's the code:

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

Yay. :-)

Sign up to request clarification or add additional context in comments.

1 Comment

Been a while, but how would I use this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.