I have prepared and attached a sample application which demonstrates one approach how to copy the data from one table to another table. There are two databases with one table that I have prepared for the sample and their scripts can be found in the attached zip. The table in the first database contains some rows and the table in the second database doesn't contain any rows.
For the sample I used two domain models created for each database. There are some modifications which I made in the domain model with the replica table.
1) There is a property "IdentityMechanism" for each Domain Class in the Visual Designer. This property has "DatabaseServerCalculated" value when the table uses the AutoIncremental mechanism for the Primary Key column. The value should be changed to default.
2) In the Model Settings dialog, in the Backend Configuration tab page, there is the Connection Pool tab which provides overview of the Connection Pool settings. In the Init SQL text box, you can specify an SQL statement which will be executed on each newly created connection. There I added the following SQL statement:
So when the connection is created the AutoIncremental mechanism for the replicatable will be disabled.
replicatable DISABLE KEYS
Unfortunately the Domain Model created for the replica database could be used only to copy the entities from the original table to the replica table. If you want to use a Domain Model which represents the database in its actual form(without any changes) you should use another Domain Model.
Please let me know if you have any questions.
OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.