private synchronized static Datastore createDatastore(){
  if (dataStore == null) {
    Morphia m=new Morphia();
    String mongoName=KrakenConfig.getProperty("kraken.mongodb.dbname");
    dataStore=m.createDatastore(getMongo(mongoName),mongoName);
    m.map(Customer.class);
    m.map(Project.class);
    m.map(Attribute.class);
    m.map(Dimension.class);
    m.map(Domain.class);
    m.map(ProjectFacetJob.class);
    m.map(Metric.class);
    m.map(Client.class);
    m.map(User.class);
    m.map(UserGroup.class);
    m.map(ProjectAnalysisJob.class);
    m.map(AccessToken.class);
    m.map(Relation.class);
    m.map(Annotation.class);
    m.map(ProjectUser.class);
    m.map(State.class);
    m.map(Shortcut.class);
    try {
      dataStore.ensureIndexes();
    }
 catch (    Exception e) {
      throw new RuntimeException(e.getMessage(),e);
    }
  }
  return dataStore;
}

private synchronized static Datastore createDatastore ( ) { if ( dataStore == null ) { Morphia m = new Morphia ( ) ; String mongoName = KrakenConfig . getProperty ( "kraken.mongodb.dbname" ) ; dataStore = m . createDatastore ( getMongo ( mongoName ) , mongoName ) ; m . map ( Customer . class ) ; m . map ( Project . class ) ; m . map ( Attribute . class ) ; m . map ( Dimension . class ) ; m . map ( Domain . class ) ; m . map ( ProjectFacetJob . class ) ; m . map ( Metric . class ) ; m . map ( Client . class ) ; m . map ( User . class ) ; m . map ( UserGroup . class ) ; m . map ( ProjectAnalysisJob . class ) ; m . map ( AccessToken . class ) ; m . map ( Relation . class ) ; m . map ( Annotation . class ) ; m . map ( ProjectUser . class ) ; m . map ( State . class ) ; m . map ( Shortcut . class ) ; try { dataStore . ensureIndexes ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e . getMessage ( ) , e ) ; } } return dataStore ; }
create a single mongodb morphia datastore .
