You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by ks...@apache.org on 2008/12/13 15:43:23 UTC
svn commit: r726212 [1/2] - in
/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi:
mapping/ model/
Author: kstam
Date: Sat Dec 13 06:43:21 2008
New Revision: 726212
URL: http://svn.apache.org/viewvc?rev=726212&view=rev
Log:
JUDDI-145, initial checking adding KeyedReference and KeyedReferenceGroup, refactored to use inheritence on handling the various types of CategoryBag.
Added:
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingCategoryBag.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessCategoryBag.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReference.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReferenceGroup.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceCategoryBag.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelCategoryBag.java
Removed:
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLineId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingCategory.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingCategoryId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescrId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessCategory.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessCategoryId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescrId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifierId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessNameId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/CategoryBagGroup.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/CategoryBagId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescrId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrlId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/EmailId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Id.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescrId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescrId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/PersonNameId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/PhoneId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceCategory.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceCategoryId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceDescrId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceNameId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelCategory.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelCategoryId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDescrId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDocDescrId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelIdentifierId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelInstanceInfoDescrId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelInstanceInfoId.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TransferTokenKeyId.java
Modified:
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Address.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLine.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescr.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescr.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifier.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessName.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/CategoryBag.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Contact.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescr.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrl.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Email.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescr.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescr.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/PersonName.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Phone.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceDescr.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceName.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDescr.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDocDescr.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelIdentifier.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelInstanceInfo.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelInstanceInfoDescr.java
webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TransferTokenKey.java
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java Sat Dec 13 06:43:21 2008
@@ -58,7 +58,7 @@
mapDiscoveryUrls(apiBusinessEntity.getDiscoveryURLs(), modelBusinessEntity.getDiscoveryUrls(), modelBusinessEntity);
mapContacts(apiBusinessEntity.getContacts(), modelBusinessEntity.getContacts(), modelBusinessEntity);
mapBusinessIdentifiers(apiBusinessEntity.getIdentifierBag(), modelBusinessEntity.getBusinessIdentifiers(), modelBusinessEntity);
- mapBusinessCategories(apiBusinessEntity.getCategoryBag(), modelBusinessEntity.getBusinessCategories(), modelBusinessEntity);
+ mapCategoryBag(apiBusinessEntity.getCategoryBag(), modelBusinessEntity.getCategoryBag());
mapBusinessServices(apiBusinessEntity.getBusinessServices(), modelBusinessEntity.getBusinessServices(), modelBusinessEntity);
}
@@ -70,10 +70,8 @@
throws DispositionReportFaultMessage {
modelNameList.clear();
- int id = 0;
for (org.uddi.api_v3.Name apiName : apiNameList) {
- org.apache.juddi.model.BusinessNameId businessNameId = new org.apache.juddi.model.BusinessNameId(modelBusinessEntity.getEntityKey(), id++);
- modelNameList.add(new org.apache.juddi.model.BusinessName(businessNameId, modelBusinessEntity, apiName.getLang(), apiName.getValue()));
+ modelNameList.add(new org.apache.juddi.model.BusinessName(modelBusinessEntity, apiName.getLang(), apiName.getValue()));
}
}
@@ -82,11 +80,9 @@
org.apache.juddi.model.BusinessEntity modelBusinessEntity)
throws DispositionReportFaultMessage {
modelDescList.clear();
-
- int id = 0;
+
for (org.uddi.api_v3.Description apiDesc : apiDescList) {
- org.apache.juddi.model.BusinessDescrId businessDescId = new org.apache.juddi.model.BusinessDescrId(modelBusinessEntity.getEntityKey(), id++);
- modelDescList.add(new org.apache.juddi.model.BusinessDescr(businessDescId, modelBusinessEntity, apiDesc.getLang(), apiDesc.getValue()));
+ modelDescList.add(new org.apache.juddi.model.BusinessDescr(modelBusinessEntity, apiDesc.getLang(), apiDesc.getValue()));
}
}
@@ -100,8 +96,7 @@
List<org.uddi.api_v3.DiscoveryURL> apiDiscUrlList = apiDiscUrls.getDiscoveryURL();
int id = 0;
for (org.uddi.api_v3.DiscoveryURL apiDiscUrl : apiDiscUrlList) {
- org.apache.juddi.model.DiscoveryUrlId discUrlId = new org.apache.juddi.model.DiscoveryUrlId(modelBusinessEntity.getEntityKey(), id++);
- modelDiscUrlList.add(new org.apache.juddi.model.DiscoveryUrl(discUrlId, modelBusinessEntity, apiDiscUrl.getUseType(), apiDiscUrl.getValue()));
+ modelDiscUrlList.add(new org.apache.juddi.model.DiscoveryUrl(modelBusinessEntity, apiDiscUrl.getUseType(), apiDiscUrl.getValue()));
}
}
}
@@ -116,8 +111,7 @@
List<org.uddi.api_v3.Contact> apiContactList = apiContacts.getContact();
int id = 0;
for (org.uddi.api_v3.Contact apiContact : apiContactList) {
- org.apache.juddi.model.ContactId contactId = new org.apache.juddi.model.ContactId(modelBusinessEntity.getEntityKey(), id++);
- org.apache.juddi.model.Contact modelContact = new org.apache.juddi.model.Contact(contactId, modelBusinessEntity);
+ org.apache.juddi.model.Contact modelContact = new org.apache.juddi.model.Contact(modelBusinessEntity);
modelContact.setUseType(apiContact.getUseType());
mapPersonNames(apiContact.getPersonName(), modelContact.getPersonNames(), modelContact, modelBusinessEntity.getEntityKey());
@@ -140,8 +134,7 @@
int id = 0;
for (org.uddi.api_v3.Description apiDesc : apiDescList) {
- org.apache.juddi.model.ContactDescrId contactDescId = new org.apache.juddi.model.ContactDescrId(businessKey, modelContact.getId().getContactId(), id++);
- modelDescList.add(new org.apache.juddi.model.ContactDescr(contactDescId, modelContact, apiDesc.getLang(), apiDesc.getValue()));
+ modelDescList.add(new org.apache.juddi.model.ContactDescr(modelContact, apiDesc.getLang(), apiDesc.getValue()));
}
}
@@ -152,10 +145,8 @@
throws DispositionReportFaultMessage {
modelPersonNameList.clear();
- int id = 0;
for (org.uddi.api_v3.PersonName apiPersonName : apiPersonNameList) {
- org.apache.juddi.model.PersonNameId personNameId = new org.apache.juddi.model.PersonNameId(businessKey, modelContact.getId().getContactId(), id++);
- modelPersonNameList.add(new org.apache.juddi.model.PersonName(personNameId, modelContact, apiPersonName.getLang(), apiPersonName.getValue()));
+ modelPersonNameList.add(new org.apache.juddi.model.PersonName(modelContact, apiPersonName.getLang(), apiPersonName.getValue()));
}
}
@@ -166,10 +157,8 @@
throws DispositionReportFaultMessage {
modelEmailList.clear();
- int id = 0;
for (org.uddi.api_v3.Email apiEmail : apiEmailList) {
- org.apache.juddi.model.EmailId emailId = new org.apache.juddi.model.EmailId(businessKey, modelContact.getId().getContactId(), id++);
- modelEmailList.add(new org.apache.juddi.model.Email(emailId, modelContact, apiEmail.getUseType(), apiEmail.getValue()));
+ modelEmailList.add(new org.apache.juddi.model.Email(modelContact, apiEmail.getUseType(), apiEmail.getValue()));
}
}
@@ -180,10 +169,8 @@
throws DispositionReportFaultMessage {
modelPhoneList.clear();
- int id = 0;
for (org.uddi.api_v3.Phone apiPhone : apiPhoneList) {
- org.apache.juddi.model.PhoneId phoneId = new org.apache.juddi.model.PhoneId(businessKey, modelContact.getId().getContactId(), id++);
- modelPhoneList.add(new org.apache.juddi.model.Phone(phoneId, modelContact, apiPhone.getUseType(), apiPhone.getValue()));
+ modelPhoneList.add(new org.apache.juddi.model.Phone(modelContact, apiPhone.getUseType(), apiPhone.getValue()));
}
}
@@ -194,15 +181,13 @@
throws DispositionReportFaultMessage {
modelAddressList.clear();
- int id = 0;
for (org.uddi.api_v3.Address apiAddress : apiAddressList) {
- org.apache.juddi.model.AddressId addressId = new org.apache.juddi.model.AddressId(businessKey, modelContact.getId().getContactId(), id++);
- org.apache.juddi.model.Address modelAddress = new org.apache.juddi.model.Address(addressId, modelContact);
+ org.apache.juddi.model.Address modelAddress = new org.apache.juddi.model.Address(modelContact);
modelAddress.setSortCode(apiAddress.getSortCode());
modelAddress.setTmodelKey(apiAddress.getTModelKey());
modelAddress.setUseType(apiAddress.getUseType());
- mapAddressLines(apiAddress.getAddressLine(), modelAddress.getAddressLines(), modelAddress, businessKey, modelContact.getId().getContactId());
+ mapAddressLines(apiAddress.getAddressLine(), modelAddress.getAddressLines(), modelAddress, businessKey, modelContact.getId());
modelAddressList.add(modelAddress);
}
@@ -212,14 +197,12 @@
Set<org.apache.juddi.model.AddressLine> modelAddressLineList,
org.apache.juddi.model.Address modelAddress,
String businessKey,
- int contactId)
+ Long contactId)
throws DispositionReportFaultMessage {
modelAddressLineList.clear();
- int id = 0;
for (org.uddi.api_v3.AddressLine apiAddressLine : apiAddressLineList) {
- org.apache.juddi.model.AddressLineId addressLineId = new org.apache.juddi.model.AddressLineId(businessKey, contactId, modelAddress.getId().getAddressId(), id++);
- modelAddressLineList.add(new org.apache.juddi.model.AddressLine(addressLineId, modelAddress, apiAddressLine.getValue(), apiAddressLine.getKeyName(), apiAddressLine.getKeyValue()));
+ modelAddressLineList.add(new org.apache.juddi.model.AddressLine(modelAddress, apiAddressLine.getValue(), apiAddressLine.getKeyName(), apiAddressLine.getKeyValue()));
}
}
@@ -232,32 +215,8 @@
if (apiIdentifierBag != null) {
List<org.uddi.api_v3.KeyedReference> apiKeyedRefList = apiIdentifierBag.getKeyedReference();
- int id = 0;
for (org.uddi.api_v3.KeyedReference apiKeyedRef : apiKeyedRefList) {
- org.apache.juddi.model.BusinessIdentifierId identifierId = new org.apache.juddi.model.BusinessIdentifierId(modelBusinessEntity.getEntityKey(), id++);
- modelIdentifierList.add(new org.apache.juddi.model.BusinessIdentifier(identifierId, modelBusinessEntity, apiKeyedRef.getTModelKey(), apiKeyedRef.getKeyName(), apiKeyedRef.getKeyValue()));
- }
- }
- }
-
- public static void mapBusinessCategories(org.uddi.api_v3.CategoryBag apiCategoryBag,
- Set<org.apache.juddi.model.BusinessCategory> modelCategoryList,
- org.apache.juddi.model.BusinessEntity modelBusinessEntity)
- throws DispositionReportFaultMessage {
- modelCategoryList.clear();
-
- if (apiCategoryBag != null) {
- List<JAXBElement<?>> apiCategoryList = apiCategoryBag.getContent();
- int id = 0;
- for (JAXBElement<?> elem : apiCategoryList) {
- // TODO: Currently, the model doesn't allow for the persistence of keyedReference groups. This must be incorporated into the model. For now
- // the KeyedReferenceGroups are ignored.
- if (elem.getValue() instanceof org.uddi.api_v3.KeyedReference) {
- org.uddi.api_v3.KeyedReference apiKeyedRef = (org.uddi.api_v3.KeyedReference)elem.getValue();
-
- org.apache.juddi.model.BusinessCategoryId categoryId = new org.apache.juddi.model.BusinessCategoryId(modelBusinessEntity.getEntityKey(), id++);
- modelCategoryList.add(new org.apache.juddi.model.BusinessCategory(categoryId, modelBusinessEntity, apiKeyedRef.getTModelKey(), apiKeyedRef.getKeyName(), apiKeyedRef.getKeyValue()));
- }
+ modelIdentifierList.add(new org.apache.juddi.model.BusinessIdentifier(modelBusinessEntity, apiKeyedRef.getTModelKey(), apiKeyedRef.getKeyName(), apiKeyedRef.getKeyValue()));
}
}
}
@@ -291,7 +250,7 @@
mapServiceNames(apiBusinessService.getName(), modelBusinessService.getServiceNames(), modelBusinessService);
mapServiceDescriptions(apiBusinessService.getDescription(), modelBusinessService.getServiceDescrs(), modelBusinessService);
- mapServiceCategories(apiBusinessService.getCategoryBag(), modelBusinessService.getServiceCategories(), modelBusinessService);
+ mapCategoryBag(apiBusinessService.getCategoryBag(), modelBusinessService.getCategoryBag());
mapBindingTemplates(apiBusinessService.getBindingTemplates(), modelBusinessService.getBindingTemplates(), modelBusinessService);
@@ -303,10 +262,8 @@
throws DispositionReportFaultMessage {
modelNameList.clear();
- int id = 0;
for (org.uddi.api_v3.Name apiName : apiNameList) {
- org.apache.juddi.model.ServiceNameId serviceNameId = new org.apache.juddi.model.ServiceNameId(modelBusinessService.getEntityKey(), id++);
- modelNameList.add(new org.apache.juddi.model.ServiceName(serviceNameId, modelBusinessService, apiName.getLang(), apiName.getValue()));
+ modelNameList.add(new org.apache.juddi.model.ServiceName(modelBusinessService, apiName.getLang(), apiName.getValue()));
}
}
@@ -316,32 +273,8 @@
throws DispositionReportFaultMessage {
modelDescList.clear();
- int id = 0;
for (org.uddi.api_v3.Description apiDesc : apiDescList) {
- org.apache.juddi.model.ServiceDescrId serviceDescId = new org.apache.juddi.model.ServiceDescrId(modelBusinessService.getEntityKey(), id++);
- modelDescList.add(new org.apache.juddi.model.ServiceDescr(serviceDescId, modelBusinessService, apiDesc.getLang(), apiDesc.getValue()));
- }
- }
-
- public static void mapServiceCategories(org.uddi.api_v3.CategoryBag apiCategoryBag,
- Set<org.apache.juddi.model.ServiceCategory> modelCategoryList,
- org.apache.juddi.model.BusinessService modelBusinessService)
- throws DispositionReportFaultMessage {
- modelCategoryList.clear();
-
- if (apiCategoryBag != null) {
- List<JAXBElement<?>> apiCategoryList = apiCategoryBag.getContent();
- int id = 0;
- for (JAXBElement<?> elem : apiCategoryList) {
- // TODO: Currently, the model doesn't allow for the persistence of keyedReference groups. This must be incorporated into the model. For now
- // the KeyedReferenceGroups are ignored.
- if (elem.getValue() instanceof org.uddi.api_v3.KeyedReference) {
- org.uddi.api_v3.KeyedReference apiKeyedRef = (org.uddi.api_v3.KeyedReference)elem.getValue();
-
- org.apache.juddi.model.ServiceCategoryId categoryId = new org.apache.juddi.model.ServiceCategoryId(modelBusinessService.getEntityKey(), id++);
- modelCategoryList.add(new org.apache.juddi.model.ServiceCategory(categoryId, modelBusinessService, apiKeyedRef.getTModelKey(), apiKeyedRef.getKeyName(), apiKeyedRef.getKeyValue()));
- }
- }
+ modelDescList.add(new org.apache.juddi.model.ServiceDescr(modelBusinessService, apiDesc.getLang(), apiDesc.getValue()));
}
}
@@ -376,7 +309,7 @@
//modelBindingTemplate.setHostingRedirector(apiBindingTemplate.getHostingRedirector().getBindingKey());
mapBindingDescriptions(apiBindingTemplate.getDescription(), modelBindingTemplate.getBindingDescrs(), modelBindingTemplate);
- mapBindingCategories(apiBindingTemplate.getCategoryBag(), modelBindingTemplate.getBindingCategories(), modelBindingTemplate);
+ mapCategoryBag(apiBindingTemplate.getCategoryBag(), modelBindingTemplate.getBindingTemplateCategoryBag());
mapTModelInstanceDetails(apiBindingTemplate.getTModelInstanceDetails(), modelBindingTemplate.getTmodelInstanceInfos(), modelBindingTemplate);
}
@@ -385,31 +318,32 @@
org.apache.juddi.model.BindingTemplate modelBindingTemplate)
throws DispositionReportFaultMessage {
modelDescList.clear();
-
- int id = 0;
for (org.uddi.api_v3.Description apiDesc : apiDescList) {
- org.apache.juddi.model.BindingDescrId bindingDescId = new org.apache.juddi.model.BindingDescrId(modelBindingTemplate.getEntityKey(), id++);
- modelDescList.add(new org.apache.juddi.model.BindingDescr(bindingDescId, modelBindingTemplate, apiDesc.getLang(), apiDesc.getValue()));
+ modelDescList.add(new org.apache.juddi.model.BindingDescr(modelBindingTemplate, apiDesc.getLang(), apiDesc.getValue()));
}
}
- public static void mapBindingCategories(org.uddi.api_v3.CategoryBag apiCategoryBag,
- Set<org.apache.juddi.model.BindingCategory> modelCategoryList,
- org.apache.juddi.model.BindingTemplate modelBindingTemplate)
+ public static void mapCategoryBag(org.uddi.api_v3.CategoryBag apiCategoryBag,
+ org.apache.juddi.model.CategoryBag modelCategoryBag)
throws DispositionReportFaultMessage {
- modelCategoryList.clear();
+ Set<org.apache.juddi.model.KeyedReference> modelKeyedReferences=modelCategoryBag.getKeyedReferences();
+ modelKeyedReferences.clear();
+ Set<org.apache.juddi.model.KeyedReferenceGroup> modelKeyedReferenceGroups=modelCategoryBag.getKeyedReferenceGroups();
+ modelKeyedReferenceGroups.clear();
if (apiCategoryBag != null) {
List<JAXBElement<?>> apiCategoryList = apiCategoryBag.getContent();
- int id = 0;
for (JAXBElement<?> elem : apiCategoryList) {
- // TODO: Currently, the model doesn't allow for the persistence of keyedReference groups. This must be incorporated into the model. For now
- // the KeyedReferenceGroups are ignored.
+
if (elem.getValue() instanceof org.uddi.api_v3.KeyedReference) {
- org.uddi.api_v3.KeyedReference apiKeyedRef = (org.uddi.api_v3.KeyedReference)elem.getValue();
-
- org.apache.juddi.model.BindingCategoryId categoryId = new org.apache.juddi.model.BindingCategoryId(modelBindingTemplate.getEntityKey(), id++);
- modelCategoryList.add(new org.apache.juddi.model.BindingCategory(categoryId, modelBindingTemplate, apiKeyedRef.getTModelKey(), apiKeyedRef.getKeyName(), apiKeyedRef.getKeyValue()));
+ org.uddi.api_v3.KeyedReference apiKeyedReference = (org.uddi.api_v3.KeyedReference)elem.getValue();
+ modelKeyedReferences.add(new org.apache.juddi.model.KeyedReference(modelCategoryBag,
+ apiKeyedReference.getTModelKey(), apiKeyedReference.getKeyName(), apiKeyedReference.getKeyValue()));
+ }
+ if (elem.getValue() instanceof org.uddi.api_v3.KeyedReferenceGroup) {
+ org.uddi.api_v3.KeyedReferenceGroup apiKeyedReferenceGroup = (org.uddi.api_v3.KeyedReferenceGroup) elem.getValue();
+ // TODO: Currently, the model doesn't allow for the persistence of keyedReference groups. This must be incorporated into the model. For now
+ // the KeyedReferenceGroups are ignored.
}
}
}
@@ -423,10 +357,8 @@
if (apiTModelInstDetails != null) {
List<org.uddi.api_v3.TModelInstanceInfo> apiTModelInstInfoList = apiTModelInstDetails.getTModelInstanceInfo();
- int id = 0;
for (org.uddi.api_v3.TModelInstanceInfo apiTModelInstInfo : apiTModelInstInfoList) {
- org.apache.juddi.model.TmodelInstanceInfoId tmodelInstInfoId = new org.apache.juddi.model.TmodelInstanceInfoId(modelBindingTemplate.getEntityKey(), id++);
- org.apache.juddi.model.TmodelInstanceInfo modelTModelInstInfo = new org.apache.juddi.model.TmodelInstanceInfo(tmodelInstInfoId, modelBindingTemplate, apiTModelInstInfo.getTModelKey());
+ org.apache.juddi.model.TmodelInstanceInfo modelTModelInstInfo = new org.apache.juddi.model.TmodelInstanceInfo(modelBindingTemplate, apiTModelInstInfo.getTModelKey());
mapTModelInstanceInfoDescriptions(apiTModelInstInfo.getDescription(), modelTModelInstInfo.getTmodelInstanceInfoDescrs(), modelTModelInstInfo, modelBindingTemplate.getEntityKey());
mapInstanceDetails(apiTModelInstInfo.getInstanceDetails(), modelTModelInstInfo, modelBindingTemplate.getEntityKey());
@@ -445,8 +377,7 @@
int id = 0;
for (org.uddi.api_v3.Description apiDesc : apiDescList) {
- org.apache.juddi.model.TmodelInstanceInfoDescrId tmodelInstInfoDescId = new org.apache.juddi.model.TmodelInstanceInfoDescrId(bindingKey, modelTModelInstInfo.getId().getTmodelInstanceInfoId(), id++);
- modelDescList.add(new org.apache.juddi.model.TmodelInstanceInfoDescr(tmodelInstInfoDescId, modelTModelInstInfo, apiDesc.getLang(), apiDesc.getValue()));
+ modelDescList.add(new org.apache.juddi.model.TmodelInstanceInfoDescr(modelTModelInstInfo, apiDesc.getLang(), apiDesc.getValue()));
}
}
@@ -468,8 +399,7 @@
else if (elem.getValue() instanceof org.uddi.api_v3.Description) {
org.uddi.api_v3.Description apiDesc = (org.uddi.api_v3.Description)elem.getValue();
- org.apache.juddi.model.InstanceDetailsDescrId instanceDetailsDescId = new org.apache.juddi.model.InstanceDetailsDescrId(bindingKey, modelTModelInstInfo.getId().getTmodelInstanceInfoId(), descId++);
- modelTModelInstInfo.getInstanceDetailsDescrs().add(new org.apache.juddi.model.InstanceDetailsDescr(instanceDetailsDescId, modelTModelInstInfo, apiDesc.getLang(), apiDesc.getValue()));
+ modelTModelInstInfo.getInstanceDetailsDescrs().add(new org.apache.juddi.model.InstanceDetailsDescr(modelTModelInstInfo, apiDesc.getLang(), apiDesc.getValue()));
}
else if (elem.getValue() instanceof String) {
modelTModelInstInfo.setInstanceParms((String)elem.getValue());
@@ -489,7 +419,7 @@
mapTModelDescriptions(apiTModel.getDescription(), modelTModel.getTmodelDescrs(), modelTModel);
mapTModelIdentifiers(apiTModel.getIdentifierBag(), modelTModel.getTmodelIdentifiers(), modelTModel);
- mapTModelCategories(apiTModel.getCategoryBag(), modelTModel.getTmodelCategories(), modelTModel);
+ mapCategoryBag(apiTModel.getCategoryBag(), modelTModel.getCategoryBag());
//TODO: OverviewDoc - model doesn't have logical mapping
}
@@ -500,10 +430,8 @@
throws DispositionReportFaultMessage {
modelDescList.clear();
- int id = 0;
for (org.uddi.api_v3.Description apiDesc : apiDescList) {
- org.apache.juddi.model.TmodelDescrId tmodelDescId = new org.apache.juddi.model.TmodelDescrId(modelTModel.getEntityKey(), id++);
- modelDescList.add(new org.apache.juddi.model.TmodelDescr(tmodelDescId, modelTModel, apiDesc.getLang(), apiDesc.getValue()));
+ modelDescList.add(new org.apache.juddi.model.TmodelDescr(modelTModel, apiDesc.getLang(), apiDesc.getValue()));
}
}
@@ -515,32 +443,8 @@
if (apiIdentifierBag != null) {
List<org.uddi.api_v3.KeyedReference> apiKeyedRefList = apiIdentifierBag.getKeyedReference();
- int id = 0;
for (org.uddi.api_v3.KeyedReference apiKeyedRef : apiKeyedRefList) {
- org.apache.juddi.model.TmodelIdentifierId identifierId = new org.apache.juddi.model.TmodelIdentifierId(modelTModel.getEntityKey(), id++);
- modelIdentifierList.add(new org.apache.juddi.model.TmodelIdentifier(identifierId, modelTModel, apiKeyedRef.getTModelKey(), apiKeyedRef.getKeyName(), apiKeyedRef.getKeyValue()));
- }
- }
- }
-
- public static void mapTModelCategories(org.uddi.api_v3.CategoryBag apiCategoryBag,
- Set<org.apache.juddi.model.TmodelCategory> modelCategoryList,
- org.apache.juddi.model.Tmodel modelTModel)
- throws DispositionReportFaultMessage {
- modelCategoryList.clear();
-
- if (apiCategoryBag != null) {
- List<JAXBElement<?>> apiCategoryList = apiCategoryBag.getContent();
- int id = 0;
- for (JAXBElement<?> elem : apiCategoryList) {
- // TODO: Currently, the model doesn't allow for the persistence of keyedReference groups. This must be incorporated into the model. For now
- // the KeyedReferenceGroups are ignored.
- if (elem.getValue() instanceof org.uddi.api_v3.KeyedReference) {
- org.uddi.api_v3.KeyedReference apiKeyedRef = (org.uddi.api_v3.KeyedReference)elem.getValue();
-
- org.apache.juddi.model.TmodelCategoryId categoryId = new org.apache.juddi.model.TmodelCategoryId(modelTModel.getEntityKey(), id++);
- modelCategoryList.add(new org.apache.juddi.model.TmodelCategory(categoryId, modelTModel, apiKeyedRef.getTModelKey(), apiKeyedRef.getKeyName(), apiKeyedRef.getKeyValue()));
- }
+ modelIdentifierList.add(new org.apache.juddi.model.TmodelIdentifier(modelTModel, apiKeyedRef.getTModelKey(), apiKeyedRef.getKeyName(), apiKeyedRef.getKeyValue()));
}
}
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java Sat Dec 13 06:43:21 2008
@@ -60,7 +60,7 @@
mapDiscoveryUrls(modelBusinessEntity.getDiscoveryUrls(), apiBusinessEntity.getDiscoveryURLs(), apiBusinessEntity);
mapContacts(modelBusinessEntity.getContacts(), apiBusinessEntity.getContacts(), apiBusinessEntity);
mapBusinessIdentifiers(modelBusinessEntity.getBusinessIdentifiers(), apiBusinessEntity.getIdentifierBag(), apiBusinessEntity);
- mapBusinessCategories(modelBusinessEntity.getBusinessCategories(), apiBusinessEntity.getCategoryBag(), apiBusinessEntity);
+ apiBusinessEntity.setCategoryBag(mapCategoryBag(modelBusinessEntity.getCategoryBag(), apiBusinessEntity.getCategoryBag()));
mapBusinessServices(modelBusinessEntity.getBusinessServices(), apiBusinessEntity.getBusinessServices(), apiBusinessEntity);
@@ -239,29 +239,6 @@
}
apiBusinessEntity.setIdentifierBag(apiIdentifierBag);
}
-
- public static void mapBusinessCategories(Set<org.apache.juddi.model.BusinessCategory> modelCategoryList,
- org.uddi.api_v3.CategoryBag apiCategoryBag,
- org.uddi.api_v3.BusinessEntity apiBusinessEntity)
- throws DispositionReportFaultMessage {
- if (apiCategoryBag == null)
- apiCategoryBag = new org.uddi.api_v3.CategoryBag();
-
- List<JAXBElement<?>> apiCategoryList = apiCategoryBag.getContent();
- apiCategoryList.clear();
-
- for (org.apache.juddi.model.BusinessCategory modelCategory : modelCategoryList) {
- // TODO: Currently, the model doesn't allow for the persistence of keyedReference groups. This must be incorporated into the model. For now
- // the KeyedReferenceGroups are ignored.
-
- org.uddi.api_v3.KeyedReference apiKeyedRef = new org.uddi.api_v3.KeyedReference();
- apiKeyedRef.setTModelKey(modelCategory.getTmodelKeyRef());
- apiKeyedRef.setKeyName(modelCategory.getKeyName());
- apiKeyedRef.setKeyValue(modelCategory.getKeyValue());
- apiCategoryList.add(new ObjectFactory().createKeyedReference(apiKeyedRef));
- }
- apiBusinessEntity.setCategoryBag(apiCategoryBag);
- }
public static void mapBusinessServices(Set<org.apache.juddi.model.BusinessService> modelBusinessServiceList,
org.uddi.api_v3.BusinessServices apiBusinessServices,
@@ -292,7 +269,7 @@
mapServiceNames(modelBusinessService.getServiceNames(), apiBusinessService.getName());
mapServiceDescriptions(modelBusinessService.getServiceDescrs(), apiBusinessService.getDescription());
- mapServiceCategories(modelBusinessService.getServiceCategories(), apiBusinessService.getCategoryBag(), apiBusinessService);
+ apiBusinessService.setCategoryBag(mapCategoryBag(modelBusinessService.getCategoryBag(), apiBusinessService.getCategoryBag()));
}
@@ -321,29 +298,6 @@
apiDescList.add(apiDesc);
}
}
-
- public static void mapServiceCategories(Set<org.apache.juddi.model.ServiceCategory> modelCategoryList,
- org.uddi.api_v3.CategoryBag apiCategoryBag,
- org.uddi.api_v3.BusinessService apiBusinessService)
- throws DispositionReportFaultMessage {
- if (apiCategoryBag == null)
- apiCategoryBag = new org.uddi.api_v3.CategoryBag();
-
- List<JAXBElement<?>> apiCategoryList = apiCategoryBag.getContent();
- apiCategoryList.clear();
-
- for (org.apache.juddi.model.ServiceCategory modelCategory : modelCategoryList) {
- // TODO: Currently, the model doesn't allow for the persistence of keyedReference groups. This must be incorporated into the model. For now
- // the KeyedReferenceGroups are ignored.
-
- org.uddi.api_v3.KeyedReference apiKeyedRef = new org.uddi.api_v3.KeyedReference();
- apiKeyedRef.setTModelKey(modelCategory.getTmodelKeyRef());
- apiKeyedRef.setKeyName(modelCategory.getKeyName());
- apiKeyedRef.setKeyValue(modelCategory.getKeyValue());
- apiCategoryList.add(new ObjectFactory().createKeyedReference(apiKeyedRef));
- }
- apiBusinessService.setCategoryBag(apiCategoryBag);
- }
public static void mapBindingTemplates(Set<org.apache.juddi.model.BindingTemplate> modelBindingTemplateList,
org.uddi.api_v3.BindingTemplates apiBindingTemplates,
@@ -380,7 +334,7 @@
mapBindingDescriptions(modelBindingTemplate.getBindingDescrs(), apiBindingTemplate.getDescription());
- mapBindingCategories(modelBindingTemplate.getBindingCategories(), apiBindingTemplate.getCategoryBag(), apiBindingTemplate);
+ apiBindingTemplate.setCategoryBag(mapCategoryBag(modelBindingTemplate.getBindingTemplateCategoryBag(), apiBindingTemplate.getCategoryBag()));
}
@@ -397,9 +351,8 @@
}
}
- public static void mapBindingCategories(Set<org.apache.juddi.model.BindingCategory> modelCategoryList,
- org.uddi.api_v3.CategoryBag apiCategoryBag,
- org.uddi.api_v3.BindingTemplate apiBindingTemplate)
+ public static org.uddi.api_v3.CategoryBag mapCategoryBag(org.apache.juddi.model.CategoryBag modelCategoryBag,
+ org.uddi.api_v3.CategoryBag apiCategoryBag)
throws DispositionReportFaultMessage {
if (apiCategoryBag == null)
apiCategoryBag = new org.uddi.api_v3.CategoryBag();
@@ -407,17 +360,18 @@
List<JAXBElement<?>> apiCategoryList = apiCategoryBag.getContent();
apiCategoryList.clear();
- for (org.apache.juddi.model.BindingCategory modelCategory : modelCategoryList) {
- // TODO: Currently, the model doesn't allow for the persistence of keyedReference groups. This must be incorporated into the model. For now
- // the KeyedReferenceGroups are ignored.
-
+ for (org.apache.juddi.model.KeyedReference modelKeyedReference : modelCategoryBag.getKeyedReferences()) {
org.uddi.api_v3.KeyedReference apiKeyedRef = new org.uddi.api_v3.KeyedReference();
- apiKeyedRef.setTModelKey(modelCategory.getTmodelKeyRef());
- apiKeyedRef.setKeyName(modelCategory.getKeyName());
- apiKeyedRef.setKeyValue(modelCategory.getKeyValue());
+ apiKeyedRef.setTModelKey(modelKeyedReference.getTmodelKeyRef());
+ apiKeyedRef.setKeyName(modelKeyedReference.getKeyName());
+ apiKeyedRef.setKeyValue(modelKeyedReference.getKeyValue());
apiCategoryList.add(new ObjectFactory().createKeyedReference(apiKeyedRef));
}
- apiBindingTemplate.setCategoryBag(apiCategoryBag);
+ for (org.apache.juddi.model.KeyedReferenceGroup modelKeyedReferenceGroup : modelCategoryBag.getKeyedReferenceGroups()) {
+ // TODO: Currently, the model doesn't allow for the persistence of keyedReference groups. This must be incorporated into the model. For now
+ // the KeyedReferenceGroups are ignored.
+ }
+ return apiCategoryBag;
}
public static void mapTModelInstanceDetails(Set<org.apache.juddi.model.TmodelInstanceInfo> modelTModelInstInfoList,
@@ -494,7 +448,7 @@
mapTModelDescriptions(modelTModel.getTmodelDescrs(), apiTModel.getDescription());
mapTModelIdentifiers(modelTModel.getTmodelIdentifiers(), apiTModel.getIdentifierBag(), apiTModel);
- mapTModelCategories(modelTModel.getTmodelCategories(), apiTModel.getCategoryBag(), apiTModel);
+ apiTModel.setCategoryBag(mapCategoryBag(modelTModel.getCategoryBag(), apiTModel.getCategoryBag()));
//TODO: OverviewDoc - model doesn't have logical mapping
apiTModel.getOverviewDoc();
@@ -532,29 +486,6 @@
}
apiTModel.setIdentifierBag(apiIdentifierBag);
}
-
- public static void mapTModelCategories(Set<org.apache.juddi.model.TmodelCategory> modelCategoryList,
- org.uddi.api_v3.CategoryBag apiCategoryBag,
- org.uddi.api_v3.TModel apiTModel)
- throws DispositionReportFaultMessage {
- if (apiCategoryBag == null)
- apiCategoryBag = new org.uddi.api_v3.CategoryBag();
-
- List<JAXBElement<?>> apiCategoryList = apiCategoryBag.getContent();
- apiCategoryList.clear();
-
- for (org.apache.juddi.model.TmodelCategory modelCategory : modelCategoryList) {
- // TODO: Currently, the model doesn't allow for the persistence of keyedReference groups. This must be incorporated into the model. For now
- // the KeyedReferenceGroups are ignored.
-
- org.uddi.api_v3.KeyedReference apiKeyedRef = new org.uddi.api_v3.KeyedReference();
- apiKeyedRef.setTModelKey(modelCategory.getTmodelKeyRef());
- apiKeyedRef.setKeyName(modelCategory.getKeyName());
- apiKeyedRef.setKeyValue(modelCategory.getKeyValue());
- apiCategoryList.add(new ObjectFactory().createKeyedReference(apiKeyedRef));
- }
- apiTModel.setCategoryBag(apiCategoryBag);
- }
public static void mapBusinessInfo(org.apache.juddi.model.BusinessEntity modelBusinessEntity,
org.uddi.api_v3.BusinessInfo apiBusinessInfo)
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Address.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Address.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Address.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Address.java Sat Dec 13 06:43:21 2008
@@ -17,15 +17,14 @@
import java.util.HashSet;
import java.util.Set;
-import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@@ -39,7 +38,7 @@
public class Address implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private AddressId id;
+ private Long id;
private Contact contact;
private String useType;
private String sortCode;
@@ -49,13 +48,11 @@
public Address() {
}
- public Address(AddressId id, Contact contact) {
- this.id = id;
+ public Address(Contact contact) {
this.contact = contact;
}
- public Address(AddressId id, Contact contact, String useType,
+ public Address(Long id, Contact contact, String useType,
String sortCode, String tmodelKey, Set<AddressLine> addressLines) {
- this.id = id;
this.contact = contact;
this.useType = useType;
this.sortCode = sortCode;
@@ -63,18 +60,17 @@
this.addressLines = addressLines;
}
- @EmbeddedId
- public AddressId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(AddressId id) {
+ public void setId(Long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
- @JoinColumns({
- @JoinColumn(name = "entity_key", referencedColumnName = "entity_key", nullable = false, insertable = false, updatable = false),
- @JoinColumn(name = "contact_id", referencedColumnName = "contact_id", nullable = false, insertable = false, updatable = false)})
+ @JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
public Contact getContact() {
return this.contact;
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLine.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLine.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLine.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLine.java Sat Dec 13 06:43:21 2008
@@ -16,11 +16,12 @@
*/
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@@ -33,7 +34,7 @@
public class AddressLine implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private AddressLineId id;
+ private Long id;
private Address address;
private String line;
private String keyName;
@@ -42,33 +43,29 @@
public AddressLine() {
}
- public AddressLine(AddressLineId id, Address address, String line) {
- this.id = id;
+ public AddressLine(Address address, String line) {
this.address = address;
this.line = line;
}
- public AddressLine(AddressLineId id, Address address, String line,
+ public AddressLine(Address address, String line,
String keyName, String keyValue) {
- this.id = id;
this.address = address;
this.line = line;
this.keyName = keyName;
this.keyValue = keyValue;
}
- @EmbeddedId
- public AddressLineId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(AddressLineId id) {
+ public void setId(Long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
- @JoinColumns({
- @JoinColumn(name = "entity_key", referencedColumnName = "entity_key", nullable = false, insertable = false, updatable = false),
- @JoinColumn(name = "contact_id", referencedColumnName = "contact_id", nullable = false, insertable = false, updatable = false),
- @JoinColumn(name = "address_id", referencedColumnName = "address_id", nullable = false, insertable = false, updatable = false)})
+ @JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
public Address getAddress() {
return this.address;
}
Added: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingCategoryBag.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingCategoryBag.java?rev=726212&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingCategoryBag.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingCategoryBag.java Sat Dec 13 06:43:21 2008
@@ -0,0 +1,42 @@
+package org.apache.juddi.model;
+/*
+ * Copyright 2001-2008 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+
+/**
+ * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
+ */
+@Entity
+@Table(name = "binding_category_bag")
+public class BindingCategoryBag extends CategoryBag {
+
+ private static final long serialVersionUID = 1L;
+ private BindingTemplate bindingTemplate;
+
+ @OneToOne(optional=false)
+ @JoinColumn(name = "binding_template_id")
+ public BindingTemplate getBindingTemplate() {
+ return bindingTemplate;
+ }
+
+ public void setBindingTemplate(BindingTemplate bindingTemplate) {
+ this.bindingTemplate = bindingTemplate;
+ }
+}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescr.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescr.java Sat Dec 13 06:43:21 2008
@@ -16,9 +16,11 @@
*/
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@@ -32,7 +34,7 @@
public class BindingDescr implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private BindingDescrId id;
+ private Long id;
private BindingTemplate bindingTemplate;
private String langCode;
private String descr;
@@ -40,25 +42,24 @@
public BindingDescr() {
}
- public BindingDescr(BindingDescrId id, BindingTemplate bindingTemplate,
+ public BindingDescr(BindingTemplate bindingTemplate,
String descr) {
- this.id = id;
this.bindingTemplate = bindingTemplate;
this.descr = descr;
}
- public BindingDescr(BindingDescrId id, BindingTemplate bindingTemplate,
+ public BindingDescr(BindingTemplate bindingTemplate,
String langCode, String descr) {
- this.id = id;
this.bindingTemplate = bindingTemplate;
this.langCode = langCode;
this.descr = descr;
}
- @EmbeddedId
- public BindingDescrId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(BindingDescrId id) {
+ public void setId(Long id) {
this.id = id;
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java Sat Dec 13 06:43:21 2008
@@ -26,6 +26,7 @@
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
import javax.persistence.Table;
/**
@@ -41,7 +42,7 @@
private String accessPointType;
private String accessPointUrl;
private String hostingRedirector;
- private Set<BindingCategory> bindingCategories = new HashSet<BindingCategory>(0);
+ private BindingCategoryBag categoryBag = new BindingCategoryBag();
private Set<TmodelInstanceInfo> tmodelInstanceInfos = new HashSet<TmodelInstanceInfo>(0);
private Set<BindingDescr> bindingDescrs = new HashSet<BindingDescr>(0);
@@ -55,7 +56,7 @@
}
public BindingTemplate(String entityKey, BusinessService businessService, String accessPointType,
String accessPointUrl, String hostingRedirector, Date lastUpdate,
- Set<BindingCategory> bindingCategories,
+ BindingCategoryBag categoryBag,
Set<TmodelInstanceInfo> tmodelInstanceInfos,
Set<BindingDescr> bindingDescrs) {
this.entityKey = entityKey;
@@ -64,7 +65,7 @@
this.accessPointUrl = accessPointUrl;
this.hostingRedirector = hostingRedirector;
this.lastUpdate = lastUpdate;
- this.bindingCategories = bindingCategories;
+ this.categoryBag = categoryBag;
this.tmodelInstanceInfos = tmodelInstanceInfos;
this.bindingDescrs = bindingDescrs;
}
@@ -101,13 +102,13 @@
public void setHostingRedirector(String hostingRedirector) {
this.hostingRedirector = hostingRedirector;
}
-
- @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bindingTemplate")
- public Set<BindingCategory> getBindingCategories() {
- return this.bindingCategories;
+
+ @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bindingTemplate")
+ public BindingCategoryBag getBindingTemplateCategoryBag() {
+ return this.categoryBag;
}
- public void setBindingCategories(Set<BindingCategory> bindingCategories) {
- this.bindingCategories = bindingCategories;
+ public void setBindingTemplateCategoryBag(BindingCategoryBag categoryBag) {
+ this.categoryBag = categoryBag;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bindingTemplate")
Added: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessCategoryBag.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessCategoryBag.java?rev=726212&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessCategoryBag.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessCategoryBag.java Sat Dec 13 06:43:21 2008
@@ -0,0 +1,43 @@
+package org.apache.juddi.model;
+/*
+ * Copyright 2001-2008 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+
+/**
+ * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
+ */
+@Entity
+@Table(name = "business_category_bag")
+public class BusinessCategoryBag extends CategoryBag {
+
+ private static final long serialVersionUID = 1L;
+ private BusinessEntity businessEntity;
+
+ @OneToOne(optional=false)
+ @JoinColumn(name = "business_entity_id")
+ public BusinessEntity getBusinessEntity() {
+ return businessEntity;
+ }
+ public void setBusinessEntity(BusinessEntity businessEntity) {
+ this.businessEntity = businessEntity;
+ }
+
+
+}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescr.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescr.java Sat Dec 13 06:43:21 2008
@@ -16,9 +16,11 @@
*/
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@@ -32,7 +34,7 @@
public class BusinessDescr implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private BusinessDescrId id;
+ private Long id;
private BusinessEntity businessEntity;
private String langCode;
private String descr;
@@ -40,25 +42,24 @@
public BusinessDescr() {
}
- public BusinessDescr(BusinessDescrId id, BusinessEntity businessEntity,
+ public BusinessDescr(BusinessEntity businessEntity,
String descr) {
- this.id = id;
this.businessEntity = businessEntity;
this.descr = descr;
}
- public BusinessDescr(BusinessDescrId id, BusinessEntity businessEntity,
+ public BusinessDescr(BusinessEntity businessEntity,
String langCode, String descr) {
- this.id = id;
this.businessEntity = businessEntity;
this.langCode = langCode;
this.descr = descr;
}
- @EmbeddedId
- public BusinessDescrId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(BusinessDescrId id) {
+ public void setId(Long id) {
this.id = id;
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java Sat Dec 13 06:43:21 2008
@@ -25,6 +25,7 @@
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.OrderBy;
@@ -44,7 +45,7 @@
private Set<DiscoveryUrl> discoveryUrls = new HashSet<DiscoveryUrl>(0);
private Set<BusinessName> businessNames = new HashSet<BusinessName>(0);
private Set<PublisherAssertion> publisherAssertionsForToKey = new HashSet<PublisherAssertion>(0);
- private Set<BusinessCategory> businessCategories = new HashSet<BusinessCategory>(0);
+ private BusinessCategoryBag categoryBag = new BusinessCategoryBag();
private Set<BusinessService> businessServices = new HashSet<BusinessService>(0);
private Set<BusinessDescr> businessDescrs = new HashSet<BusinessDescr>(0);
@@ -62,7 +63,7 @@
Set<PublisherAssertion> publisherAssertionsForFromKey,
Set<DiscoveryUrl> discoveryUrls, Set<BusinessName> businessNames,
Set<PublisherAssertion> publisherAssertionsForToKey,
- Set<BusinessCategory> businessCategories,
+ BusinessCategoryBag categoryBag,
Set<BusinessService> businessServices,
Set<BusinessDescr> businessDescrs) {
this.entityKey = entityKey;
@@ -74,7 +75,7 @@
this.discoveryUrls = discoveryUrls;
this.businessNames = businessNames;
this.publisherAssertionsForToKey = publisherAssertionsForToKey;
- this.businessCategories = businessCategories;
+ this.categoryBag = categoryBag;
this.businessServices = businessServices;
this.businessDescrs = businessDescrs;
}
@@ -143,13 +144,12 @@
this.publisherAssertionsForToKey = publisherAssertionsForToKey;
}
- @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
- @OrderBy
- public Set<BusinessCategory> getBusinessCategories() {
- return this.businessCategories;
+ @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
+ public BusinessCategoryBag getCategoryBag() {
+ return this.categoryBag;
}
- public void setBusinessCategories(Set<BusinessCategory> businessCategories) {
- this.businessCategories = businessCategories;
+ public void setCategoryBag(BusinessCategoryBag categoryBag) {
+ this.categoryBag = categoryBag;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifier.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifier.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifier.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifier.java Sat Dec 13 06:43:21 2008
@@ -16,9 +16,11 @@
*/
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@@ -32,7 +34,7 @@
public class BusinessIdentifier implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private BusinessIdentifierId id;
+ private Long id;
private BusinessEntity businessEntity;
private String tmodelKeyRef;
private String keyName;
@@ -41,27 +43,24 @@
public BusinessIdentifier() {
}
- public BusinessIdentifier(BusinessIdentifierId id,
- BusinessEntity businessEntity, String keyValue) {
- this.id = id;
+ public BusinessIdentifier(BusinessEntity businessEntity, String keyValue) {
this.businessEntity = businessEntity;
this.keyValue = keyValue;
}
- public BusinessIdentifier(BusinessIdentifierId id,
- BusinessEntity businessEntity, String tmodelKeyRef, String keyName,
+ public BusinessIdentifier(BusinessEntity businessEntity, String tmodelKeyRef, String keyName,
String keyValue) {
- this.id = id;
this.businessEntity = businessEntity;
this.tmodelKeyRef = tmodelKeyRef;
this.keyName = keyName;
this.keyValue = keyValue;
}
- @EmbeddedId
- public BusinessIdentifierId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(BusinessIdentifierId id) {
+ public void setId(Long id) {
this.id = id;
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessName.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessName.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessName.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessName.java Sat Dec 13 06:43:21 2008
@@ -16,9 +16,11 @@
*/
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@@ -32,7 +34,7 @@
public class BusinessName implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private BusinessNameId id;
+ private Long id;
private BusinessEntity businessEntity;
private String langCode;
private String name;
@@ -40,25 +42,24 @@
public BusinessName() {
}
- public BusinessName(BusinessNameId id, BusinessEntity businessEntity,
+ public BusinessName(Long id, BusinessEntity businessEntity,
String name) {
- this.id = id;
this.businessEntity = businessEntity;
this.name = name;
}
- public BusinessName(BusinessNameId id, BusinessEntity businessEntity,
+ public BusinessName(BusinessEntity businessEntity,
String langCode, String name) {
- this.id = id;
this.businessEntity = businessEntity;
this.langCode = langCode;
this.name = name;
}
- @EmbeddedId
- public BusinessNameId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(BusinessNameId id) {
+ public void setId(Long id) {
this.id = id;
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java Sat Dec 13 06:43:21 2008
@@ -25,6 +25,7 @@
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
import javax.persistence.Table;
/**
@@ -40,7 +41,7 @@
private Set<ServiceName> serviceNames = new HashSet<ServiceName>(0);
private Set<ServiceDescr> serviceDescrs = new HashSet<ServiceDescr>(0);
private Set<BindingTemplate> bindingTemplates = new HashSet<BindingTemplate>(0);
- private Set<ServiceCategory> serviceCategories = new HashSet<ServiceCategory>(0);
+ private ServiceCategoryBag categoryBag = new ServiceCategoryBag();
public BusinessService() {
}
@@ -53,14 +54,14 @@
public BusinessService(String entityKey, BusinessEntity businessEntity, Date lastUpdate,
Set<ServiceName> serviceNames, Set<ServiceDescr> serviceDescrs,
Set<BindingTemplate> bindingTemplates,
- Set<ServiceCategory> serviceCategories) {
+ ServiceCategoryBag categoryBag) {
this.entityKey = entityKey;
this.businessEntity = businessEntity;
this.lastUpdate = lastUpdate;
this.serviceNames = serviceNames;
this.serviceDescrs = serviceDescrs;
this.bindingTemplates = bindingTemplates;
- this.serviceCategories = serviceCategories;
+ this.categoryBag = categoryBag;
}
@ManyToOne(fetch = FetchType.LAZY)
@@ -96,12 +97,12 @@
this.bindingTemplates = bindingTemplates;
}
- @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessService")
- public Set<ServiceCategory> getServiceCategories() {
- return this.serviceCategories;
+ @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessService")
+ public ServiceCategoryBag getCategoryBag() {
+ return this.categoryBag;
}
- public void setServiceCategories(Set<ServiceCategory> serviceCategories) {
- this.serviceCategories = serviceCategories;
+ public void setCategoryBag(ServiceCategoryBag categoryBag) {
+ this.categoryBag = categoryBag;
}
public String retrieveAuthorizedName() {
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/CategoryBag.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/CategoryBag.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/CategoryBag.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/CategoryBag.java Sat Dec 13 06:43:21 2008
@@ -15,11 +15,18 @@
* limitations under the License.
*/
-import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
@@ -27,29 +34,48 @@
*/
@Entity
@Table(name = "category_bag")
+@Inheritance(strategy = InheritanceType.JOINED)
+
public class CategoryBag implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private CategoryBagId id;
-
+ private Long id;
+ private Set<KeyedReference> keyedReferences = new HashSet<KeyedReference>(0);
+ private Set<KeyedReferenceGroup> keyedReferenceGroups = new HashSet<KeyedReferenceGroup>(0);
+
public CategoryBag() {
}
- public CategoryBag(CategoryBagId id) {
+ public CategoryBag(Long id) {
this.id = id;
}
- @EmbeddedId
- @AttributeOverrides({
- @AttributeOverride(name = "categoryBagKey", column = @Column(name = "category_bag_key", nullable = false, length = 255)),
- @AttributeOverride(name = "tmodelKeyRef", column = @Column(name = "tmodel_key_ref", length = 255))})
-
- public CategoryBagId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(CategoryBagId id) {
+ public void setId(Long id) {
this.id = id;
}
+
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "categoryBag")
+ public Set<KeyedReference> getKeyedReferences() {
+ return keyedReferences;
+ }
+ public void setKeyedReferences(Set<KeyedReference> keyedReferences) {
+ this.keyedReferences = keyedReferences;
+ }
+
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "categoryBag")
+ public Set<KeyedReferenceGroup> getKeyedReferenceGroups() {
+ return keyedReferenceGroups;
+ }
+ public void setKeyedReferenceGroups(
+ Set<KeyedReferenceGroup> keyedReferenceGroups) {
+ this.keyedReferenceGroups = keyedReferenceGroups;
+ }
+
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Contact.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Contact.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Contact.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Contact.java Sat Dec 13 06:43:21 2008
@@ -20,9 +20,11 @@
import javax.persistence.CascadeType;
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
@@ -38,7 +40,7 @@
public class Contact implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private ContactId id;
+ private Long id;
private BusinessEntity businessEntity;
private String useType;
private Set<PersonName> personNames = new HashSet<PersonName>(0);
@@ -50,14 +52,12 @@
public Contact() {
}
- public Contact(ContactId id, BusinessEntity businessEntity) {
- this.id = id;
+ public Contact(BusinessEntity businessEntity) {
this.businessEntity = businessEntity;
}
- public Contact(ContactId id, BusinessEntity businessEntity, String useType,
+ public Contact(BusinessEntity businessEntity, String useType,
Set<PersonName> personNames, Set<ContactDescr> contactDescrs,
Set<Email> emails, Set<Phone> phones, Set<Address> addresses) {
- this.id = id;
this.businessEntity = businessEntity;
this.useType = useType;
this.personNames = personNames;
@@ -67,11 +67,12 @@
this.addresses = addresses;
}
- @EmbeddedId
- public ContactId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(ContactId id) {
+ public void setId(Long id) {
this.id = id;
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescr.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescr.java Sat Dec 13 06:43:21 2008
@@ -16,11 +16,12 @@
*/
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@@ -33,7 +34,7 @@
public class ContactDescr implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private ContactDescrId id;
+ private Long id;
private Contact contact;
private String langCode;
private String descr;
@@ -41,31 +42,28 @@
public ContactDescr() {
}
- public ContactDescr(ContactDescrId id, Contact contact, String descr) {
- this.id = id;
+ public ContactDescr(Contact contact, String descr) {
this.contact = contact;
this.descr = descr;
}
- public ContactDescr(ContactDescrId id, Contact contact, String langCode,
+ public ContactDescr(Contact contact, String langCode,
String descr) {
- this.id = id;
this.contact = contact;
this.langCode = langCode;
this.descr = descr;
}
- @EmbeddedId
- public ContactDescrId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(ContactDescrId id) {
+ public void setId(Long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
- @JoinColumns({
- @JoinColumn(name = "entity_key", referencedColumnName = "entity_key", nullable = false, insertable = false, updatable = false),
- @JoinColumn(name = "contact_id", referencedColumnName = "contact_id", nullable = false, insertable = false, updatable = false)})
+ @JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
public Contact getContact() {
return this.contact;
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrl.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrl.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrl.java Sat Dec 13 06:43:21 2008
@@ -16,9 +16,11 @@
*/
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@@ -32,7 +34,7 @@
public class DiscoveryUrl implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private DiscoveryUrlId id;
+ private Long id;
private BusinessEntity businessEntity;
private String useType;
private String url;
@@ -40,19 +42,19 @@
public DiscoveryUrl() {
}
- public DiscoveryUrl(DiscoveryUrlId id, BusinessEntity businessEntity,
+ public DiscoveryUrl(BusinessEntity businessEntity,
String useType, String url) {
- this.id = id;
this.businessEntity = businessEntity;
this.useType = useType;
this.url = url;
}
- @EmbeddedId
- public DiscoveryUrlId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(DiscoveryUrlId id) {
+ public void setId(Long id) {
this.id = id;
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Email.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Email.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Email.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Email.java Sat Dec 13 06:43:21 2008
@@ -16,11 +16,12 @@
*/
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@@ -33,7 +34,7 @@
public class Email implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private EmailId id;
+ private Long id;
private Contact contact;
private String useType;
private String emailAddress;
@@ -41,31 +42,28 @@
public Email() {
}
- public Email(EmailId id, Contact contact, String emailAddress) {
- this.id = id;
+ public Email(Contact contact, String emailAddress) {
this.contact = contact;
this.emailAddress = emailAddress;
}
- public Email(EmailId id, Contact contact, String useType,
+ public Email(Contact contact, String useType,
String emailAddress) {
- this.id = id;
this.contact = contact;
this.useType = useType;
this.emailAddress = emailAddress;
}
- @EmbeddedId
- public EmailId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(EmailId id) {
+ public void setId(Long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
- @JoinColumns({
- @JoinColumn(name = "entity_key", referencedColumnName = "entity_key", nullable = false, insertable = false, updatable = false),
- @JoinColumn(name = "contact_id", referencedColumnName = "contact_id", nullable = false, insertable = false, updatable = false)})
+ @JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
public Contact getContact() {
return this.contact;
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescr.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescr.java Sat Dec 13 06:43:21 2008
@@ -16,11 +16,12 @@
*/
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@@ -33,7 +34,7 @@
public class InstanceDetailsDescr implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private InstanceDetailsDescrId id;
+ private Long id;
private TmodelInstanceInfo tmodelInstanceInfo;
private String langCode;
private String descr;
@@ -41,33 +42,28 @@
public InstanceDetailsDescr() {
}
- public InstanceDetailsDescr(InstanceDetailsDescrId id,
- TmodelInstanceInfo tmodelInstanceInfo, String descr) {
- this.id = id;
+ public InstanceDetailsDescr(TmodelInstanceInfo tmodelInstanceInfo, String descr) {
this.tmodelInstanceInfo = tmodelInstanceInfo;
this.descr = descr;
}
- public InstanceDetailsDescr(InstanceDetailsDescrId id,
- TmodelInstanceInfo tmodelInstanceInfo, String langCode, String descr) {
- this.id = id;
+ public InstanceDetailsDescr(TmodelInstanceInfo tmodelInstanceInfo, String langCode, String descr) {
this.tmodelInstanceInfo = tmodelInstanceInfo;
this.langCode = langCode;
this.descr = descr;
}
- @EmbeddedId
- public InstanceDetailsDescrId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(InstanceDetailsDescrId id) {
+ public void setId(Long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
- @JoinColumns({
- @JoinColumn(name = "entity_key", referencedColumnName = "entity_key", nullable = false, insertable = false, updatable = false),
- @JoinColumn(name = "instance_info_id", referencedColumnName = "instance_info_id", nullable = false, insertable = false, updatable = false)})
+ @JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
public TmodelInstanceInfo getTmodelInstanceInfo() {
return this.tmodelInstanceInfo;
}
Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescr.java?rev=726212&r1=726211&r2=726212&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescr.java Sat Dec 13 06:43:21 2008
@@ -16,11 +16,12 @@
*/
import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@@ -33,7 +34,7 @@
public class InstanceDetailsDocDescr implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private InstanceDetailsDocDescrId id;
+ private Long id;
private TmodelInstanceInfo tmodelInstanceInfo;
private String langCode;
private String descr;
@@ -41,14 +42,14 @@
public InstanceDetailsDocDescr() {
}
- public InstanceDetailsDocDescr(InstanceDetailsDocDescrId id,
+ public InstanceDetailsDocDescr(Long id,
TmodelInstanceInfo tmodelInstanceInfo, String descr) {
this.id = id;
this.tmodelInstanceInfo = tmodelInstanceInfo;
this.descr = descr;
}
- public InstanceDetailsDocDescr(InstanceDetailsDocDescrId id,
+ public InstanceDetailsDocDescr(Long id,
TmodelInstanceInfo tmodelInstanceInfo, String langCode, String descr) {
this.id = id;
this.tmodelInstanceInfo = tmodelInstanceInfo;
@@ -56,18 +57,17 @@
this.descr = descr;
}
- @EmbeddedId
- public InstanceDetailsDocDescrId getId() {
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
return this.id;
}
- public void setId(InstanceDetailsDocDescrId id) {
+ public void setId(Long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
- @JoinColumns({
- @JoinColumn(name = "entity_key", referencedColumnName = "entity_key", nullable = false, insertable = false, updatable = false),
- @JoinColumn(name = "instance_info_id", referencedColumnName = "instance_info_id", nullable = false, insertable = false, updatable = false)})
+ @JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
public TmodelInstanceInfo getTmodelInstanceInfo() {
return this.tmodelInstanceInfo;
}
Added: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReference.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReference.java?rev=726212&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReference.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReference.java Sat Dec 13 06:43:21 2008
@@ -0,0 +1,99 @@
+package org.apache.juddi.model;
+/*
+ * Copyright 2001-2008 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+/**
+ * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
+ */
+@Entity
+@Table(name = "keyed_reference")
+public class KeyedReference implements java.io.Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private Long id;
+ private CategoryBag categoryBag;
+ private String tmodelKeyRef;
+ private String keyName;
+ private String keyValue;
+
+ public KeyedReference() {
+ }
+
+ public KeyedReference(CategoryBag categoryBag, String keyValue) {
+ this.categoryBag = categoryBag;
+ this.keyValue = keyValue;
+ }
+ public KeyedReference(CategoryBag categoryBag, String tmodelKeyRef,
+ String keyName, String keyValue) {
+ this.categoryBag = categoryBag;
+ this.tmodelKeyRef = tmodelKeyRef;
+ this.keyName = keyName;
+ this.keyValue = keyValue;
+ }
+
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
+ return this.id;
+ }
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "category_bag_id", nullable = false, insertable = false, updatable = false)
+ public CategoryBag getCategoryBag() {
+ return this.categoryBag;
+ }
+ public void setCategoryBag(CategoryBag categoryBag) {
+ this.categoryBag = categoryBag;
+ }
+
+ @Column(name = "tmodel_key_ref", length = 255)
+ public String getTmodelKeyRef() {
+ return this.tmodelKeyRef;
+ }
+ public void setTmodelKeyRef(String tmodelKeyRef) {
+ this.tmodelKeyRef = tmodelKeyRef;
+ }
+
+ @Column(name = "key_name")
+ public String getKeyName() {
+ return this.keyName;
+ }
+ public void setKeyName(String keyName) {
+ this.keyName = keyName;
+ }
+
+ @Column(name = "key_value", nullable = false)
+ public String getKeyValue() {
+ return this.keyValue;
+ }
+ public void setKeyValue(String keyValue) {
+ this.keyValue = keyValue;
+ }
+
+}
Added: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReferenceGroup.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReferenceGroup.java?rev=726212&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReferenceGroup.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReferenceGroup.java Sat Dec 13 06:43:21 2008
@@ -0,0 +1,65 @@
+package org.apache.juddi.model;
+/*
+ * Copyright 2001-2008 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+/**
+ * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
+ */
+@Entity
+@Table(name = "keyed_reference_group")
+public class KeyedReferenceGroup implements java.io.Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private Long id;
+ private CategoryBag categoryBag;
+
+
+ public KeyedReferenceGroup() {
+ }
+
+ public KeyedReferenceGroup(CategoryBag categoryBag, String keyValue) {
+ this.categoryBag = categoryBag;
+
+ }
+
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ public Long getId() {
+ return this.id;
+ }
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+ public CategoryBag getCategoryBag() {
+ return this.categoryBag;
+ }
+ public void setCategoryBag(CategoryBag categoryBag) {
+ this.categoryBag = categoryBag;
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: juddi-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: juddi-cvs-help@ws.apache.org