Fornax-Platform
Forum

Adjusting the fornax sculptor generator - getting the data source to use a Spring datasource instead of JNDI

View: New views
2 Messages — Rating Filter:   Alert me  

Adjusting the fornax sculptor generator - getting the data source to use a Spring datasource instead of JNDI

by Ryan Gardner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I much prefer to use spring's data sources over JNDI named  
datasources. The generated test SessionFactory-test.xml uses the  
spring way to run through the test cases, but the SessionFactory.xml  
seems to use JNDI and it doesn't seem that this is configurable.

Sure, I can set up a JNDI source for it - but where would I go to make  
changes if I wanted to enable a spring datasource instead of JNDi for  
the generation?

Ryan

-------------------------------------------------------------------------
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
Fornax-developer@...
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Re: Adjusting the fornax sculptor generator - getting the data source to use a Spring datasource instead of JNDI

by Patrik Nordwall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The recommended way of doing this kind of small adjustments is to "override" some code generation definitions as explained in Developer's Guide: http://fornax-platform.org/cp/display/fornax/7.+Developer%27s+Guide+%28CSC%29#7.Developer%27sGuide%28CSC%29-ChangeGenerationTemplates

In this case it would be some of the definitions in Spring.xpt that you would redefine in SpecialCases.xpt. I think it is
- sessionFactory
- hibernateConnectionDatasourceProperties

/Patrik
LightInTheBox - Buy quality products at wholesale price!