rsmith wrote:
> 
> - The foreign key reference columns are named based on the referred-to
> table (e.g. ADDRESS).  Can I customize this to be the same column name as
> the primary key of the referred-to table (ADDRESS_ID in my example).
> 
I don't think it is named based on the referred-to table, it is named based
on the name of the reference. Otherwise it would not be possible to have
several references to the same target DomainObject. Try this:

Entity Person {
  - String name
  - @Address primaryAddress
  - @Address secondaryAddress
}

ValueObject Address {
  String street;
}

However, it is possible to specify the name of the database columns, as
described here:
http://www.fornax-platform.org/cp/display/fornax/3.+Advanced+Tutorial+%28CSC%29#3.AdvancedTutorial%28CSC%29-DatabaseNames


rsmith wrote:
> 
> - Is there a way I can customize the names of the CREATEDDATE, CREATEDBY,
> etc column names?
> 

These attributes are added on the fly by the Transformation. You can replace
that transformation by using an around of the transformation extension as
described earlier.

It is the the extension named addAuditable that you need to replace. I think
I have read somewhere that it is not possible to intercept JAVA extensions
and if that is a problem you can intercept the extension named
modifyAuditable instead. See Transformation.ext.
You have to invoke your own Java helper class and do something similar to
GenerationHelper.addAuditable, but set the databaseColumn of the attributes.
createdBy.setDatabaseColumn("myCreatedDate");

If you need to change the names of the Java attributes for these it is the
same first step, but you also have to replace AuditInterceptor and specify
the gui.systemAttributes generator property.
In your sculptor-generator.properties:

framework.auditInterceptorClass=org.foo.bar.MyAuditInterceptor
gui.systemAttributes=id,uuid,version,myCreatedBy,myCreatedDate,myUpdatedBy,myLastUpdated,myLastUpdatedBy


rsmith wrote:
> 
> - For entities that don't have a business key (such as address), Sculptor
> generates the UUID column/attribute.  Is there a way I can name this
> <table name>_ID instead of UUID.  For entities with a business key, the
> below works great.
> 

Aren't you using <table name>_ID for the surrogate id (id attribute)? UUID
is not the same as ID.
The uuid attribute is also added by Transformation.ext. It should be
possible for you to replace that in the same way as described above.
addUuidAttribute or modifyUuid in Transformation.ext.


-- 
View this message in context: 
http://www.nabble.com/-Sculptor--how-to-control-surrogate-key-name-tp18625411s17564p18848995.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to