Announcement Announcement Module
Collapse
No announcement yet.
COnfigure indexing and dbref collection name via xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • COnfigure indexing and dbref collection name via xml

    Hey All

    I have a quick quesiton. Is it possible on a per collection in MongoDB using Spring data to configure the indexing and DBRef Collection name via XML.

    The reason I ask the class below is a wrapper class for saving meta-data for querying an object that is a DBRef. This all works fine but I want to be able to save the T instance variable into a different collection and not hard code it or use the default based on its name.

    So is it possible to somehow link an xml configuration file to the indexs to support different indexing based on the collection name and also is it possible via code to set the DBRef collection name when it saves (via a converter) or some other meathod

    Thanks

    @Document
    public class QueryDBRef<T> {

    @Id
    private String id;
    private Map<String, Object> values = new HashMap<String, Object>();

    @DBRef
    private T instance;

    public QueryDBRef() {
    super();
    }

    public QueryDBRef(Map<String, Object> values, T instance) {
    super();
    this.values = values;
    this.instance = instance;
    }

    public QueryDBRef(String id, Map<String, Object> values, T instance) {
    super();
    this.id = id;
    this.values = values;
    this.instance = instance;
    }

    public String getId() {
    return id;
    }

    public Map<String, Object> getValues() {
    return values;
    }

    public T getInstance() {
    return instance;
    }

    public void setInstance(T instance) {
    this.instance = instance;
    }
    }

  • #2
    XML configuration

    I Guess what I am asking is this. Can yo configure indexing and dbref via spring xml configuration files or is it only possible via annotations.

    Thanks

    Comment

    Working...
    X