1

I need to implement a generic methodology for different projects. Code is:

@Document(collection="OT_analyticsTable")
public class AnalyticsTableModel {

    private long newUsers = -1;
    private long returningUsers = -1;

    public AnalyticsTableModel() {}
}

Here I want the document value to be decided at runtime.

Laurel
  • 5,965
  • 14
  • 31
  • 57
Akash Rai
  • 133
  • 1
  • 6
  • I guess you can't... Maybe you may use this code http://docs.spring.io/spring-data/data-mongodb/docs/current/api/org/springframework/data/mongodb/core/MongoOperations.html#insert-java.lang.Object-java.lang.String- – Angelo Immediata Aug 29 '16 at 12:50
  • i saw it being done as per the link: http://stackoverflow.com/questions/12274019/how-to-configure-mongodb-collection-name-for-a-class-in-spring-data/34725975#34725975 but i am unable to intimidate it in my code. – Akash Rai Aug 30 '16 at 06:34

0 Answers0