Works great; thanks Andrus.
-----Original Message-----
From: Andrus Adamchik [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 06, 2008 4:30 AM
To: [email protected]
Subject: Re: Specifying PK when creating a new object in DB generated PK
mode
How about using a brute force approach. You have a DataMap that
contains DbEntities with "Database Generated" PK. Fine... but for
import purposes you need to suppress this behavior, so do something
like that on startup:
DataDomain domain = Configuration.getSharedConfiguration().getDomain();
for(DbEntity e : domain.getEntityResolver().getDbEntities()) {
for(DbAttribute a : e.getPrimaryKeys()) {
a.setGenerated(false);
}
}
Andrus