Skip to content

Instantly share code, notes, and snippets.

@enesakar
Created June 27, 2012 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enesakar/3002259 to your computer and use it in GitHub Desktop.
Save enesakar/3002259 to your computer and use it in GitHub Desktop.
main mongo
package com.hazelmongo;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
import java.util.Map;
public class Main {
public static void main(String[] args) {
ApplicationContext ctx = new GenericXmlApplicationContext("beans.xml");
Map map= (Map)ctx.getBean("usermap");
User usr = new User("Enes", 29);
map.put("id-134", usr);
User usr2 = (User) map.get("id-134");
System.out.println(usr2.getName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment