Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-1449

Add support for VMFORCE database

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.0.M3
    • Fix Version/s: 1.1.0.RC1
    • Component/s: PERSISTENCE
    • Labels:
      None

      Description

      For vmforce.com cloud offering, we need to support the database available in that environment.

      The following changes are needed (details will change as we proceed, but this should cover basics):

      1. Add VMFORCE as an option to --database in 'persistence setup' command

      2. Add the following repository in pom.xml

      <repository>
          <id>vmforce-snapshots</id>
          <url>http://maven.springsource.com/snapshot</url>
          <name>VMForce Repo</name>
      </repository>
      

      3. Add the following dependency in pom.xml

      <dependency>
          <groupId>com.salesforce.sdk.persistence</groupId>
          <artifactId>datanucleus-sfdc</artifactId>
          <version>0.0.1-SNAPSHOT</version>
      </dependency>
      

      4. Add the following snippet to pass persistence.xml through filter.

      		<filters>
      			<filter>${basedir}/src/main/resources/config.properties</filter>
      		</filters>
      		<resources>
      			<resource>
      				<directory>src/main/resources</directory>
      				<filtering>true</filtering>
      				<includes>
      					<include>**/persistence.xml</include>
      				</includes>
      			</resource>
      			<resource>
      				<directory>src/main/resources</directory>
      			</resource>
      		</resources>
      

      5. Replace the <persistence-unit> element with

         <persistence-unit name="DefaultSFDCDatabase">
            <provider>org.datanucleus.jpa.PersistenceProviderImpl</provider>
            <properties>
               <property name="datanucleus.ConnectionURL" value="sfdc:${sfdc.endPoint}/services/Soap/u/${sfdc.apiVersion}"/>
               <property name="datanucleus.ConnectionUserName" value="${sfdc.userName}" />
               <property name="datanucleus.ConnectionPassword" value="${sfdc.password}" />
               <property name="datanucleus.autoCreateSchema" value="false"/>
               <property name="datanucleus.autoCreateTables" value="true"/>
               <property name="datanucleus.autoCreateColumns" value="false"/>
               <property name="datanucleus.validateTables" value="false"/>
               <property name="datanucleus.validateConstraints" value="false"/>
               <property name="datanucleus.Optimistic" value="false"/>
               <property name="datanucleus.datastoreTransactionDelayOperations" value="true"/>
               <property name="datanucleus.jpa.addClassTransformer" value="false"/>
               <property name="sfdcConnectionName" value="DefaultSFDCConnection"/>
            </properties>
         </persistence-unit>
      

      6. In each entity,
      Replace:
      @GeneratedValue(strategy = GenerationType.AUTO)
      with
      @GeneratedValue(strategy = GenerationType.IDENTITY)

      7. Create src/main/resources/config.xml with the following contents:
      sfdc.oauthVersion = 2.0
      sfdc.apiVersion = 20.0
      sfdc.endPoint = https://vmf01.t.salesforce.com
      sfdc.consumerKey = GENERATED
      sfdc.consumerSecret = GENERATED
      sfdc.userName = USER ENTERED VALUE
      sfdc.password = USER ENTERED VALUE

        Attachments

          Activity

            People

            • Assignee:
              stewarta Alan Stewart
              Reporter:
              ramnivas Ramnivas Laddad
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: