I'm trying to setup multiple sculptor webapps to re-use a single sculptor bt
project - but with data segregated in the db per each webapp context.

For standard sculptor where Domain objects are generated with annotations
does anyone know an easy way I could inject those table names by bundling
the information within each individual webapp?

For example say I've got these two separate webapps with guidesigns as
follows:

gui MyWeb1 for MyApp  and  gui MyWeb2 for MyApp

and where MyApp is comprised of domain objects EntityA and EntityB.

In my db i want to have the tables named MYWEB1-ENTITYA, MYWEB1-ENTITYB,
MYWEB2-ENTITYA, MYWEB2-ENTITYB. I know i could take clones of MyApp and
manually include the table names into the dsl within btdesign but I'm keen
to entirely re-use a single bt project instead.

Is it possible to include some sort of config file which would override the
@Table annotations that are generated onto the Domain objects? ie. they will
have annotations like this which will drive the table naming: @Table (name =
"ENTITYA")

I can see it'd be possible to generate xml config for hibernate etc instead
of annotations but that would still be in the bt project which i want to
re-use. I'm needing some config that can be included into the webapp project
that would override those regular tablenames.

Note - i've read the sculptor docco re Repositories (in the Advanced
Tutorial) stating that databases are part of the infrastructure and its poor
for the client to be aware of details to access the database etc.
Importantly i'm not wanting the client itself to be aware of the db details
but just to use injection at build-time to wire-in the required db tables.

Also note I've considered another approach where i have one set of tables
with all data aggregated but discernable by including a 'context' column
onto each table. That approach would need the gui tier to pass down a
context parameter but overall seems unwieldy as it forces need to include
filtering by 'context' into all db operations - eg. it would mean not making
best use of standard sculptor scaffolding .. or at least would mean lots of
customisation of Repositories  



-- 
View this message in context: 
http://old.nabble.com/-Sculptor--Injecting-tablenames-from-web-tier--tp27195699s17564p27195699.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to