<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Create a relationship for Many-to-Many table."]]></title>
		<link>http://forums.visual-paradigm.com/posts/32.html</link>
		<description><![CDATA[Latest messages posted in the topic "Create a relationship for Many-to-Many table."]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Create a relationship for Many-to-Many table.</title>
				<description><![CDATA[ Basically, I have two entities that have a many-to-many relationship so 3 tables are created in the DB. I can insert a record for my 2 entities using the generated POJOs but how do I create a relationship (a record in the many to many table)? The Pojo doesn't seem to provide anyway to create this relationship.<br> Thanks]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/1755#6594.html</guid>
				<link>http://forums.visual-paradigm.com/posts/1755#6594.html</link>
				<pubDate><![CDATA[Thu, 16 Nov 2006 07:58:55]]></pubDate>
				<author><![CDATA[ jvence]]></author>
			</item>
			<item>
				<title>Re:Create a relationship for Many-to-Many table.</title>
				<description><![CDATA[ Hi jvence,<br> <br> I guess that you want to add records to the Link table (the extra table created by the many-to-many relationship). Actually, there should not be a class for the Link table. You just need to use the POJO as usual, and the underlying persistence tier will do the mapping for you - create the records to the appropriate table in the database.<br> <br> Hope this helps. Please feel free to let me know if there are any questions.<br> <br> Best regards,<br> Jick]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/1755#6601.html</guid>
				<link>http://forums.visual-paradigm.com/posts/1755#6601.html</link>
				<pubDate><![CDATA[Thu, 16 Nov 2006 18:07:24]]></pubDate>
				<author><![CDATA[ Jick]]></author>
			</item>
			<item>
				<title>Re:Create a relationship for Many-to-Many table.</title>
				<description><![CDATA[ Yes, I'm trying to add a record to the Link table. There's nothing in the individual POJOs that would let me create an association in the Link table (except perhaps the getORMxxx (which returns a set of the association), then adding to this set and using setORMxxx to save it back. BTW the functions that deals with retrieving/setting the set of association are private.<br> Do you have any example on how to do this?<br> Jean<br> <br> <table class="quote-table-simple" align="center">
		<tr> 
		<td><span class="genmed"><b>Jick wrote:</b></span></td>
		</tr>
		</table>
		
		<table class="quote-table" align="center">
		<tr>
		<td class="quote">Hi jvence,<br> <br> I guess that you want to add records to the Link table (the extra table created by the many-to-many relationship). Actually, there should not be a class for the Link table. You just need to use the POJO as usual, and the underlying persistence tier will do the mapping for you - create the records to the appropriate table in the database.<br> <br> Hope this helps. Please feel free to let me know if there are any questions.<br> <br> Best regards,<br> Jick&nbsp;
		</td>
		</tr>
		</table>]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/1755#6608.html</guid>
				<link>http://forums.visual-paradigm.com/posts/1755#6608.html</link>
				<pubDate><![CDATA[Thu, 16 Nov 2006 22:23:14]]></pubDate>
				<author><![CDATA[ jvence]]></author>
			</item>
			<item>
				<title>Re:Create a relationship for Many-to-Many table.</title>
				<description><![CDATA[ Dear jvence,<br> <br> Please check if the following code sample could help:<br>  <table class="code-table-simple" align="center">
		<tr> 
		<td><span class="genmed"><b>Code:</b></span></td>
		</tr>
		</table>
		<table class="code-table" align="center">
		<tr>
		<td class="code">
		<pre> 
 //entity EA
 demo.EA ldemoEA = new demo.EA&#40;&#41;;
 //...
 			
 //entity EB
 demo.EB ldemoEB = new demo.EB&#40;&#41;;
 //...
 
 //link entity
 demo.EA_Entity ldemoEA_Entity = new demo.EA_Entity&#40;&#41;;
 //...
 ldemoEA_Entity.setEAidA&#40;ldemoEA&#41;;
 ldemoEA_Entity.setEBidB&#40;ldemoEB&#41;;
 
 //save objects
 orm.P25PersistentManager.instance&#40;&#41;.getSession&#40;&#41;.save&#40;ldemoEA&#41;;
 orm.P25PersistentManager.instance&#40;&#41;.getSession&#40;&#41;.save&#40;ldemoEB&#41;;
 orm.P25PersistentManager.instance&#40;&#41;.getSession&#40;&#41;.save&#40;ldemoEA_Entity&#41;;
 
 </pre></td>
		</tr>
		</table><br> <br> Best regards,<br> Jick]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/1755#6613.html</guid>
				<link>http://forums.visual-paradigm.com/posts/1755#6613.html</link>
				<pubDate><![CDATA[Fri, 17 Nov 2006 11:20:47]]></pubDate>
				<author><![CDATA[ Jick]]></author>
			</item>
	</channel>
</rss>