camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ranabroto <ranabroto.gh...@globalcharge.com>
Subject Re: Insert reference ID of another table
Date Mon, 24 Jul 2017 16:47:02 GMT
I do not think it has got anything to do with camle, depends on what
framework you are using to persist data, for example if you are using
hibernate(with orm mapping) component of camel, may be you can do something
like below.
<hibernate-mapping default-cascade="save-update">
        <class name="com.yourpack.com.Person"  table="person">
	       
	        <id name="id" column="id" />
	        <property name="name">
	        	<column name="name"></column>
	        </property>	 		
			<one-to-one name="customer" class="com.yourpack.com.Customer"
cascade="all" />
 		</class>
 		
 		<class name="com.yourpack.com.Customer" table="customer">
 			<id name="id">
	            <column name="id" />
	            <generator class="foreign">
	                person
	            </generator>
        	</id>
 			<one-to-one name="person" class="com.yourpack.com.Person"
constrained="true" />
			<property name="somefield">
	    		<column name="somefield"></column>
	    	</property>
 		</class>
</hibernate-mapping>

Then from you camel context use like blow
Create the Person object here setting customer in it, then set that person
in camel message body, after that use below line
<to uri="hibernate:com.yourpack.com.Person" pattern="InOnly"/> 



--
View this message in context: http://camel.465427.n5.nabble.com/Insert-reference-ID-of-another-table-tp5807535p5807789.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message