public void testManyToMany() {
		Transaction tx = null;
		try {
			tx = session.beginTransaction();

			Stock stock = new Stock();
			stock.setStockCode("K34");
			stock.setStockName("YudiWiran4");

			Stock stock2 = new Stock();
			stock2.setStockCode("2K34");
			stock2.setStockName("2YudiWira");

			Category category1 = new Category();
			category1.setName("CATGORY 1");
			category1.setDesc("CATGORY 1 DESC");

			Category category2 = new Category();
			category2.setName("CATGORY 2");
			category2.setDesc("CATGORY 2 DESC");

			Category category3 = new Category();
			category3.setName("CATGORY 3");
			category3.setDesc("CATGORY 3 DESC");

			List<Category> categories = new ArrayList<Category>();
			categories.add(category3);
			categories.add(category2);

			stock.setCategories(categories);
			stock2.setCategories(categories);

			session.save(stock2);
			session.save(stock);

			tx.commit();

		} catch (RuntimeException e) {
			// TODO: handle exception
			try {
				tx.rollback();
			} catch (RuntimeException e2) {
				// TODO: handle exception
			}
		} finally {
			if (session != null) {
				session.close();
			}
		}

	}