Hi Paddy,

You could let Spring coerce a Properties object into a Map<String, String>
for the config. Basically just wire your graphDbService with an additional
constructor arg that is the Properties object with your properties. You can
construct this object using spring-util (PropertiesFactoryBean) something
else.

An alternative would be to use a PropertyPlaceholderConfigurer or similar
and actually wire up the config constructor arg as a <map> with entries with
keys matching the config properties and values that are resolved by the
PropertyPlaceholderConfigurer (or similar). Something like this:

<map>
  <entry key="neostore.nodestore.db.mapped_memory"
value="${neostore.nodestore.db.mapped_memory}" />
</map>

This is just off the top of my head - there might be better ways to do it.

David

On Thu, Jul 15, 2010 at 1:28 PM, Paddy <paddyf...@gmail.com> wrote:

> hi all,
> I would like to integrate the optimizing neo4j for traversal settings in
> Spring using the example from the imdb spring app, the graphDbService  is
> configured the in app-config.xml:
>
>    <bean id="graphDbService" class="org.neo4j.kernel.EmbeddedGraphDatabase"
>        init-method="enableRemoteShell" destroy-method="shutdown">
>        <constructor-arg index="0" value="/home/neo/var/neo4j-db"/>
>    </bean>
>
>
> I want to use the optimizing for traversals example settings, how can the
> configurations for the "neo4j_config.props" file be set if the
> GraphDatabaseService is injected by Spring?
>
> http://wiki.neo4j.org/content/Configuration_Settings#Optimizing_for_traversals_example
>
> The Configuration Settings wiki outlines the setup as :
>
> Map<String,String> configuration = EmbeddedGraphDatabase.
> loadConfigurations( "neo4j_config.props" );
> GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "my-neo4j-db/",
> configuration );
>
>
> but with the spring imdb example it is and auto-wired using the @Autowired
> annotation, can these settings be configured in spring?:
>
> @Autowired
> private GraphDatabaseService graphDbService;
>
>
>
> Thanks a lot
> Paddy
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to