Wednesday, May 30, 2007

To schema or not to schema...

Today we ran into a very practical problem. Should schema names be included in the NHibernate mapping ? Well it depends a little bit on your back end. In Oracle the username is the schema name. In SQL server you have the Database concept. (Northwind database for example.) For one customer we generated a NHibernate business object layer with table mapping like so:
class name = "Customers" table= "Abel.Customers"
However when moving to production, the Oracle User / Schema name was different. So our code did not work. All we needed to do is take of the Able schema part to make it work with the production connection string.
We have immediately decided to make this a GenWise Option for the Table item template. So now you can generate the mapping with or without schemanames

No comments: