Phuzakie wrote:
Otis wrote:
Though, do you use 2 or more customer schemas in one application at runtime? If not, you can simply create the application for one customer schema, and use schema overwriting at runtime to connect to a different customer schema. So all references to customer1schema in the code will then be redirected by llblgen pro to customer2schema while all references to yoursharedappschema will stay referencing that schema.
We have one web based app that will touch more than one customer schema at a time, but I am planning the data retrieval through views, but there will be specific times where I will need to load a vehicle from a certain customer for editing.
Then use adapter, and use adapter's abilities to set the schema name overwriting name to use per adapter instance. So you follow these steps:
- create an instance of DataAccessAdapter by setting the name of the schema to use in the CTor of DataAccessAdapter
- fetch your entity
- dispose DataAccessAdapter.
SelfServicing isn't suitable for this, as described in the manual.
I guess what I was originally looking for was a way in LLBL that I could edit an entity and give it a more defined namespace than the base namespace.
So if my base namespace is Server.Framework and I gave an entity the name of vehicle and a namespace of Server.Framework.CustomerOne, when I generated the project it would make the entity with the namespace specified, not the base.
Another thought I had... maybe I could inject the schema name, into the entity object name through a filter when I add a entity to a project.
Having the two customer schemas in the same project would limit your flexibility if there would be a 3rd customer added to the project. With schema name overwriting per call (using adapter), you can create a project with just the core and the 1st customer schema and just add another schema for customer2 which you target using schema name overwriting through the ctor of DataAccessAdapter.
Just give it a try in a small testproject with 3 tables: one in core, one in schema for customer1 and one in the schema for customer2 and create a project with core and schema for customer1 in the project, generated code (adapter) and try to fetch/save entities in schema for customer1 (no name overwriting, or use the name for that schema anyway) and in schema for customer2 by using name overwriting through the CTor of DataAccessAdapter, just to get the idea how it works.