Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor 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

        Activity

        Hide
        Alan Stewart added a comment -

        Added support in Git IDs 1b224969b80ecdf65022260fe2ab87817901eb4b, 050b9f2f089385f6841086a4c58a240b663e1a3e, and 87bafc864b9f02dcb1c13c24ab22195ed7b6f761

        Show
        Alan Stewart added a comment - Added support in Git IDs 1b224969b80ecdf65022260fe2ab87817901eb4b, 050b9f2f089385f6841086a4c58a240b663e1a3e, and 87bafc864b9f02dcb1c13c24ab22195ed7b6f761

          People

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

            Dates

            • Created:
              Updated:
              Resolved: