Yes I know that is not the best practice. When using Xaf or Xpo you should first design your objects and let the framework create the database schema based on objects metadata (attributes). But there are many cases that the database is already design and you can not change it.
What about those projects?
Are you going to say to your customer that you do not want that project?
Are you going to sit down and write all classes by hand?
The best solution on this is to use some Template engine like Codesmith to create the initial implementation for you and then you can change them to meet your needs. You can also find a freeware version of Codesmith here
Devexpress also has a persistent class generation Util which ca be invoked from the add new item form
but has limited functionality doesn’t create associations, tables with more than one primary keys, knows nothing on xaf and is not at all flexible .
Aristeidis the guy with the beers that day share also his codesmith xaf templates with me you can download them . These templates are not perfect we just share them with you and if you implement more features would could also share back with us.
I will try to apply those templates to Northwind sample database. Northwind has 3 intermediate tables which are CustomerCustomerDemo,Order Details and EmployeeTerritories and I am very interested to know how its going to behave for those. Aris told me that hides the itermediate table from xaf by creating custom collections lets see and usig the ManyToManyAlias attribute.
thnk you Aristeidis
ps: you can find some old xpo temlates here by Wolfgang Hauer