cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From emeka okafor <emeka_1...@yahoo.com>
Subject testing many to many
Date Sat, 05 Jan 2013 13:12:46 GMT
 I stumbled across a weird thing today and believe that it has something to do with the fact
that I am a cayenne newbie. Here is the situation:

I have a many-to-many relationship: Blog <<=>> DataSource. 
I have configured it in the modeler the simplest way possible, without any specific relationship
table and no flattened relation.
I have this test snippet: 

System.out.println(blog1.getDatasources().get(0));                          
         // prints datasource0
System.out.println(blog1.getDatasources().get(1));                          
         // prints datasouce1

blog1.getObjectContext().deleteObjects(blog1.getDatasources().get(1));  // delete datasource1
blog1.getObjectContext().commitChanges();                                
           // commit changes
System.out.println(blog1.getDatasources().get(0));                          
          // prints datasource0
System.out.println(blog1.getDatasources().get(1));                          
          // prints datasource1 <= WHY?
Assert.assertEquals(1, blog1.getDatasources().size());                        
       // FAILS
 
Am I doing something wrong here?

Thanks.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message