ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Interchange Server + Adapters » JDBC adapter and creating composite BO's

Post new topic  Reply to topic
 JDBC adapter and creating composite BO's « View previous topic :: View next topic » 
Author Message
4integration
PostPosted: Thu Mar 08, 2007 1:40 am    Post subject: JDBC adapter and creating composite BO's Reply with quote

Disciple

Joined: 04 Sep 2006
Posts: 197
Location: Gothenburg, Sweden

Hello,

I am using the IBM WBI Adapter for JDBC (ver. 2.6.6) and need to create a composite business object for two tables. The adapter will insert the value to the DB (Oracle).

The tables I have is ORDER_HEADER and ORDER_LINE and as you may understand ORDER_HEADER will have one or more ORDER_LINE in relation, e.g.

ORDER_HEADER --[1]----------[*]--> ORDER_LINE

I have created the business objects for the tables and now have to create the connection between them.

Is it enough to add a field in ORDER_HEADER called "LINES" and points out the type "ORDER_LINE" and set the cardinality to N??
Will this handle the foreign key on ORDER_LINE, etc?
_________________
Best regards
4 Integration
Back to top
View user's profile Send private message
k_usa
PostPosted: Thu Mar 08, 2007 7:27 pm    Post subject: Reply with quote

Apprentice

Joined: 14 Aug 2006
Posts: 42
Location: NewJersey

In the child BO you need to add the ASI for each foreignkey attr .
FK=<Parent-tableColumnName>
Back to top
View user's profile Send private message
4integration
PostPosted: Mon Mar 19, 2007 1:11 am    Post subject: Reply with quote

Disciple

Joined: 04 Sep 2006
Posts: 197
Location: Gothenburg, Sweden

Hello again,

Neither the parent (ORDER_HEADER) nor the children (ORDER_LINE) have a logic primary key, such as "order_id". They are both using an Oracle sequence as PK (field KEY) and have a unique fields for ORDER_ID.

Therefore I have the two BO's (and more fields of course):
Code:
ORDER_HEADER
   KEY (PK)  [ASI => CN=KEY:UID=IF_OH_PK_Seq ]
   ORDER_ID  [ASI => CN=CLIENT_ID ]
   LINES [Type = ORDER_LINE, Cardinality = N]

ORDER_LINE
   KEY (PK)  [ASI => CN=KEY:UID=IF_OL_PK_Seq ]
   ORDER_ID  [ASI => CN=ORDER_ID ]


The information passed to JDBC Adapter's request queue contains a ORDER_HEADER and a container LINES that contains multiple ORDER_LINES.
When the adapter are processing the data it inserts the header and ONE order line (have 10).

Why doesn't the adapter insert all order lines??
The XML data traced by adapter:

Code:
<NS1:INTERFACE_ORDER_HEADER
   xmlns:NS1="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/INTERFACE_ORDER_HEADER"
   xmlns:NS2="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/INTERFACE_ORDER_LINE"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:xml="http://www.w3.org/XML/1998/namespace" verb="Create">
   <NS1:KEY>12345</NS1:KEY>
   <NS1:CLIENT_ID>CompanyX</NS1:CLIENT_ID>
   <NS1:ORDER_ID>1174294775317</NS1:ORDER_ID>
   <NS1:ORDER_TYPE></NS1:ORDER_TYPE>
   <NS1:STATUS>Released</NS1:STATUS>
   <NS1:PRIORITY>0</NS1:PRIORITY>
   <NS1:LOAD_SEQUENCE>0</NS1:LOAD_SEQUENCE>
   <NS1:FROM_SITE_ID>GBG</NS1:FROM_SITE_ID>
   <NS1:OWNER_ID>CompanyX</NS1:OWNER_ID>
   <NS1:PURCHASE_ORDER></NS1:PURCHASE_ORDER>
   <NS1:NAME>Chicago Mack Sales &amp; Service</NS1:NAME>
   <NS1:ADDRESS1>Chicago Mack Sales &amp; Service</NS1:ADDRESS1>
   <NS1:ADDRESS2>Bulldogdrive</NS1:ADDRESS2>
   <NS1:TOWN></NS1:TOWN>
   <NS1:COUNTY>Summit</NS1:COUNTY>
   <NS1:POSTCODE>60501</NS1:POSTCODE>
   <NS1:COUNTRY>US</NS1:COUNTRY>
   <NS1:INSTRUCTIONS></NS1:INSTRUCTIONS>
   <NS1:CARRIER_ID>HIT</NS1:CARRIER_ID>
   <NS1:DISPATCH_METHOD>HITN</NS1:DISPATCH_METHOD>
   <NS1:SERVICE_LEVEL></NS1:SERVICE_LEVEL>
   <NS1:CID_NUMBER>0</NS1:CID_NUMBER>
   <NS1:SID_NUMBER>0</NS1:SID_NUMBER>
   <NS1:LOCATION_NUMBER>0</NS1:LOCATION_NUMBER>
   <NS1:USER_DEF_TYPE_1>0080000573</NS1:USER_DEF_TYPE_1>
   <NS1:USER_DEF_CHK_1>N</NS1:USER_DEF_CHK_1>
   <NS1:SESSION_TIME_ZONE_NAME>CET</NS1:SESSION_TIME_ZONE_NAME>
   <NS1:MERGE_ACTION>A</NS1:MERGE_ACTION>
   <NS1:LINES>
      <NS2:INTERFACE_ORDER_LINE>
         <NS2:KEY>1</NS2:KEY>
         <NS2:CLIENT_ID>CompanyX</NS2:CLIENT_ID>
         <NS2:ORDER_ID>1174294775317</NS2:ORDER_ID>
         <NS2:LINE_ID>10</NS2:LINE_ID>
         <NS2:SKU_ID>VO 466634</NS2:SKU_ID>
         <NS2:QTY_ORDERED>8</NS2:QTY_ORDERED>
         <NS2:ALLOCATE>N</NS2:ALLOCATE>
         <NS2:NOTES></NS2:NOTES>
         <NS2:LINE_VALUE>0</NS2:LINE_VALUE>
         <NS2:USER_DEF_TYPE_1>0080000573</NS2:USER_DEF_TYPE_1>
         <NS2:MERGE_ACTION>A</NS2:MERGE_ACTION>
      </NS2:INTERFACE_ORDER_LINE>
      <NS2:INTERFACE_ORDER_LINE>
         <NS2:KEY>2</NS2:KEY>
         <NS2:CLIENT_ID>CompanyX</NS2:CLIENT_ID>
         <NS2:ORDER_ID>1174294775317</NS2:ORDER_ID>
         <NS2:LINE_ID>20</NS2:LINE_ID>
         <NS2:SKU_ID>VO 466634</NS2:SKU_ID>
         <NS2:QTY_ORDERED>16</NS2:QTY_ORDERED>
         <NS2:ALLOCATE>N</NS2:ALLOCATE>
         <NS2:NOTES></NS2:NOTES>
         <NS2:LINE_VALUE>0</NS2:LINE_VALUE>
         <NS2:USER_DEF_TYPE_1>0080000573</NS2:USER_DEF_TYPE_1>
         <NS2:MERGE_ACTION>A</NS2:MERGE_ACTION>
      </NS2:INTERFACE_ORDER_LINE>
      <NS2:INTERFACE_ORDER_LINE>
         <NS2:KEY>3</NS2:KEY>
         <NS2:CLIENT_ID>CompanyX</NS2:CLIENT_ID>
         <NS2:ORDER_ID>1174294775317</NS2:ORDER_ID>
         <NS2:LINE_ID>30</NS2:LINE_ID>
         <NS2:SKU_ID>VO 466634</NS2:SKU_ID>
         <NS2:QTY_ORDERED>8</NS2:QTY_ORDERED>
         <NS2:ALLOCATE>N</NS2:ALLOCATE>
         <NS2:NOTES></NS2:NOTES>
         <NS2:LINE_VALUE>0</NS2:LINE_VALUE>
         <NS2:USER_DEF_TYPE_1>0080000573</NS2:USER_DEF_TYPE_1>
         <NS2:MERGE_ACTION>A</NS2:MERGE_ACTION>
      </NS2:INTERFACE_ORDER_LINE>
      <NS2:INTERFACE_ORDER_LINE>
         <NS2:KEY>4</NS2:KEY>
         <NS2:CLIENT_ID>CompanyX</NS2:CLIENT_ID>
         <NS2:ORDER_ID>1174294775317</NS2:ORDER_ID>
         <NS2:LINE_ID>40</NS2:LINE_ID>
         <NS2:SKU_ID>VO 466634</NS2:SKU_ID>
         <NS2:QTY_ORDERED>32</NS2:QTY_ORDERED>
         <NS2:ALLOCATE>N</NS2:ALLOCATE>
         <NS2:NOTES></NS2:NOTES>
         <NS2:LINE_VALUE>0</NS2:LINE_VALUE>
         <NS2:USER_DEF_TYPE_1>0080000573</NS2:USER_DEF_TYPE_1>
         <NS2:MERGE_ACTION>A</NS2:MERGE_ACTION>
      </NS2:INTERFACE_ORDER_LINE>

...CUT....
      <NS2:INTERFACE_ORDER_LINE>
         <NS2:KEY>10</NS2:KEY>
         <NS2:CLIENT_ID>CompanyX</NS2:CLIENT_ID>
         <NS2:ORDER_ID>1174294775317</NS2:ORDER_ID>
         <NS2:LINE_ID>100</NS2:LINE_ID>
         <NS2:SKU_ID>VO 466634</NS2:SKU_ID>
         <NS2:QTY_ORDERED>8</NS2:QTY_ORDERED>
         <NS2:ALLOCATE>N</NS2:ALLOCATE>
         <NS2:NOTES></NS2:NOTES>
         <NS2:LINE_VALUE>0</NS2:LINE_VALUE>
         <NS2:USER_DEF_TYPE_1>0080000573</NS2:USER_DEF_TYPE_1>
         <NS2:MERGE_ACTION>A</NS2:MERGE_ACTION>
      </NS2:INTERFACE_ORDER_LINE>
   </NS1:LINES>
</NS1:INTERFACE_ORDER_HEADER>

_________________
Best regards
4 Integration
Back to top
View user's profile Send private message
4integration
PostPosted: Tue Mar 20, 2007 5:32 am    Post subject: Reply with quote

Disciple

Joined: 04 Sep 2006
Posts: 197
Location: Gothenburg, Sweden

Closed/Solved!

I totally missed the Size attribute on the LINES &%¤&¤&%¤%&¤
_________________
Best regards
4 Integration
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Interchange Server + Adapters » JDBC adapter and creating composite BO's
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.