Search code examples
nhibernatellblgenprollblgen

Generating entity files into folders per schema with LLBLGenPro for NHibernate


We have a DB with multiple schemas with the same tables in the different schemas. Using LLBLGenPro to generate NHibernate entities. However, LLBLGenPro falls over, complaining that there are duplicate table names.

What we want is for the entities to be generated into namespaces per schema (got this working by modifying the templates), and for each schema to be generated into its own folder.

...?

Edit: A colleague of mine re-posted the question with some more information on the LLBLGen forums as per their request.


Solution

  • (please post questions about llblgen pro on our own forums at http://www.llblgen.com/tinyforum so our support team can pick them up, thanks)

    A DB with multiple schemas, you mean 1 catalog with multiple schemas (SQLServer) or multiple schemas as with Oracle?

    Anyway, this is supported. What is the exact error you got and when? Do you use the latest build? If not, please download the latest build.

    If you want to have entities grouped per target schema, you could group them in the project, and use the group in a custom template as a namespace.

    You can also use the grouping mechanism in the designer to generate a vs.net project per group which is done in its own namespace and folder. The downside of this is that relationships between entities in different groups aren't supported of course, so in that case you have to duplicate the entities.

    It's up to you what fits your project best.