juddi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Zhang (JIRA)" <juddi-...@ws.apache.org>
Subject [jira] Created: (JUDDI-43) IdentifierBag and CategoryBag should not be empty
Date Mon, 01 Nov 2004 07:47:32 GMT
IdentifierBag and CategoryBag should not be empty
-------------------------------------------------

         Key: JUDDI-43
         URL: http://nagoya.apache.org/jira/browse/JUDDI-43
     Project: jUDDI
        Type: Bug
    Versions: 0.9rc3    
    Reporter: Jeff Zhang
 Assigned to: Steve Viens 


If we look uddi_v2.xsd,
	<xsd:complexType name="categoryBag">
		<xsd:sequence>
			<xsd:element ref="uddi:keyedReference" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="identifierBag">
		<xsd:sequence>
			<xsd:element ref="uddi:keyedReference" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
we need a keyedReference at least in categoryBag or identifierBag.

In fetchBusiness mathod of JDBCDataStore.java(src\java\org\apache\juddi\datastore\jdbc). jUDDI
get infomation from database, and create the struct:
<         IdentifierBag identifierBag = new IdentifierBag();
<         identifierBag.setKeyedReferenceVector(BusinessIdentifierTable.select(businessKey,connection));
<         business.setIdentifierBag(identifierBag);
<
<         CategoryBag categoryBag = new CategoryBag();
<         categoryBag.setKeyedReferenceVector(BusinessCategoryTable.select(businessKey,connection));
<         business.setCategoryBag(categoryBag);
It's wrong if database table doesn't contain IdentifierTable and CategoryTable. It should
be:
>         Vector identVector = BusinessIdentifierTable.select(businessKey,connection);
>         if (identVector.size() > 0)
>         {
>             IdentifierBag identifierBag = new IdentifierBag();
>             identifierBag.setKeyedReferenceVector(identVector);
>             business.setIdentifierBag(identifierBag);
>         }
>         Vector categoryVector = BusinessCategoryTable.select(businessKey,connection);
>         if (categoryVector.size() > 0)
>         {
>             CategoryBag categoryBag = new CategoryBag();
>             categoryBag.setKeyedReferenceVector(categoryVector);
>             business.setCategoryBag(categoryBag);
>         }

and in fetchService method, we should do same thing:
<         CategoryBag bag = new CategoryBag();
<         bag.setKeyedReferenceVector(ServiceCategoryTable.select(serviceKey,connection));
<         service.setCategoryBag(bag);
---
>
>         Vector categoryVector = ServiceCategoryTable.select(serviceKey,connection);
>         if (categoryVector.size() > 0)
>         {
>             CategoryBag bag = new CategoryBag();
>             bag.setKeyedReferenceVector(categoryVector);
>             service.setCategoryBag(bag);
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message