public void testSwizzling() throws Throwable
{
Transaction tx = null;
ProductGroup pg;
Article article;
Article article2;
try
{
tx = _kit.getTransaction(_conn);
tx.begin();
pg = new ProductGroup();
pg.setId(77777);
_conn.makePersistent(pg);
article = Article.createInstance();
article.setArticleId(77777);
article.setStock(333);
pg.add(article);
article.setProductGroup(pg);
_conn.makePersistent(article);
article2 = Article.createInstance();
article2.setArticleId(article.getArticleId());
article2.setStock(334);
article2.setProductGroup(pg);
_conn.makePersistent(article2);
article = (Article) pg.getAllArticles().get(0);
assertEquals("should be equal", 334, article.getStock());
}
finally