Your first question:
rsmith wrote:
>
> Is there a way I can specify what the name of the surrogate key column
> should be?
> I have to follow a standard where the name would be <table name>_ID. e.g.
> ADDRESS_ID instead of ID. Can I do this with Sculptor?
>
It is possible to do this using the excellent AOP facilitates of oAW. Do
like this:
1. Add an extension advice file in your target project,
location: src/main/resources/extensions/SpecialCases.ext
content:
import sculptormetamodel;
extension extensions::helper;
extension extensions::dbhelper;
around transformation::Transformation::modifyDatabaseNames(DomainObject
domainObject) :
ctx.proceed() ->
domainObject.getIdAttribute().setDatabaseColumn(domainObject.getDatabaseName()
+ "_ID");
2. In workflow.oaw in your target project you need to add the following:
<component adviceTarget="modelTransformation"
class="oaw.xtend.XtendAdvice">
<extensionAdvice
value="extensions::SpecialCases" />
</component>
That's all! However, I found a bug in the DDL generation. It uses a
hardcoded ID in the foreign key constraints (
http://www.fornax-platform.org/tracker/browse/CSC-224 CSC-224 ). I have
fixed this, but it is not deployed yet.
I will look at your second question later.
/Patrik
--
View this message in context:
http://www.nabble.com/-Sculptor--how-to-control-surrogate-key-name-tp18625411s17564p18645888.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