title: neo4j Dynamic Relationship Types, not with enums
body: <p>How would I take the string "KNOWS" and use it as a Relationship type instead of using an enum  RelTypes.KNOWS ... I need to dynamically add relationship instead of using only the 2 enums RelTypes.KNOWS and RelTypes.IS_FRIENDS_WITH</p>
  
  <pre><code>// START SNIPPET: createReltype
  private static enum RelTypes implements RelationshipType
  {
      KNOWS,
      IS_FRIENDS_WITH
  }
  // END SNIPPET: createReltype
  
  public static void main( final String[] args )
  {
      // START SNIPPET: startDb
      GraphDatabaseService graphDb = new EmbeddedGraphDatabase( DB_PATH );
      registerShutdownHook( graphDb );
      // END SNIPPET: startDb
  
      // START SNIPPET: operationsInATransaction
      Transaction tx = graphDb.beginTx();
      try
      {
          Node john = graphDb.createNode();
          john.setProperty("name", "John" );
          Node george = graphDb.createNode();
          george.setProperty("name", "George" );
  
          firstNode.createRelationshipTo( secondNode, RelTypes.KNOWS );
  
          tx.success();
      }
      finally
      {
          tx.finish();
      }
      // END SNIPPET: removingData
  
      System.out.println( "Shutting down database ..." );
      // START SNIPPET: shutdownServer
      graphDb.shutdown();
      // END SNIPPET: shutdownServer
  }
  </code></pre>