How not to include Oracle Schema name in Fluent Nhibernate code

Posts   
 
    
samy
User
Posts: 18
Joined: 16-Sep-2011
# Posted on: 07-Nov-2011 17:53:42   

I'm certainly missing this parameter but i've searched for a parameter allowing me to generate the fluent nHibernate code for an Oracle Database without the schema name as prefix.

For example, instead of a mapping with

public ContactMap()
        {
            Table("\"ENVIRO\".\"CONTACT\"");

i'd like to have a mapping like this

public ContactMap()
        {
            Table("\"CONTACT\"");

Is it possible, and how?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 08-Nov-2011 03:17:15   

There is no setting for that. The target is generated in full-name form because otherwise you could mix schemas when you add multiple schemas to your LLBLGen project.

Is there any reason why you want it this way? The only way to change it right now would be modifying the default templates, but that is not recommended.

David Elizondo | LLBLGen Support Team
samy
User
Posts: 18
Joined: 16-Sep-2011
# Posted on: 08-Nov-2011 10:19:26   

daelmo wrote:

Is there any reason why you want it this way? The only way to change it right now would be modifying the default templates, but that is not recommended.

I reverse-engineered a database from an Oracle schema and built my application against it, but the client apparently didn't prepare for the schema to be modified for the test phase. So instead of working against the "ENVIRO" schema he wants the app to work against the "ENVIROWHATEVER" schema. So i'd like to generate the code without the schema information and let the connection string specify the user (and therefore the schema)

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 08-Nov-2011 12:07:59   

As David said, there is no setting for that, you may change the code generation template to remove the schema name.

Change the last overload of the ProduceTargetFullName() method in the generalTemplateUtils.lpt, to use string.Empty instead of the schemaName.

samy
User
Posts: 18
Joined: 16-Sep-2011
# Posted on: 08-Nov-2011 16:20:47   

Thanks for the info! I think that's all i needed

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 09-Nov-2011 11:25:54   

v3.5 will have a setting for this, as it's indeed a bit of a problem for some DB's. Sorry for this inconvenience at this point in the current version.

Frans Bouma | Lead developer LLBLGen Pro