001// -------------------------------------------------------------------------------- 002// Copyright 2002-2026 Echo Three, LLC 003// 004// Licensed under the Apache License, Version 2.0 (the "License"); 005// you may not use this file except in compliance with the License. 006// You may obtain a copy of the License at 007// 008// http://www.apache.org/licenses/LICENSE-2.0 009// 010// Unless required by applicable law or agreed to in writing, software 011// distributed under the License is distributed on an "AS IS" BASIS, 012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013// See the License for the specific language governing permissions and 014// limitations under the License. 015// -------------------------------------------------------------------------------- 016 017package com.echothree.control.user.graphql.server.schema; 018 019import com.echothree.control.user.accounting.common.AccountingUtil; 020import com.echothree.control.user.accounting.server.command.GetCurrenciesCommand; 021import com.echothree.control.user.accounting.server.command.GetCurrencyCommand; 022import com.echothree.control.user.accounting.server.command.GetGlAccountCategoriesCommand; 023import com.echothree.control.user.accounting.server.command.GetGlAccountCategoryCommand; 024import com.echothree.control.user.accounting.server.command.GetGlAccountClassCommand; 025import com.echothree.control.user.accounting.server.command.GetGlAccountClassesCommand; 026import com.echothree.control.user.accounting.server.command.GetGlAccountCommand; 027import com.echothree.control.user.accounting.server.command.GetGlAccountTypeCommand; 028import com.echothree.control.user.accounting.server.command.GetGlAccountTypesCommand; 029import com.echothree.control.user.accounting.server.command.GetGlAccountsCommand; 030import com.echothree.control.user.accounting.server.command.GetGlResourceTypeCommand; 031import com.echothree.control.user.accounting.server.command.GetGlResourceTypesCommand; 032import com.echothree.control.user.accounting.server.command.GetItemAccountingCategoriesCommand; 033import com.echothree.control.user.accounting.server.command.GetItemAccountingCategoryCommand; 034import com.echothree.control.user.accounting.server.command.GetSymbolPositionCommand; 035import com.echothree.control.user.accounting.server.command.GetSymbolPositionsCommand; 036import com.echothree.control.user.accounting.server.command.GetTransactionCommand; 037import com.echothree.control.user.accounting.server.command.GetTransactionEntityRoleTypeCommand; 038import com.echothree.control.user.accounting.server.command.GetTransactionEntityRoleTypesCommand; 039import com.echothree.control.user.accounting.server.command.GetTransactionGlAccountCategoriesCommand; 040import com.echothree.control.user.accounting.server.command.GetTransactionGlAccountCategoryCommand; 041import com.echothree.control.user.accounting.server.command.GetTransactionGroupCommand; 042import com.echothree.control.user.accounting.server.command.GetTransactionGroupsCommand; 043import com.echothree.control.user.accounting.server.command.GetTransactionTimeTypeCommand; 044import com.echothree.control.user.accounting.server.command.GetTransactionTimeTypesCommand; 045import com.echothree.control.user.accounting.server.command.GetTransactionTypeCommand; 046import com.echothree.control.user.accounting.server.command.GetTransactionTypesCommand; 047import com.echothree.control.user.accounting.server.command.GetTransactionsCommand; 048import com.echothree.control.user.cancellationpolicy.common.CancellationPolicyUtil; 049import com.echothree.control.user.cancellationpolicy.server.command.GetCancellationKindCommand; 050import com.echothree.control.user.cancellationpolicy.server.command.GetCancellationKindsCommand; 051import com.echothree.control.user.cancellationpolicy.server.command.GetCancellationPoliciesCommand; 052import com.echothree.control.user.cancellationpolicy.server.command.GetCancellationPolicyCommand; 053import com.echothree.control.user.content.common.ContentUtil; 054import com.echothree.control.user.content.server.command.GetContentCatalogCommand; 055import com.echothree.control.user.content.server.command.GetContentCatalogItemCommand; 056import com.echothree.control.user.content.server.command.GetContentCatalogItemsCommand; 057import com.echothree.control.user.content.server.command.GetContentCatalogsCommand; 058import com.echothree.control.user.content.server.command.GetContentCategoriesCommand; 059import com.echothree.control.user.content.server.command.GetContentCategoryCommand; 060import com.echothree.control.user.content.server.command.GetContentCategoryItemCommand; 061import com.echothree.control.user.content.server.command.GetContentCategoryItemsCommand; 062import com.echothree.control.user.content.server.command.GetContentCollectionCommand; 063import com.echothree.control.user.content.server.command.GetContentCollectionsCommand; 064import com.echothree.control.user.content.server.command.GetContentPageAreaCommand; 065import com.echothree.control.user.content.server.command.GetContentPageAreaTypeCommand; 066import com.echothree.control.user.content.server.command.GetContentPageAreaTypesCommand; 067import com.echothree.control.user.content.server.command.GetContentPageAreasCommand; 068import com.echothree.control.user.content.server.command.GetContentPageCommand; 069import com.echothree.control.user.content.server.command.GetContentPageLayoutAreaCommand; 070import com.echothree.control.user.content.server.command.GetContentPageLayoutAreasCommand; 071import com.echothree.control.user.content.server.command.GetContentPageLayoutCommand; 072import com.echothree.control.user.content.server.command.GetContentPageLayoutsCommand; 073import com.echothree.control.user.content.server.command.GetContentPagesCommand; 074import com.echothree.control.user.content.server.command.GetContentSectionCommand; 075import com.echothree.control.user.content.server.command.GetContentSectionsCommand; 076import com.echothree.control.user.content.server.command.GetContentWebAddressCommand; 077import com.echothree.control.user.content.server.command.GetContentWebAddressesCommand; 078import com.echothree.control.user.core.common.CoreUtil; 079import com.echothree.control.user.core.server.command.GetAppearanceCommand; 080import com.echothree.control.user.core.server.command.GetAppearancesCommand; 081import com.echothree.control.user.core.server.command.GetColorCommand; 082import com.echothree.control.user.core.server.command.GetColorsCommand; 083import com.echothree.control.user.core.server.command.GetComponentVendorCommand; 084import com.echothree.control.user.core.server.command.GetComponentVendorsCommand; 085import com.echothree.control.user.core.server.command.GetEntityAliasCommand; 086import com.echothree.control.user.core.server.command.GetEntityAliasTypeCommand; 087import com.echothree.control.user.core.server.command.GetEntityAliasTypesCommand; 088import com.echothree.control.user.core.server.command.GetEntityAliasesCommand; 089import com.echothree.control.user.core.server.command.GetEntityAttributeCommand; 090import com.echothree.control.user.core.server.command.GetEntityAttributeEntityAttributeGroupCommand; 091import com.echothree.control.user.core.server.command.GetEntityAttributeEntityAttributeGroupsCommand; 092import com.echothree.control.user.core.server.command.GetEntityAttributeGroupCommand; 093import com.echothree.control.user.core.server.command.GetEntityAttributeGroupsCommand; 094import com.echothree.control.user.core.server.command.GetEntityAttributeTypeCommand; 095import com.echothree.control.user.core.server.command.GetEntityAttributeTypesCommand; 096import com.echothree.control.user.core.server.command.GetEntityAttributesCommand; 097import com.echothree.control.user.core.server.command.GetEntityInstanceCommand; 098import com.echothree.control.user.core.server.command.GetEntityInstancesCommand; 099import com.echothree.control.user.core.server.command.GetEntityTypeCommand; 100import com.echothree.control.user.core.server.command.GetEntityTypesCommand; 101import com.echothree.control.user.core.server.command.GetEventTypeCommand; 102import com.echothree.control.user.core.server.command.GetEventTypesCommand; 103import com.echothree.control.user.core.server.command.GetFontStyleCommand; 104import com.echothree.control.user.core.server.command.GetFontStylesCommand; 105import com.echothree.control.user.core.server.command.GetFontWeightCommand; 106import com.echothree.control.user.core.server.command.GetFontWeightsCommand; 107import com.echothree.control.user.core.server.command.GetMimeTypeCommand; 108import com.echothree.control.user.core.server.command.GetMimeTypeFileExtensionCommand; 109import com.echothree.control.user.core.server.command.GetMimeTypeFileExtensionsCommand; 110import com.echothree.control.user.core.server.command.GetMimeTypeUsageTypeCommand; 111import com.echothree.control.user.core.server.command.GetMimeTypeUsageTypesCommand; 112import com.echothree.control.user.core.server.command.GetMimeTypesCommand; 113import com.echothree.control.user.core.server.command.GetTextDecorationCommand; 114import com.echothree.control.user.core.server.command.GetTextDecorationsCommand; 115import com.echothree.control.user.core.server.command.GetTextTransformationCommand; 116import com.echothree.control.user.core.server.command.GetTextTransformationsCommand; 117import com.echothree.control.user.customer.common.CustomerUtil; 118import com.echothree.control.user.customer.server.command.GetCustomerCommand; 119import com.echothree.control.user.customer.server.command.GetCustomerTypeCommand; 120import com.echothree.control.user.customer.server.command.GetCustomerTypesCommand; 121import com.echothree.control.user.customer.server.command.GetCustomersCommand; 122import com.echothree.control.user.employee.common.EmployeeUtil; 123import com.echothree.control.user.employee.server.command.GetEmployeeCommand; 124import com.echothree.control.user.employee.server.command.GetEmployeesCommand; 125import com.echothree.control.user.filter.common.FilterUtil; 126import com.echothree.control.user.filter.server.command.GetFilterAdjustmentAmountCommand; 127import com.echothree.control.user.filter.server.command.GetFilterAdjustmentAmountsCommand; 128import com.echothree.control.user.filter.server.command.GetFilterAdjustmentCommand; 129import com.echothree.control.user.filter.server.command.GetFilterAdjustmentFixedAmountCommand; 130import com.echothree.control.user.filter.server.command.GetFilterAdjustmentFixedAmountsCommand; 131import com.echothree.control.user.filter.server.command.GetFilterAdjustmentPercentCommand; 132import com.echothree.control.user.filter.server.command.GetFilterAdjustmentPercentsCommand; 133import com.echothree.control.user.filter.server.command.GetFilterAdjustmentSourceCommand; 134import com.echothree.control.user.filter.server.command.GetFilterAdjustmentSourcesCommand; 135import com.echothree.control.user.filter.server.command.GetFilterAdjustmentTypeCommand; 136import com.echothree.control.user.filter.server.command.GetFilterAdjustmentTypesCommand; 137import com.echothree.control.user.filter.server.command.GetFilterAdjustmentsCommand; 138import com.echothree.control.user.filter.server.command.GetFilterCommand; 139import com.echothree.control.user.filter.server.command.GetFilterEntranceStepCommand; 140import com.echothree.control.user.filter.server.command.GetFilterEntranceStepsCommand; 141import com.echothree.control.user.filter.server.command.GetFilterKindCommand; 142import com.echothree.control.user.filter.server.command.GetFilterKindsCommand; 143import com.echothree.control.user.filter.server.command.GetFilterStepCommand; 144import com.echothree.control.user.filter.server.command.GetFilterStepDestinationCommand; 145import com.echothree.control.user.filter.server.command.GetFilterStepDestinationsCommand; 146import com.echothree.control.user.filter.server.command.GetFilterStepElementCommand; 147import com.echothree.control.user.filter.server.command.GetFilterStepElementsCommand; 148import com.echothree.control.user.filter.server.command.GetFilterStepsCommand; 149import com.echothree.control.user.filter.server.command.GetFilterTypeCommand; 150import com.echothree.control.user.filter.server.command.GetFilterTypesCommand; 151import com.echothree.control.user.filter.server.command.GetFiltersCommand; 152import com.echothree.control.user.geo.common.GeoUtil; 153import com.echothree.control.user.geo.server.command.GetCitiesCommand; 154import com.echothree.control.user.geo.server.command.GetCityCommand; 155import com.echothree.control.user.geo.server.command.GetCountiesCommand; 156import com.echothree.control.user.geo.server.command.GetCountriesCommand; 157import com.echothree.control.user.geo.server.command.GetCountryCommand; 158import com.echothree.control.user.geo.server.command.GetCountyCommand; 159import com.echothree.control.user.geo.server.command.GetGeoCodeAliasCommand; 160import com.echothree.control.user.geo.server.command.GetGeoCodeAliasTypeCommand; 161import com.echothree.control.user.geo.server.command.GetGeoCodeAliasTypesCommand; 162import com.echothree.control.user.geo.server.command.GetGeoCodeAliasesCommand; 163import com.echothree.control.user.geo.server.command.GetGeoCodeCommand; 164import com.echothree.control.user.geo.server.command.GetGeoCodeCurrenciesCommand; 165import com.echothree.control.user.geo.server.command.GetGeoCodeCurrencyCommand; 166import com.echothree.control.user.geo.server.command.GetGeoCodeDateTimeFormatCommand; 167import com.echothree.control.user.geo.server.command.GetGeoCodeDateTimeFormatsCommand; 168import com.echothree.control.user.geo.server.command.GetGeoCodeLanguageCommand; 169import com.echothree.control.user.geo.server.command.GetGeoCodeLanguagesCommand; 170import com.echothree.control.user.geo.server.command.GetGeoCodeScopeCommand; 171import com.echothree.control.user.geo.server.command.GetGeoCodeScopesCommand; 172import com.echothree.control.user.geo.server.command.GetGeoCodeTimeZoneCommand; 173import com.echothree.control.user.geo.server.command.GetGeoCodeTimeZonesCommand; 174import com.echothree.control.user.geo.server.command.GetGeoCodeTypeCommand; 175import com.echothree.control.user.geo.server.command.GetGeoCodeTypesCommand; 176import com.echothree.control.user.geo.server.command.GetStateCommand; 177import com.echothree.control.user.geo.server.command.GetStatesCommand; 178import com.echothree.control.user.geo.server.command.GetZipCodeCommand; 179import com.echothree.control.user.geo.server.command.GetZipCodesCommand; 180import com.echothree.control.user.inventory.common.InventoryUtil; 181import com.echothree.control.user.inventory.server.command.GetAllocationPrioritiesCommand; 182import com.echothree.control.user.inventory.server.command.GetAllocationPriorityCommand; 183import com.echothree.control.user.inventory.server.command.GetInventoryAdjustmentTypeCommand; 184import com.echothree.control.user.inventory.server.command.GetInventoryAdjustmentTypesCommand; 185import com.echothree.control.user.inventory.server.command.GetInventoryConditionCommand; 186import com.echothree.control.user.inventory.server.command.GetInventoryConditionsCommand; 187import com.echothree.control.user.inventory.server.command.GetInventoryLocationGroupCommand; 188import com.echothree.control.user.inventory.server.command.GetInventoryLocationGroupsCommand; 189import com.echothree.control.user.inventory.server.command.GetInventoryTransactionTypeCommand; 190import com.echothree.control.user.inventory.server.command.GetInventoryTransactionTypesCommand; 191import com.echothree.control.user.inventory.server.command.GetLotCommand; 192import com.echothree.control.user.inventory.server.command.GetLotsCommand; 193import com.echothree.control.user.item.common.ItemUtil; 194import com.echothree.control.user.item.server.command.GetItemAliasChecksumTypeCommand; 195import com.echothree.control.user.item.server.command.GetItemAliasChecksumTypesCommand; 196import com.echothree.control.user.item.server.command.GetItemAliasCommand; 197import com.echothree.control.user.item.server.command.GetItemAliasTypeCommand; 198import com.echothree.control.user.item.server.command.GetItemAliasTypesCommand; 199import com.echothree.control.user.item.server.command.GetItemAliasesCommand; 200import com.echothree.control.user.item.server.command.GetItemCategoriesCommand; 201import com.echothree.control.user.item.server.command.GetItemCategoryCommand; 202import com.echothree.control.user.item.server.command.GetItemCommand; 203import com.echothree.control.user.item.server.command.GetItemDeliveryTypeCommand; 204import com.echothree.control.user.item.server.command.GetItemDeliveryTypesCommand; 205import com.echothree.control.user.item.server.command.GetItemDescriptionCommand; 206import com.echothree.control.user.item.server.command.GetItemDescriptionTypeCommand; 207import com.echothree.control.user.item.server.command.GetItemDescriptionTypeUseCommand; 208import com.echothree.control.user.item.server.command.GetItemDescriptionTypeUseTypeCommand; 209import com.echothree.control.user.item.server.command.GetItemDescriptionTypeUseTypesCommand; 210import com.echothree.control.user.item.server.command.GetItemDescriptionTypeUsesCommand; 211import com.echothree.control.user.item.server.command.GetItemDescriptionTypesCommand; 212import com.echothree.control.user.item.server.command.GetItemDescriptionsCommand; 213import com.echothree.control.user.item.server.command.GetItemImageTypeCommand; 214import com.echothree.control.user.item.server.command.GetItemImageTypesCommand; 215import com.echothree.control.user.item.server.command.GetItemInventoryTypeCommand; 216import com.echothree.control.user.item.server.command.GetItemInventoryTypesCommand; 217import com.echothree.control.user.item.server.command.GetItemPriceCommand; 218import com.echothree.control.user.item.server.command.GetItemPriceTypeCommand; 219import com.echothree.control.user.item.server.command.GetItemPriceTypesCommand; 220import com.echothree.control.user.item.server.command.GetItemPricesCommand; 221import com.echothree.control.user.item.server.command.GetItemTypeCommand; 222import com.echothree.control.user.item.server.command.GetItemTypesCommand; 223import com.echothree.control.user.item.server.command.GetItemUnitOfMeasureTypeCommand; 224import com.echothree.control.user.item.server.command.GetItemUnitOfMeasureTypesCommand; 225import com.echothree.control.user.item.server.command.GetItemUseTypeCommand; 226import com.echothree.control.user.item.server.command.GetItemUseTypesCommand; 227import com.echothree.control.user.item.server.command.GetItemVolumeTypeCommand; 228import com.echothree.control.user.item.server.command.GetItemVolumeTypesCommand; 229import com.echothree.control.user.item.server.command.GetItemWeightTypeCommand; 230import com.echothree.control.user.item.server.command.GetItemWeightTypesCommand; 231import com.echothree.control.user.item.server.command.GetItemsCommand; 232import com.echothree.control.user.item.server.command.GetRelatedItemCommand; 233import com.echothree.control.user.item.server.command.GetRelatedItemTypeCommand; 234import com.echothree.control.user.item.server.command.GetRelatedItemTypesCommand; 235import com.echothree.control.user.item.server.command.GetRelatedItemsCommand; 236import com.echothree.control.user.offer.common.OfferUtil; 237import com.echothree.control.user.offer.server.command.GetOfferCommand; 238import com.echothree.control.user.offer.server.command.GetOfferItemCommand; 239import com.echothree.control.user.offer.server.command.GetOfferItemPriceCommand; 240import com.echothree.control.user.offer.server.command.GetOfferItemPricesCommand; 241import com.echothree.control.user.offer.server.command.GetOfferItemsCommand; 242import com.echothree.control.user.offer.server.command.GetOfferNameElementCommand; 243import com.echothree.control.user.offer.server.command.GetOfferNameElementsCommand; 244import com.echothree.control.user.offer.server.command.GetOfferUseCommand; 245import com.echothree.control.user.offer.server.command.GetOfferUsesCommand; 246import com.echothree.control.user.offer.server.command.GetOffersCommand; 247import com.echothree.control.user.offer.server.command.GetUseCommand; 248import com.echothree.control.user.offer.server.command.GetUseNameElementCommand; 249import com.echothree.control.user.offer.server.command.GetUseNameElementsCommand; 250import com.echothree.control.user.offer.server.command.GetUseTypeCommand; 251import com.echothree.control.user.offer.server.command.GetUseTypesCommand; 252import com.echothree.control.user.offer.server.command.GetUsesCommand; 253import com.echothree.control.user.order.common.OrderUtil; 254import com.echothree.control.user.order.server.command.GetOrderPrioritiesCommand; 255import com.echothree.control.user.order.server.command.GetOrderPriorityCommand; 256import com.echothree.control.user.order.server.command.GetOrderTimeTypeCommand; 257import com.echothree.control.user.order.server.command.GetOrderTimeTypesCommand; 258import com.echothree.control.user.order.server.command.GetOrderTypeCommand; 259import com.echothree.control.user.order.server.command.GetOrderTypesCommand; 260import com.echothree.control.user.party.common.PartyUtil; 261import com.echothree.control.user.party.server.command.GetCompaniesCommand; 262import com.echothree.control.user.party.server.command.GetCompanyCommand; 263import com.echothree.control.user.party.server.command.GetDateTimeFormatCommand; 264import com.echothree.control.user.party.server.command.GetDateTimeFormatsCommand; 265import com.echothree.control.user.party.server.command.GetDepartmentCommand; 266import com.echothree.control.user.party.server.command.GetDepartmentsCommand; 267import com.echothree.control.user.party.server.command.GetDivisionCommand; 268import com.echothree.control.user.party.server.command.GetDivisionsCommand; 269import com.echothree.control.user.party.server.command.GetLanguageCommand; 270import com.echothree.control.user.party.server.command.GetLanguagesCommand; 271import com.echothree.control.user.party.server.command.GetNameSuffixesCommand; 272import com.echothree.control.user.party.server.command.GetPartiesCommand; 273import com.echothree.control.user.party.server.command.GetPartyAliasCommand; 274import com.echothree.control.user.party.server.command.GetPartyAliasTypeCommand; 275import com.echothree.control.user.party.server.command.GetPartyAliasTypesCommand; 276import com.echothree.control.user.party.server.command.GetPartyAliasesCommand; 277import com.echothree.control.user.party.server.command.GetPartyCommand; 278import com.echothree.control.user.party.server.command.GetPartyTypeCommand; 279import com.echothree.control.user.party.server.command.GetPartyTypesCommand; 280import com.echothree.control.user.party.server.command.GetPersonalTitlesCommand; 281import com.echothree.control.user.party.server.command.GetRoleTypeCommand; 282import com.echothree.control.user.party.server.command.GetRoleTypesCommand; 283import com.echothree.control.user.party.server.command.GetTimeZoneCommand; 284import com.echothree.control.user.party.server.command.GetTimeZonesCommand; 285import com.echothree.control.user.payment.common.PaymentUtil; 286import com.echothree.control.user.payment.server.command.GetPaymentMethodTypeCommand; 287import com.echothree.control.user.payment.server.command.GetPaymentMethodTypesCommand; 288import com.echothree.control.user.payment.server.command.GetPaymentProcessorActionTypeCommand; 289import com.echothree.control.user.payment.server.command.GetPaymentProcessorActionTypesCommand; 290import com.echothree.control.user.payment.server.command.GetPaymentProcessorCommand; 291import com.echothree.control.user.payment.server.command.GetPaymentProcessorResultCodeCommand; 292import com.echothree.control.user.payment.server.command.GetPaymentProcessorResultCodesCommand; 293import com.echothree.control.user.payment.server.command.GetPaymentProcessorTransactionCommand; 294import com.echothree.control.user.payment.server.command.GetPaymentProcessorTransactionsCommand; 295import com.echothree.control.user.payment.server.command.GetPaymentProcessorTypeCodeCommand; 296import com.echothree.control.user.payment.server.command.GetPaymentProcessorTypeCodeTypeCommand; 297import com.echothree.control.user.payment.server.command.GetPaymentProcessorTypeCommand; 298import com.echothree.control.user.payment.server.command.GetPaymentProcessorTypesCommand; 299import com.echothree.control.user.payment.server.command.GetPaymentProcessorsCommand; 300import com.echothree.control.user.queue.common.QueueUtil; 301import com.echothree.control.user.queue.server.command.GetQueueTypeCommand; 302import com.echothree.control.user.queue.server.command.GetQueueTypesCommand; 303import com.echothree.control.user.returnpolicy.common.ReturnPolicyUtil; 304import com.echothree.control.user.returnpolicy.server.command.GetReturnKindCommand; 305import com.echothree.control.user.returnpolicy.server.command.GetReturnKindsCommand; 306import com.echothree.control.user.returnpolicy.server.command.GetReturnPoliciesCommand; 307import com.echothree.control.user.returnpolicy.server.command.GetReturnPolicyCommand; 308import com.echothree.control.user.search.common.SearchUtil; 309import com.echothree.control.user.search.common.result.CheckItemSpellingResult; 310import com.echothree.control.user.search.server.command.GetComponentVendorResultsCommand; 311import com.echothree.control.user.search.server.command.GetContentCatalogItemResultsCommand; 312import com.echothree.control.user.search.server.command.GetContentCatalogResultsCommand; 313import com.echothree.control.user.search.server.command.GetContentCategoryResultsCommand; 314import com.echothree.control.user.search.server.command.GetCustomerResultsCommand; 315import com.echothree.control.user.search.server.command.GetEmployeeResultsCommand; 316import com.echothree.control.user.search.server.command.GetEntityAliasTypeResultsCommand; 317import com.echothree.control.user.search.server.command.GetEntityAttributeGroupResultsCommand; 318import com.echothree.control.user.search.server.command.GetEntityAttributeResultsCommand; 319import com.echothree.control.user.search.server.command.GetEntityListItemResultsCommand; 320import com.echothree.control.user.search.server.command.GetEntityTypeResultsCommand; 321import com.echothree.control.user.search.server.command.GetItemResultsCommand; 322import com.echothree.control.user.search.server.command.GetSearchCheckSpellingActionTypeCommand; 323import com.echothree.control.user.search.server.command.GetSearchCheckSpellingActionTypesCommand; 324import com.echothree.control.user.search.server.command.GetSearchDefaultOperatorCommand; 325import com.echothree.control.user.search.server.command.GetSearchDefaultOperatorsCommand; 326import com.echothree.control.user.search.server.command.GetSearchKindCommand; 327import com.echothree.control.user.search.server.command.GetSearchKindsCommand; 328import com.echothree.control.user.search.server.command.GetSearchResultActionTypeCommand; 329import com.echothree.control.user.search.server.command.GetSearchResultActionTypesCommand; 330import com.echothree.control.user.search.server.command.GetSearchSortDirectionCommand; 331import com.echothree.control.user.search.server.command.GetSearchSortDirectionsCommand; 332import com.echothree.control.user.search.server.command.GetSearchSortOrderCommand; 333import com.echothree.control.user.search.server.command.GetSearchSortOrdersCommand; 334import com.echothree.control.user.search.server.command.GetSearchTypeCommand; 335import com.echothree.control.user.search.server.command.GetSearchTypesCommand; 336import com.echothree.control.user.search.server.command.GetSearchUseTypeCommand; 337import com.echothree.control.user.search.server.command.GetSearchUseTypesCommand; 338import com.echothree.control.user.search.server.command.GetShippingMethodResultsCommand; 339import com.echothree.control.user.search.server.command.GetVendorResultsCommand; 340import com.echothree.control.user.search.server.command.GetWarehouseResultsCommand; 341import com.echothree.control.user.security.common.SecurityUtil; 342import com.echothree.control.user.security.server.command.GetSecurityRoleCommand; 343import com.echothree.control.user.security.server.command.GetSecurityRoleGroupCommand; 344import com.echothree.control.user.security.server.command.GetSecurityRoleGroupsCommand; 345import com.echothree.control.user.security.server.command.GetSecurityRolesCommand; 346import com.echothree.control.user.selector.common.SelectorUtil; 347import com.echothree.control.user.selector.server.command.GetSelectorCommand; 348import com.echothree.control.user.selector.server.command.GetSelectorKindCommand; 349import com.echothree.control.user.selector.server.command.GetSelectorKindsCommand; 350import com.echothree.control.user.selector.server.command.GetSelectorTypeCommand; 351import com.echothree.control.user.selector.server.command.GetSelectorTypesCommand; 352import com.echothree.control.user.selector.server.command.GetSelectorsCommand; 353import com.echothree.control.user.sequence.common.SequenceUtil; 354import com.echothree.control.user.sequence.common.result.GetSequenceValueResult; 355import com.echothree.control.user.sequence.server.command.GetSequenceChecksumTypeCommand; 356import com.echothree.control.user.sequence.server.command.GetSequenceChecksumTypesCommand; 357import com.echothree.control.user.sequence.server.command.GetSequenceCommand; 358import com.echothree.control.user.sequence.server.command.GetSequenceEncoderTypeCommand; 359import com.echothree.control.user.sequence.server.command.GetSequenceEncoderTypesCommand; 360import com.echothree.control.user.sequence.server.command.GetSequenceTypeCommand; 361import com.echothree.control.user.sequence.server.command.GetSequenceTypesCommand; 362import com.echothree.control.user.sequence.server.command.GetSequencesCommand; 363import com.echothree.control.user.shipment.common.ShipmentUtil; 364import com.echothree.control.user.shipment.server.command.GetFreeOnBoardCommand; 365import com.echothree.control.user.shipment.server.command.GetFreeOnBoardsCommand; 366import com.echothree.control.user.shipping.common.ShippingUtil; 367import com.echothree.control.user.shipping.server.command.GetShippingMethodCommand; 368import com.echothree.control.user.shipping.server.command.GetShippingMethodsCommand; 369import com.echothree.control.user.tag.common.TagUtil; 370import com.echothree.control.user.tag.server.command.GetEntityTagCommand; 371import com.echothree.control.user.tag.server.command.GetEntityTagsCommand; 372import com.echothree.control.user.tag.server.command.GetTagCommand; 373import com.echothree.control.user.tag.server.command.GetTagScopeCommand; 374import com.echothree.control.user.tag.server.command.GetTagScopeEntityTypeCommand; 375import com.echothree.control.user.tag.server.command.GetTagScopeEntityTypesCommand; 376import com.echothree.control.user.tag.server.command.GetTagScopesCommand; 377import com.echothree.control.user.tag.server.command.GetTagsCommand; 378import com.echothree.control.user.term.common.TermUtil; 379import com.echothree.control.user.term.server.command.GetTermCommand; 380import com.echothree.control.user.term.server.command.GetTermTypeCommand; 381import com.echothree.control.user.term.server.command.GetTermTypesCommand; 382import com.echothree.control.user.term.server.command.GetTermsCommand; 383import com.echothree.control.user.uom.common.UomUtil; 384import com.echothree.control.user.uom.server.command.GetUnitOfMeasureKindCommand; 385import com.echothree.control.user.uom.server.command.GetUnitOfMeasureKindUseCommand; 386import com.echothree.control.user.uom.server.command.GetUnitOfMeasureKindUseTypeCommand; 387import com.echothree.control.user.uom.server.command.GetUnitOfMeasureKindUseTypesCommand; 388import com.echothree.control.user.uom.server.command.GetUnitOfMeasureKindUsesCommand; 389import com.echothree.control.user.uom.server.command.GetUnitOfMeasureKindsCommand; 390import com.echothree.control.user.uom.server.command.GetUnitOfMeasureTypeCommand; 391import com.echothree.control.user.uom.server.command.GetUnitOfMeasureTypesCommand; 392import com.echothree.control.user.user.common.UserUtil; 393import com.echothree.control.user.user.server.command.GetRecoveryQuestionCommand; 394import com.echothree.control.user.user.server.command.GetRecoveryQuestionsCommand; 395import com.echothree.control.user.user.server.command.GetUserLoginCommand; 396import com.echothree.control.user.user.server.command.GetUserVisitGroupCommand; 397import com.echothree.control.user.user.server.command.GetUserVisitGroupsCommand; 398import com.echothree.control.user.vendor.common.VendorUtil; 399import com.echothree.control.user.vendor.server.command.GetItemPurchasingCategoriesCommand; 400import com.echothree.control.user.vendor.server.command.GetItemPurchasingCategoryCommand; 401import com.echothree.control.user.vendor.server.command.GetVendorCommand; 402import com.echothree.control.user.vendor.server.command.GetVendorItemCommand; 403import com.echothree.control.user.vendor.server.command.GetVendorItemCostCommand; 404import com.echothree.control.user.vendor.server.command.GetVendorItemCostsCommand; 405import com.echothree.control.user.vendor.server.command.GetVendorItemsCommand; 406import com.echothree.control.user.vendor.server.command.GetVendorTypeCommand; 407import com.echothree.control.user.vendor.server.command.GetVendorTypesCommand; 408import com.echothree.control.user.vendor.server.command.GetVendorsCommand; 409import com.echothree.control.user.warehouse.common.WarehouseUtil; 410import com.echothree.control.user.warehouse.server.command.GetLocationCommand; 411import com.echothree.control.user.warehouse.server.command.GetLocationNameElementCommand; 412import com.echothree.control.user.warehouse.server.command.GetLocationNameElementsCommand; 413import com.echothree.control.user.warehouse.server.command.GetLocationTypeCommand; 414import com.echothree.control.user.warehouse.server.command.GetLocationTypesCommand; 415import com.echothree.control.user.warehouse.server.command.GetLocationUseTypeCommand; 416import com.echothree.control.user.warehouse.server.command.GetLocationUseTypesCommand; 417import com.echothree.control.user.warehouse.server.command.GetLocationsCommand; 418import com.echothree.control.user.warehouse.server.command.GetWarehouseCommand; 419import com.echothree.control.user.warehouse.server.command.GetWarehouseTypeCommand; 420import com.echothree.control.user.warehouse.server.command.GetWarehouseTypesCommand; 421import com.echothree.control.user.warehouse.server.command.GetWarehousesCommand; 422import com.echothree.control.user.wishlist.common.WishlistUtil; 423import com.echothree.control.user.wishlist.server.command.GetWishlistPrioritiesCommand; 424import com.echothree.control.user.wishlist.server.command.GetWishlistPriorityCommand; 425import com.echothree.control.user.wishlist.server.command.GetWishlistTypeCommand; 426import com.echothree.control.user.wishlist.server.command.GetWishlistTypesCommand; 427import com.echothree.control.user.workflow.common.WorkflowUtil; 428import com.echothree.control.user.workflow.server.command.GetWorkflowCommand; 429import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationCommand; 430import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationPartyTypeCommand; 431import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationPartyTypesCommand; 432import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationSecurityRoleCommand; 433import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationSecurityRolesCommand; 434import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationSelectorCommand; 435import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationSelectorsCommand; 436import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationStepCommand; 437import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationStepsCommand; 438import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationsCommand; 439import com.echothree.control.user.workflow.server.command.GetWorkflowEntityStatusesCommand; 440import com.echothree.control.user.workflow.server.command.GetWorkflowEntityTypeCommand; 441import com.echothree.control.user.workflow.server.command.GetWorkflowEntityTypesCommand; 442import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceCommand; 443import com.echothree.control.user.workflow.server.command.GetWorkflowEntrancePartyTypeCommand; 444import com.echothree.control.user.workflow.server.command.GetWorkflowEntrancePartyTypesCommand; 445import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceSecurityRoleCommand; 446import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceSecurityRolesCommand; 447import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceSelectorCommand; 448import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceSelectorsCommand; 449import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceStepCommand; 450import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceStepsCommand; 451import com.echothree.control.user.workflow.server.command.GetWorkflowEntrancesCommand; 452import com.echothree.control.user.workflow.server.command.GetWorkflowSelectorKindCommand; 453import com.echothree.control.user.workflow.server.command.GetWorkflowSelectorKindsCommand; 454import com.echothree.control.user.workflow.server.command.GetWorkflowStepCommand; 455import com.echothree.control.user.workflow.server.command.GetWorkflowStepTypeCommand; 456import com.echothree.control.user.workflow.server.command.GetWorkflowStepTypesCommand; 457import com.echothree.control.user.workflow.server.command.GetWorkflowStepsCommand; 458import com.echothree.control.user.workflow.server.command.GetWorkflowsCommand; 459import com.echothree.model.control.accounting.server.graphql.CurrencyObject; 460import com.echothree.model.control.accounting.server.graphql.GlAccountCategoryObject; 461import com.echothree.model.control.accounting.server.graphql.GlAccountClassObject; 462import com.echothree.model.control.accounting.server.graphql.GlAccountObject; 463import com.echothree.model.control.accounting.server.graphql.GlAccountTypeObject; 464import com.echothree.model.control.accounting.server.graphql.GlResourceTypeObject; 465import com.echothree.model.control.accounting.server.graphql.ItemAccountingCategoryObject; 466import com.echothree.model.control.accounting.server.graphql.SymbolPositionObject; 467import com.echothree.model.control.accounting.server.graphql.TransactionEntityRoleTypeObject; 468import com.echothree.model.control.accounting.server.graphql.TransactionGlAccountCategoryObject; 469import com.echothree.model.control.accounting.server.graphql.TransactionGroupObject; 470import com.echothree.model.control.accounting.server.graphql.TransactionObject; 471import com.echothree.model.control.accounting.server.graphql.TransactionTimeTypeObject; 472import com.echothree.model.control.accounting.server.graphql.TransactionTypeObject; 473import com.echothree.model.control.cancellationpolicy.server.graphql.CancellationKindObject; 474import com.echothree.model.control.cancellationpolicy.server.graphql.CancellationPolicyObject; 475import com.echothree.model.control.content.server.graphql.ContentCatalogItemObject; 476import com.echothree.model.control.content.server.graphql.ContentCatalogObject; 477import com.echothree.model.control.content.server.graphql.ContentCategoryItemObject; 478import com.echothree.model.control.content.server.graphql.ContentCategoryObject; 479import com.echothree.model.control.content.server.graphql.ContentCollectionObject; 480import com.echothree.model.control.content.server.graphql.ContentPageAreaObject; 481import com.echothree.model.control.content.server.graphql.ContentPageAreaTypeObject; 482import com.echothree.model.control.content.server.graphql.ContentPageLayoutAreaObject; 483import com.echothree.model.control.content.server.graphql.ContentPageLayoutObject; 484import com.echothree.model.control.content.server.graphql.ContentPageObject; 485import com.echothree.model.control.content.server.graphql.ContentSectionObject; 486import com.echothree.model.control.content.server.graphql.ContentWebAddressObject; 487import com.echothree.model.control.core.server.graphql.AppearanceObject; 488import com.echothree.model.control.core.server.graphql.ColorObject; 489import com.echothree.model.control.core.server.graphql.ComponentVendorObject; 490import com.echothree.model.control.core.server.graphql.EntityAliasObject; 491import com.echothree.model.control.core.server.graphql.EntityAliasTypeObject; 492import com.echothree.model.control.core.server.graphql.EntityAttributeEntityAttributeGroupObject; 493import com.echothree.model.control.core.server.graphql.EntityAttributeGroupObject; 494import com.echothree.model.control.core.server.graphql.EntityAttributeObject; 495import com.echothree.model.control.core.server.graphql.EntityAttributeTypeObject; 496import com.echothree.model.control.core.server.graphql.EntityInstanceObject; 497import com.echothree.model.control.core.server.graphql.EntityTypeObject; 498import com.echothree.model.control.core.server.graphql.EventTypeObject; 499import com.echothree.model.control.core.server.graphql.FontStyleObject; 500import com.echothree.model.control.core.server.graphql.FontWeightObject; 501import com.echothree.model.control.core.server.graphql.MimeTypeFileExtensionObject; 502import com.echothree.model.control.core.server.graphql.MimeTypeObject; 503import com.echothree.model.control.core.server.graphql.MimeTypeUsageTypeObject; 504import com.echothree.model.control.core.server.graphql.TextDecorationObject; 505import com.echothree.model.control.core.server.graphql.TextTransformationObject; 506import com.echothree.model.control.customer.server.graphql.CustomerObject; 507import com.echothree.model.control.customer.server.graphql.CustomerTypeObject; 508import com.echothree.model.control.employee.server.graphql.EmployeeObject; 509import com.echothree.model.control.filter.server.graphql.FilterAdjustmentAmountObject; 510import com.echothree.model.control.filter.server.graphql.FilterAdjustmentFixedAmountObject; 511import com.echothree.model.control.filter.server.graphql.FilterAdjustmentObject; 512import com.echothree.model.control.filter.server.graphql.FilterAdjustmentPercentObject; 513import com.echothree.model.control.filter.server.graphql.FilterAdjustmentSourceObject; 514import com.echothree.model.control.filter.server.graphql.FilterAdjustmentTypeObject; 515import com.echothree.model.control.filter.server.graphql.FilterEntranceStepObject; 516import com.echothree.model.control.filter.server.graphql.FilterKindObject; 517import com.echothree.model.control.filter.server.graphql.FilterObject; 518import com.echothree.model.control.filter.server.graphql.FilterStepDestinationObject; 519import com.echothree.model.control.filter.server.graphql.FilterStepElementObject; 520import com.echothree.model.control.filter.server.graphql.FilterStepObject; 521import com.echothree.model.control.filter.server.graphql.FilterTypeObject; 522import com.echothree.model.control.geo.server.graphql.GeoCodeAliasObject; 523import com.echothree.model.control.geo.server.graphql.GeoCodeAliasTypeObject; 524import com.echothree.model.control.geo.server.graphql.GeoCodeCurrencyObject; 525import com.echothree.model.control.geo.server.graphql.GeoCodeDateTimeFormatObject; 526import com.echothree.model.control.geo.server.graphql.GeoCodeLanguageObject; 527import com.echothree.model.control.geo.server.graphql.GeoCodeObject; 528import com.echothree.model.control.geo.server.graphql.GeoCodeScopeObject; 529import com.echothree.model.control.geo.server.graphql.GeoCodeTimeZoneObject; 530import com.echothree.model.control.geo.server.graphql.GeoCodeTypeObject; 531import com.echothree.model.control.graphql.server.graphql.count.Connections; 532import com.echothree.model.control.graphql.server.graphql.count.CountedObjects; 533import com.echothree.model.control.graphql.server.graphql.count.CountingDataConnectionFetcher; 534import com.echothree.model.control.graphql.server.graphql.count.CountingPaginatedData; 535import com.echothree.model.control.graphql.server.util.BaseGraphQl; 536import static com.echothree.model.control.graphql.server.util.BaseGraphQl.getUserVisitPK; 537import com.echothree.model.control.graphql.server.util.count.ObjectLimiter; 538import com.echothree.model.control.inventory.server.graphql.AllocationPriorityObject; 539import com.echothree.model.control.inventory.server.graphql.InventoryAdjustmentTypeObject; 540import com.echothree.model.control.inventory.server.graphql.InventoryConditionObject; 541import com.echothree.model.control.inventory.server.graphql.InventoryLocationGroupObject; 542import com.echothree.model.control.inventory.server.graphql.InventoryTransactionTypeObject; 543import com.echothree.model.control.inventory.server.graphql.LotObject; 544import com.echothree.model.control.item.server.graphql.ItemAliasChecksumTypeObject; 545import com.echothree.model.control.item.server.graphql.ItemAliasObject; 546import com.echothree.model.control.item.server.graphql.ItemAliasTypeObject; 547import com.echothree.model.control.item.server.graphql.ItemCategoryObject; 548import com.echothree.model.control.item.server.graphql.ItemDeliveryTypeObject; 549import com.echothree.model.control.item.server.graphql.ItemDescriptionObject; 550import com.echothree.model.control.item.server.graphql.ItemDescriptionTypeObject; 551import com.echothree.model.control.item.server.graphql.ItemDescriptionTypeUseObject; 552import com.echothree.model.control.item.server.graphql.ItemDescriptionTypeUseTypeObject; 553import com.echothree.model.control.item.server.graphql.ItemImageTypeObject; 554import com.echothree.model.control.item.server.graphql.ItemInventoryTypeObject; 555import com.echothree.model.control.item.server.graphql.ItemObject; 556import com.echothree.model.control.item.server.graphql.ItemPriceObject; 557import com.echothree.model.control.item.server.graphql.ItemPriceTypeObject; 558import com.echothree.model.control.item.server.graphql.ItemTypeObject; 559import com.echothree.model.control.item.server.graphql.ItemUnitOfMeasureTypeObject; 560import com.echothree.model.control.item.server.graphql.ItemUseTypeObject; 561import com.echothree.model.control.item.server.graphql.ItemVolumeTypeObject; 562import com.echothree.model.control.item.server.graphql.ItemWeightTypeObject; 563import com.echothree.model.control.item.server.graphql.RelatedItemObject; 564import com.echothree.model.control.item.server.graphql.RelatedItemTypeObject; 565import com.echothree.model.control.offer.server.graphql.OfferItemObject; 566import com.echothree.model.control.offer.server.graphql.OfferItemPriceObject; 567import com.echothree.model.control.offer.server.graphql.OfferNameElementObject; 568import com.echothree.model.control.offer.server.graphql.OfferObject; 569import com.echothree.model.control.offer.server.graphql.OfferUseObject; 570import com.echothree.model.control.offer.server.graphql.UseNameElementObject; 571import com.echothree.model.control.offer.server.graphql.UseObject; 572import com.echothree.model.control.offer.server.graphql.UseTypeObject; 573import com.echothree.model.control.order.server.graphql.OrderPriorityObject; 574import com.echothree.model.control.order.server.graphql.OrderTimeTypeObject; 575import com.echothree.model.control.order.server.graphql.OrderTypeObject; 576import com.echothree.model.control.party.server.graphql.CompanyObject; 577import com.echothree.model.control.party.server.graphql.DateTimeFormatObject; 578import com.echothree.model.control.party.server.graphql.DepartmentObject; 579import com.echothree.model.control.party.server.graphql.DivisionObject; 580import com.echothree.model.control.party.server.graphql.LanguageObject; 581import com.echothree.model.control.party.server.graphql.NameSuffixObject; 582import com.echothree.model.control.party.server.graphql.PartyAliasObject; 583import com.echothree.model.control.party.server.graphql.PartyAliasTypeObject; 584import com.echothree.model.control.party.server.graphql.PartyObject; 585import com.echothree.model.control.party.server.graphql.PartyTypeObject; 586import com.echothree.model.control.party.server.graphql.PersonalTitleObject; 587import com.echothree.model.control.party.server.graphql.RoleTypeObject; 588import com.echothree.model.control.party.server.graphql.TimeZoneObject; 589import com.echothree.model.control.payment.server.graphql.PaymentMethodTypeObject; 590import com.echothree.model.control.payment.server.graphql.PaymentProcessorActionTypeObject; 591import com.echothree.model.control.payment.server.graphql.PaymentProcessorObject; 592import com.echothree.model.control.payment.server.graphql.PaymentProcessorResultCodeObject; 593import com.echothree.model.control.payment.server.graphql.PaymentProcessorTransactionObject; 594import com.echothree.model.control.payment.server.graphql.PaymentProcessorTypeCodeObject; 595import com.echothree.model.control.payment.server.graphql.PaymentProcessorTypeCodeTypeObject; 596import com.echothree.model.control.payment.server.graphql.PaymentProcessorTypeObject; 597import com.echothree.model.control.queue.server.graphql.QueueTypeObject; 598import com.echothree.model.control.returnpolicy.server.graphql.ReturnKindObject; 599import com.echothree.model.control.returnpolicy.server.graphql.ReturnPolicyObject; 600import com.echothree.model.control.search.server.control.SearchControl; 601import com.echothree.model.control.search.server.graphql.CheckItemSpellingObject; 602import com.echothree.model.control.search.server.graphql.ComponentVendorResultsObject; 603import com.echothree.model.control.search.server.graphql.ContentCatalogItemResultsObject; 604import com.echothree.model.control.search.server.graphql.ContentCatalogResultsObject; 605import com.echothree.model.control.search.server.graphql.ContentCategoryResultsObject; 606import com.echothree.model.control.search.server.graphql.CustomerResultsObject; 607import com.echothree.model.control.search.server.graphql.EmployeeResultsObject; 608import com.echothree.model.control.search.server.graphql.EntityAliasTypeResultsObject; 609import com.echothree.model.control.search.server.graphql.EntityAttributeGroupResultsObject; 610import com.echothree.model.control.search.server.graphql.EntityAttributeResultsObject; 611import com.echothree.model.control.search.server.graphql.EntityListItemResultsObject; 612import com.echothree.model.control.search.server.graphql.EntityTypeResultsObject; 613import com.echothree.model.control.search.server.graphql.ItemResultsObject; 614import com.echothree.model.control.search.server.graphql.SearchCheckSpellingActionTypeObject; 615import com.echothree.model.control.search.server.graphql.SearchDefaultOperatorObject; 616import com.echothree.model.control.search.server.graphql.SearchKindObject; 617import com.echothree.model.control.search.server.graphql.SearchResultActionTypeObject; 618import com.echothree.model.control.search.server.graphql.SearchSortDirectionObject; 619import com.echothree.model.control.search.server.graphql.SearchSortOrderObject; 620import com.echothree.model.control.search.server.graphql.SearchTypeObject; 621import com.echothree.model.control.search.server.graphql.SearchUseTypeObject; 622import com.echothree.model.control.search.server.graphql.ShippingMethodResultsObject; 623import com.echothree.model.control.search.server.graphql.VendorResultsObject; 624import com.echothree.model.control.search.server.graphql.WarehouseResultsObject; 625import com.echothree.model.control.security.server.graphql.SecurityRoleGroupObject; 626import com.echothree.model.control.security.server.graphql.SecurityRoleObject; 627import com.echothree.model.control.selector.server.graphql.SelectorKindObject; 628import com.echothree.model.control.selector.server.graphql.SelectorObject; 629import com.echothree.model.control.selector.server.graphql.SelectorTypeObject; 630import com.echothree.model.control.sequence.server.graphql.GetSequenceValueResultObject; 631import com.echothree.model.control.sequence.server.graphql.SequenceChecksumTypeObject; 632import com.echothree.model.control.sequence.server.graphql.SequenceEncoderTypeObject; 633import com.echothree.model.control.sequence.server.graphql.SequenceObject; 634import com.echothree.model.control.sequence.server.graphql.SequenceTypeObject; 635import com.echothree.model.control.shipment.server.graphql.FreeOnBoardObject; 636import com.echothree.model.control.shipping.server.control.ShippingControl; 637import com.echothree.model.control.shipping.server.graphql.ShippingMethodObject; 638import com.echothree.model.control.tag.server.graphql.EntityTagObject; 639import com.echothree.model.control.tag.server.graphql.TagObject; 640import com.echothree.model.control.tag.server.graphql.TagScopeEntityTypeObject; 641import com.echothree.model.control.tag.server.graphql.TagScopeObject; 642import com.echothree.model.control.term.server.graphql.TermObject; 643import com.echothree.model.control.term.server.graphql.TermTypeObject; 644import com.echothree.model.control.uom.server.graphql.UnitOfMeasureKindObject; 645import com.echothree.model.control.uom.server.graphql.UnitOfMeasureKindUseObject; 646import com.echothree.model.control.uom.server.graphql.UnitOfMeasureKindUseTypeObject; 647import com.echothree.model.control.uom.server.graphql.UnitOfMeasureTypeObject; 648import com.echothree.model.control.user.server.graphql.RecoveryQuestionObject; 649import com.echothree.model.control.user.server.graphql.UserLoginObject; 650import com.echothree.model.control.user.server.graphql.UserSessionObject; 651import com.echothree.model.control.user.server.graphql.UserVisitGroupObject; 652import com.echothree.model.control.user.server.graphql.UserVisitObject; 653import com.echothree.model.control.vendor.server.graphql.ItemPurchasingCategoryObject; 654import com.echothree.model.control.vendor.server.graphql.VendorItemCostObject; 655import com.echothree.model.control.vendor.server.graphql.VendorItemObject; 656import com.echothree.model.control.vendor.server.graphql.VendorObject; 657import com.echothree.model.control.vendor.server.graphql.VendorTypeObject; 658import com.echothree.model.control.warehouse.server.graphql.LocationNameElementObject; 659import com.echothree.model.control.warehouse.server.graphql.LocationObject; 660import com.echothree.model.control.warehouse.server.graphql.LocationTypeObject; 661import com.echothree.model.control.warehouse.server.graphql.LocationUseTypeObject; 662import com.echothree.model.control.warehouse.server.graphql.WarehouseObject; 663import com.echothree.model.control.warehouse.server.graphql.WarehouseTypeObject; 664import com.echothree.model.control.wishlist.server.graphql.WishlistPriorityObject; 665import com.echothree.model.control.wishlist.server.graphql.WishlistTypeObject; 666import com.echothree.model.control.workflow.server.graphql.WorkflowDestinationObject; 667import com.echothree.model.control.workflow.server.graphql.WorkflowDestinationPartyTypeObject; 668import com.echothree.model.control.workflow.server.graphql.WorkflowDestinationSecurityRoleObject; 669import com.echothree.model.control.workflow.server.graphql.WorkflowDestinationSelectorObject; 670import com.echothree.model.control.workflow.server.graphql.WorkflowDestinationStepObject; 671import com.echothree.model.control.workflow.server.graphql.WorkflowEntityStatusObject; 672import com.echothree.model.control.workflow.server.graphql.WorkflowEntityTypeObject; 673import com.echothree.model.control.workflow.server.graphql.WorkflowEntranceObject; 674import com.echothree.model.control.workflow.server.graphql.WorkflowEntrancePartyTypeObject; 675import com.echothree.model.control.workflow.server.graphql.WorkflowEntranceSecurityRoleObject; 676import com.echothree.model.control.workflow.server.graphql.WorkflowEntranceSelectorObject; 677import com.echothree.model.control.workflow.server.graphql.WorkflowEntranceStepObject; 678import com.echothree.model.control.workflow.server.graphql.WorkflowObject; 679import com.echothree.model.control.workflow.server.graphql.WorkflowSelectorKindObject; 680import com.echothree.model.control.workflow.server.graphql.WorkflowStepObject; 681import com.echothree.model.control.workflow.server.graphql.WorkflowStepTypeObject; 682import com.echothree.model.data.accounting.common.CurrencyConstants; 683import com.echothree.model.data.accounting.common.GlAccountCategoryConstants; 684import com.echothree.model.data.accounting.common.GlAccountClassConstants; 685import com.echothree.model.data.accounting.common.GlAccountConstants; 686import com.echothree.model.data.accounting.common.GlAccountTypeConstants; 687import com.echothree.model.data.accounting.common.GlResourceTypeConstants; 688import com.echothree.model.data.accounting.common.ItemAccountingCategoryConstants; 689import com.echothree.model.data.accounting.common.SymbolPositionConstants; 690import com.echothree.model.data.accounting.common.TransactionConstants; 691import com.echothree.model.data.accounting.common.TransactionEntityRoleTypeConstants; 692import com.echothree.model.data.accounting.common.TransactionGlAccountCategoryConstants; 693import com.echothree.model.data.accounting.common.TransactionGroupConstants; 694import com.echothree.model.data.accounting.common.TransactionTimeTypeConstants; 695import com.echothree.model.data.accounting.common.TransactionTypeConstants; 696import com.echothree.model.data.accounting.server.entity.Currency; 697import com.echothree.model.data.accounting.server.entity.GlAccount; 698import com.echothree.model.data.accounting.server.entity.GlAccountCategory; 699import com.echothree.model.data.accounting.server.entity.GlAccountClass; 700import com.echothree.model.data.accounting.server.entity.GlAccountType; 701import com.echothree.model.data.accounting.server.entity.GlResourceType; 702import com.echothree.model.data.accounting.server.entity.ItemAccountingCategory; 703import com.echothree.model.data.accounting.server.entity.SymbolPosition; 704import com.echothree.model.data.accounting.server.entity.Transaction; 705import com.echothree.model.data.accounting.server.entity.TransactionEntityRoleType; 706import com.echothree.model.data.accounting.server.entity.TransactionGlAccountCategory; 707import com.echothree.model.data.accounting.server.entity.TransactionGroup; 708import com.echothree.model.data.accounting.server.entity.TransactionTimeType; 709import com.echothree.model.data.accounting.server.entity.TransactionType; 710import com.echothree.model.data.cancellationpolicy.common.CancellationKindConstants; 711import com.echothree.model.data.cancellationpolicy.common.CancellationPolicyConstants; 712import com.echothree.model.data.cancellationpolicy.server.entity.CancellationKind; 713import com.echothree.model.data.cancellationpolicy.server.entity.CancellationPolicy; 714import com.echothree.model.data.content.common.ContentCatalogConstants; 715import com.echothree.model.data.content.common.ContentCatalogItemConstants; 716import com.echothree.model.data.content.common.ContentCategoryConstants; 717import com.echothree.model.data.content.common.ContentCategoryItemConstants; 718import com.echothree.model.data.content.common.ContentCollectionConstants; 719import com.echothree.model.data.content.common.ContentPageAreaConstants; 720import com.echothree.model.data.content.common.ContentPageAreaTypeConstants; 721import com.echothree.model.data.content.common.ContentPageConstants; 722import com.echothree.model.data.content.common.ContentPageLayoutAreaConstants; 723import com.echothree.model.data.content.common.ContentPageLayoutConstants; 724import com.echothree.model.data.content.common.ContentSectionConstants; 725import com.echothree.model.data.content.common.ContentWebAddressConstants; 726import com.echothree.model.data.content.server.entity.ContentCatalog; 727import com.echothree.model.data.content.server.entity.ContentCatalogItem; 728import com.echothree.model.data.content.server.entity.ContentCategory; 729import com.echothree.model.data.content.server.entity.ContentCategoryItem; 730import com.echothree.model.data.content.server.entity.ContentCollection; 731import com.echothree.model.data.content.server.entity.ContentPage; 732import com.echothree.model.data.content.server.entity.ContentPageArea; 733import com.echothree.model.data.content.server.entity.ContentPageAreaType; 734import com.echothree.model.data.content.server.entity.ContentPageLayout; 735import com.echothree.model.data.content.server.entity.ContentPageLayoutArea; 736import com.echothree.model.data.content.server.entity.ContentSection; 737import com.echothree.model.data.content.server.entity.ContentWebAddress; 738import com.echothree.model.data.core.common.AppearanceConstants; 739import com.echothree.model.data.core.common.ColorConstants; 740import com.echothree.model.data.core.common.ComponentVendorConstants; 741import com.echothree.model.data.core.common.EntityAliasConstants; 742import com.echothree.model.data.core.common.EntityAliasTypeConstants; 743import com.echothree.model.data.core.common.EntityAttributeConstants; 744import com.echothree.model.data.core.common.EntityAttributeEntityAttributeGroupConstants; 745import com.echothree.model.data.core.common.EntityAttributeGroupConstants; 746import com.echothree.model.data.core.common.EntityAttributeTypeConstants; 747import com.echothree.model.data.core.common.EntityInstanceConstants; 748import com.echothree.model.data.core.common.EntityTypeConstants; 749import com.echothree.model.data.core.common.EventTypeConstants; 750import com.echothree.model.data.core.common.FontStyleConstants; 751import com.echothree.model.data.core.common.FontWeightConstants; 752import com.echothree.model.data.core.common.MimeTypeConstants; 753import com.echothree.model.data.core.common.TextDecorationConstants; 754import com.echothree.model.data.core.common.TextTransformationConstants; 755import com.echothree.model.data.core.server.entity.Appearance; 756import com.echothree.model.data.core.server.entity.Color; 757import com.echothree.model.data.core.server.entity.ComponentVendor; 758import com.echothree.model.data.core.server.entity.EntityAlias; 759import com.echothree.model.data.core.server.entity.EntityAliasType; 760import com.echothree.model.data.core.server.entity.EntityAttribute; 761import com.echothree.model.data.core.server.entity.EntityAttributeEntityAttributeGroup; 762import com.echothree.model.data.core.server.entity.EntityAttributeGroup; 763import com.echothree.model.data.core.server.entity.EntityAttributeType; 764import com.echothree.model.data.core.server.entity.EntityInstance; 765import com.echothree.model.data.core.server.entity.EntityType; 766import com.echothree.model.data.core.server.entity.EventType; 767import com.echothree.model.data.core.server.entity.FontStyle; 768import com.echothree.model.data.core.server.entity.FontWeight; 769import com.echothree.model.data.core.server.entity.MimeType; 770import com.echothree.model.data.core.server.entity.MimeTypeFileExtension; 771import com.echothree.model.data.core.server.entity.MimeTypeUsageType; 772import com.echothree.model.data.core.server.entity.TextDecoration; 773import com.echothree.model.data.core.server.entity.TextTransformation; 774import com.echothree.model.data.customer.common.CustomerConstants; 775import com.echothree.model.data.customer.common.CustomerTypeConstants; 776import com.echothree.model.data.customer.server.entity.Customer; 777import com.echothree.model.data.customer.server.entity.CustomerType; 778import com.echothree.model.data.employee.common.PartyEmployeeConstants; 779import com.echothree.model.data.employee.server.entity.PartyEmployee; 780import com.echothree.model.data.filter.common.FilterAdjustmentTypeConstants; 781import com.echothree.model.data.filter.common.FilterConstants; 782import com.echothree.model.data.filter.common.FilterEntranceStepConstants; 783import com.echothree.model.data.filter.common.FilterKindConstants; 784import com.echothree.model.data.filter.common.FilterStepConstants; 785import com.echothree.model.data.filter.common.FilterStepDestinationConstants; 786import com.echothree.model.data.filter.common.FilterStepElementConstants; 787import com.echothree.model.data.filter.common.FilterTypeConstants; 788import com.echothree.model.data.filter.server.entity.Filter; 789import com.echothree.model.data.filter.server.entity.FilterAdjustment; 790import com.echothree.model.data.filter.server.entity.FilterAdjustmentAmount; 791import com.echothree.model.data.filter.server.entity.FilterAdjustmentFixedAmount; 792import com.echothree.model.data.filter.server.entity.FilterAdjustmentPercent; 793import com.echothree.model.data.filter.server.entity.FilterAdjustmentSource; 794import com.echothree.model.data.filter.server.entity.FilterAdjustmentType; 795import com.echothree.model.data.filter.server.entity.FilterEntranceStep; 796import com.echothree.model.data.filter.server.entity.FilterKind; 797import com.echothree.model.data.filter.server.entity.FilterStep; 798import com.echothree.model.data.filter.server.entity.FilterStepDestination; 799import com.echothree.model.data.filter.server.entity.FilterStepElement; 800import com.echothree.model.data.filter.server.entity.FilterType; 801import com.echothree.model.data.geo.common.GeoCodeAliasConstants; 802import com.echothree.model.data.geo.common.GeoCodeAliasTypeConstants; 803import com.echothree.model.data.geo.common.GeoCodeConstants; 804import com.echothree.model.data.geo.common.GeoCodeCurrencyConstants; 805import com.echothree.model.data.geo.common.GeoCodeDateTimeFormatConstants; 806import com.echothree.model.data.geo.common.GeoCodeLanguageConstants; 807import com.echothree.model.data.geo.common.GeoCodeScopeConstants; 808import com.echothree.model.data.geo.common.GeoCodeTimeZoneConstants; 809import com.echothree.model.data.geo.common.GeoCodeTypeConstants; 810import com.echothree.model.data.geo.server.entity.GeoCode; 811import com.echothree.model.data.geo.server.entity.GeoCodeAlias; 812import com.echothree.model.data.geo.server.entity.GeoCodeAliasType; 813import com.echothree.model.data.geo.server.entity.GeoCodeCurrency; 814import com.echothree.model.data.geo.server.entity.GeoCodeDateTimeFormat; 815import com.echothree.model.data.geo.server.entity.GeoCodeLanguage; 816import com.echothree.model.data.geo.server.entity.GeoCodeScope; 817import com.echothree.model.data.geo.server.entity.GeoCodeTimeZone; 818import com.echothree.model.data.geo.server.entity.GeoCodeType; 819import com.echothree.model.data.inventory.common.AllocationPriorityConstants; 820import com.echothree.model.data.inventory.common.InventoryAdjustmentTypeConstants; 821import com.echothree.model.data.inventory.common.InventoryConditionConstants; 822import com.echothree.model.data.inventory.common.InventoryLocationGroupConstants; 823import com.echothree.model.data.inventory.common.InventoryTransactionTypeConstants; 824import com.echothree.model.data.inventory.common.LotConstants; 825import com.echothree.model.data.inventory.server.entity.AllocationPriority; 826import com.echothree.model.data.inventory.server.entity.InventoryAdjustmentType; 827import com.echothree.model.data.inventory.server.entity.InventoryCondition; 828import com.echothree.model.data.inventory.server.entity.InventoryLocationGroup; 829import com.echothree.model.data.inventory.server.entity.InventoryTransactionType; 830import com.echothree.model.data.inventory.server.entity.Lot; 831import com.echothree.model.data.item.common.ItemAliasChecksumTypeConstants; 832import com.echothree.model.data.item.common.ItemAliasConstants; 833import com.echothree.model.data.item.common.ItemAliasTypeConstants; 834import com.echothree.model.data.item.common.ItemCategoryConstants; 835import com.echothree.model.data.item.common.ItemConstants; 836import com.echothree.model.data.item.common.ItemDeliveryTypeConstants; 837import com.echothree.model.data.item.common.ItemDescriptionConstants; 838import com.echothree.model.data.item.common.ItemDescriptionTypeConstants; 839import com.echothree.model.data.item.common.ItemDescriptionTypeUseTypeConstants; 840import com.echothree.model.data.item.common.ItemImageTypeConstants; 841import com.echothree.model.data.item.common.ItemInventoryTypeConstants; 842import com.echothree.model.data.item.common.ItemPriceConstants; 843import com.echothree.model.data.item.common.ItemPriceTypeConstants; 844import com.echothree.model.data.item.common.ItemTypeConstants; 845import com.echothree.model.data.item.common.ItemUnitOfMeasureTypeConstants; 846import com.echothree.model.data.item.common.ItemUseTypeConstants; 847import com.echothree.model.data.item.common.ItemVolumeTypeConstants; 848import com.echothree.model.data.item.common.ItemWeightTypeConstants; 849import com.echothree.model.data.item.common.RelatedItemConstants; 850import com.echothree.model.data.item.common.RelatedItemTypeConstants; 851import com.echothree.model.data.item.server.entity.Item; 852import com.echothree.model.data.item.server.entity.ItemAlias; 853import com.echothree.model.data.item.server.entity.ItemAliasChecksumType; 854import com.echothree.model.data.item.server.entity.ItemAliasType; 855import com.echothree.model.data.item.server.entity.ItemCategory; 856import com.echothree.model.data.item.server.entity.ItemDeliveryType; 857import com.echothree.model.data.item.server.entity.ItemDescription; 858import com.echothree.model.data.item.server.entity.ItemDescriptionType; 859import com.echothree.model.data.item.server.entity.ItemDescriptionTypeUse; 860import com.echothree.model.data.item.server.entity.ItemDescriptionTypeUseType; 861import com.echothree.model.data.item.server.entity.ItemImageType; 862import com.echothree.model.data.item.server.entity.ItemInventoryType; 863import com.echothree.model.data.item.server.entity.ItemPrice; 864import com.echothree.model.data.item.server.entity.ItemPriceType; 865import com.echothree.model.data.item.server.entity.ItemType; 866import com.echothree.model.data.item.server.entity.ItemUnitOfMeasureType; 867import com.echothree.model.data.item.server.entity.ItemUseType; 868import com.echothree.model.data.item.server.entity.ItemVolumeType; 869import com.echothree.model.data.item.server.entity.ItemWeightType; 870import com.echothree.model.data.item.server.entity.RelatedItem; 871import com.echothree.model.data.item.server.entity.RelatedItemType; 872import com.echothree.model.data.offer.common.OfferConstants; 873import com.echothree.model.data.offer.common.OfferItemConstants; 874import com.echothree.model.data.offer.common.OfferItemPriceConstants; 875import com.echothree.model.data.offer.common.OfferNameElementConstants; 876import com.echothree.model.data.offer.common.UseConstants; 877import com.echothree.model.data.offer.common.UseNameElementConstants; 878import com.echothree.model.data.offer.common.UseTypeConstants; 879import com.echothree.model.data.offer.server.entity.Offer; 880import com.echothree.model.data.offer.server.entity.OfferItem; 881import com.echothree.model.data.offer.server.entity.OfferItemPrice; 882import com.echothree.model.data.offer.server.entity.OfferNameElement; 883import com.echothree.model.data.offer.server.entity.OfferUse; 884import com.echothree.model.data.offer.server.entity.Use; 885import com.echothree.model.data.offer.server.entity.UseNameElement; 886import com.echothree.model.data.offer.server.entity.UseType; 887import com.echothree.model.data.order.common.OrderPriorityConstants; 888import com.echothree.model.data.order.common.OrderTimeTypeConstants; 889import com.echothree.model.data.order.common.OrderTypeConstants; 890import com.echothree.model.data.order.server.entity.OrderPriority; 891import com.echothree.model.data.order.server.entity.OrderTimeType; 892import com.echothree.model.data.order.server.entity.OrderType; 893import com.echothree.model.data.party.common.DateTimeFormatConstants; 894import com.echothree.model.data.party.common.LanguageConstants; 895import com.echothree.model.data.party.common.NameSuffixConstants; 896import com.echothree.model.data.party.common.PartyAliasTypeConstants; 897import com.echothree.model.data.party.common.PartyCompanyConstants; 898import com.echothree.model.data.party.common.PartyConstants; 899import com.echothree.model.data.party.common.PartyDepartmentConstants; 900import com.echothree.model.data.party.common.PartyDivisionConstants; 901import com.echothree.model.data.party.common.PartyTypeConstants; 902import com.echothree.model.data.party.common.PersonalTitleConstants; 903import com.echothree.model.data.party.common.RoleTypeConstants; 904import com.echothree.model.data.party.common.TimeZoneConstants; 905import com.echothree.model.data.party.server.entity.DateTimeFormat; 906import com.echothree.model.data.party.server.entity.Language; 907import com.echothree.model.data.party.server.entity.Party; 908import com.echothree.model.data.party.server.entity.PartyAlias; 909import com.echothree.model.data.party.server.entity.PartyAliasType; 910import com.echothree.model.data.party.server.entity.PartyCompany; 911import com.echothree.model.data.party.server.entity.PartyDepartment; 912import com.echothree.model.data.party.server.entity.PartyDivision; 913import com.echothree.model.data.party.server.entity.PartyType; 914import com.echothree.model.data.party.server.entity.RoleType; 915import com.echothree.model.data.party.server.entity.TimeZone; 916import com.echothree.model.data.payment.common.PaymentMethodTypeConstants; 917import com.echothree.model.data.payment.common.PaymentProcessorConstants; 918import com.echothree.model.data.payment.common.PaymentProcessorTypeConstants; 919import com.echothree.model.data.payment.server.entity.PaymentMethodType; 920import com.echothree.model.data.payment.server.entity.PaymentProcessor; 921import com.echothree.model.data.payment.server.entity.PaymentProcessorActionType; 922import com.echothree.model.data.payment.server.entity.PaymentProcessorResultCode; 923import com.echothree.model.data.payment.server.entity.PaymentProcessorTransaction; 924import com.echothree.model.data.payment.server.entity.PaymentProcessorType; 925import com.echothree.model.data.payment.server.entity.PaymentProcessorTypeCode; 926import com.echothree.model.data.payment.server.entity.PaymentProcessorTypeCodeType; 927import com.echothree.model.data.queue.common.QueueTypeConstants; 928import com.echothree.model.data.queue.server.entity.QueueType; 929import com.echothree.model.data.returnpolicy.common.ReturnKindConstants; 930import com.echothree.model.data.returnpolicy.common.ReturnPolicyConstants; 931import com.echothree.model.data.returnpolicy.server.entity.ReturnKind; 932import com.echothree.model.data.returnpolicy.server.entity.ReturnPolicy; 933import com.echothree.model.data.search.common.SearchCheckSpellingActionTypeConstants; 934import com.echothree.model.data.search.common.SearchDefaultOperatorConstants; 935import com.echothree.model.data.search.common.SearchKindConstants; 936import com.echothree.model.data.search.common.SearchResultActionTypeConstants; 937import com.echothree.model.data.search.common.SearchSortDirectionConstants; 938import com.echothree.model.data.search.common.SearchSortOrderConstants; 939import com.echothree.model.data.search.common.SearchTypeConstants; 940import com.echothree.model.data.search.common.SearchUseTypeConstants; 941import com.echothree.model.data.search.server.entity.SearchCheckSpellingActionType; 942import com.echothree.model.data.search.server.entity.SearchDefaultOperator; 943import com.echothree.model.data.search.server.entity.SearchKind; 944import com.echothree.model.data.search.server.entity.SearchResultActionType; 945import com.echothree.model.data.search.server.entity.SearchSortDirection; 946import com.echothree.model.data.search.server.entity.SearchSortOrder; 947import com.echothree.model.data.search.server.entity.SearchType; 948import com.echothree.model.data.search.server.entity.SearchUseType; 949import com.echothree.model.data.security.common.SecurityRoleConstants; 950import com.echothree.model.data.security.common.SecurityRoleGroupConstants; 951import com.echothree.model.data.security.server.entity.SecurityRole; 952import com.echothree.model.data.security.server.entity.SecurityRoleGroup; 953import com.echothree.model.data.selector.common.SelectorKindConstants; 954import com.echothree.model.data.selector.common.SelectorTypeConstants; 955import com.echothree.model.data.selector.server.entity.Selector; 956import com.echothree.model.data.selector.server.entity.SelectorKind; 957import com.echothree.model.data.selector.server.entity.SelectorType; 958import com.echothree.model.data.sequence.common.SequenceChecksumTypeConstants; 959import com.echothree.model.data.sequence.common.SequenceConstants; 960import com.echothree.model.data.sequence.common.SequenceEncoderTypeConstants; 961import com.echothree.model.data.sequence.common.SequenceTypeConstants; 962import com.echothree.model.data.sequence.server.entity.Sequence; 963import com.echothree.model.data.sequence.server.entity.SequenceChecksumType; 964import com.echothree.model.data.sequence.server.entity.SequenceEncoderType; 965import com.echothree.model.data.sequence.server.entity.SequenceType; 966import com.echothree.model.data.shipment.common.FreeOnBoardConstants; 967import com.echothree.model.data.shipment.server.entity.FreeOnBoard; 968import com.echothree.model.data.shipping.common.ShippingMethodConstants; 969import com.echothree.model.data.shipping.server.entity.ShippingMethod; 970import com.echothree.model.data.tag.common.EntityTagConstants; 971import com.echothree.model.data.tag.common.TagConstants; 972import com.echothree.model.data.tag.common.TagScopeConstants; 973import com.echothree.model.data.tag.common.TagScopeEntityTypeConstants; 974import com.echothree.model.data.tag.server.entity.EntityTag; 975import com.echothree.model.data.tag.server.entity.Tag; 976import com.echothree.model.data.tag.server.entity.TagScope; 977import com.echothree.model.data.tag.server.entity.TagScopeEntityType; 978import com.echothree.model.data.term.common.TermConstants; 979import com.echothree.model.data.term.common.TermTypeConstants; 980import com.echothree.model.data.term.server.entity.Term; 981import com.echothree.model.data.term.server.entity.TermType; 982import com.echothree.model.data.uom.common.UnitOfMeasureKindConstants; 983import com.echothree.model.data.uom.common.UnitOfMeasureKindUseConstants; 984import com.echothree.model.data.uom.common.UnitOfMeasureKindUseTypeConstants; 985import com.echothree.model.data.uom.common.UnitOfMeasureTypeConstants; 986import com.echothree.model.data.uom.server.entity.UnitOfMeasureKind; 987import com.echothree.model.data.uom.server.entity.UnitOfMeasureKindUse; 988import com.echothree.model.data.uom.server.entity.UnitOfMeasureKindUseType; 989import com.echothree.model.data.uom.server.entity.UnitOfMeasureType; 990import com.echothree.model.data.user.common.RecoveryQuestionConstants; 991import com.echothree.model.data.user.common.UserVisitGroupConstants; 992import com.echothree.model.data.user.server.entity.RecoveryQuestion; 993import com.echothree.model.data.user.server.entity.UserLogin; 994import com.echothree.model.data.user.server.entity.UserVisitGroup; 995import com.echothree.model.data.vendor.common.ItemPurchasingCategoryConstants; 996import com.echothree.model.data.vendor.common.VendorConstants; 997import com.echothree.model.data.vendor.common.VendorItemConstants; 998import com.echothree.model.data.vendor.common.VendorItemCostConstants; 999import com.echothree.model.data.vendor.common.VendorTypeConstants; 1000import com.echothree.model.data.vendor.server.entity.ItemPurchasingCategory; 1001import com.echothree.model.data.vendor.server.entity.Vendor; 1002import com.echothree.model.data.vendor.server.entity.VendorItem; 1003import com.echothree.model.data.vendor.server.entity.VendorItemCost; 1004import com.echothree.model.data.vendor.server.entity.VendorType; 1005import com.echothree.model.data.warehouse.common.LocationConstants; 1006import com.echothree.model.data.warehouse.common.LocationNameElementConstants; 1007import com.echothree.model.data.warehouse.common.LocationTypeConstants; 1008import com.echothree.model.data.warehouse.common.LocationUseTypeConstants; 1009import com.echothree.model.data.warehouse.common.WarehouseConstants; 1010import com.echothree.model.data.warehouse.common.WarehouseTypeConstants; 1011import com.echothree.model.data.warehouse.server.entity.Location; 1012import com.echothree.model.data.warehouse.server.entity.LocationNameElement; 1013import com.echothree.model.data.warehouse.server.entity.LocationType; 1014import com.echothree.model.data.warehouse.server.entity.LocationUseType; 1015import com.echothree.model.data.warehouse.server.entity.Warehouse; 1016import com.echothree.model.data.warehouse.server.entity.WarehouseType; 1017import com.echothree.model.data.wishlist.common.WishlistPriorityConstants; 1018import com.echothree.model.data.wishlist.common.WishlistTypeConstants; 1019import com.echothree.model.data.wishlist.server.entity.WishlistPriority; 1020import com.echothree.model.data.wishlist.server.entity.WishlistType; 1021import com.echothree.model.data.workflow.common.WorkflowConstants; 1022import com.echothree.model.data.workflow.common.WorkflowDestinationConstants; 1023import com.echothree.model.data.workflow.common.WorkflowDestinationPartyTypeConstants; 1024import com.echothree.model.data.workflow.common.WorkflowDestinationSecurityRoleConstants; 1025import com.echothree.model.data.workflow.common.WorkflowDestinationSelectorConstants; 1026import com.echothree.model.data.workflow.common.WorkflowDestinationStepConstants; 1027import com.echothree.model.data.workflow.common.WorkflowEntityStatusConstants; 1028import com.echothree.model.data.workflow.common.WorkflowEntityTypeConstants; 1029import com.echothree.model.data.workflow.common.WorkflowEntranceConstants; 1030import com.echothree.model.data.workflow.common.WorkflowEntrancePartyTypeConstants; 1031import com.echothree.model.data.workflow.common.WorkflowEntranceSecurityRoleConstants; 1032import com.echothree.model.data.workflow.common.WorkflowEntranceSelectorConstants; 1033import com.echothree.model.data.workflow.common.WorkflowEntranceStepConstants; 1034import com.echothree.model.data.workflow.common.WorkflowSelectorKindConstants; 1035import com.echothree.model.data.workflow.common.WorkflowStepConstants; 1036import com.echothree.model.data.workflow.common.WorkflowStepTypeConstants; 1037import com.echothree.model.data.workflow.server.entity.Workflow; 1038import com.echothree.model.data.workflow.server.entity.WorkflowDestination; 1039import com.echothree.model.data.workflow.server.entity.WorkflowDestinationPartyType; 1040import com.echothree.model.data.workflow.server.entity.WorkflowDestinationSecurityRole; 1041import com.echothree.model.data.workflow.server.entity.WorkflowDestinationSelector; 1042import com.echothree.model.data.workflow.server.entity.WorkflowDestinationStep; 1043import com.echothree.model.data.workflow.server.entity.WorkflowEntityType; 1044import com.echothree.model.data.workflow.server.entity.WorkflowEntrance; 1045import com.echothree.model.data.workflow.server.entity.WorkflowEntrancePartyType; 1046import com.echothree.model.data.workflow.server.entity.WorkflowEntranceSecurityRole; 1047import com.echothree.model.data.workflow.server.entity.WorkflowEntranceSelector; 1048import com.echothree.model.data.workflow.server.entity.WorkflowEntranceStep; 1049import com.echothree.model.data.workflow.server.entity.WorkflowSelectorKind; 1050import com.echothree.model.data.workflow.server.entity.WorkflowStep; 1051import com.echothree.model.data.workflow.server.entity.WorkflowStepType; 1052import com.echothree.util.server.persistence.Session; 1053import graphql.annotations.annotationTypes.GraphQLField; 1054import graphql.annotations.annotationTypes.GraphQLID; 1055import graphql.annotations.annotationTypes.GraphQLName; 1056import graphql.annotations.annotationTypes.GraphQLNonNull; 1057import graphql.annotations.connection.GraphQLConnection; 1058import graphql.schema.DataFetchingEnvironment; 1059import java.util.ArrayList; 1060import java.util.Collection; 1061import static java.util.Collections.emptyList; 1062import java.util.stream.Collectors; 1063import javax.enterprise.inject.spi.CDI; 1064import javax.naming.NamingException; 1065 1066@GraphQLName("query") 1067public interface GraphQlQueries { 1068 1069 @GraphQLField 1070 @GraphQLName("searchKind") 1071 static SearchKindObject searchKind(final DataFetchingEnvironment env, 1072 @GraphQLName("searchKindName") final String searchKindName, 1073 @GraphQLName("id") @GraphQLID final String id) { 1074 SearchKind searchKind; 1075 1076 try { 1077 var commandForm = SearchUtil.getHome().getGetSearchKindForm(); 1078 1079 commandForm.setSearchKindName(searchKindName); 1080 commandForm.setUuid(id); 1081 1082 searchKind = CDI.current().select(GetSearchKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1083 } catch (NamingException ex) { 1084 throw new RuntimeException(ex); 1085 } 1086 1087 return searchKind == null ? null : new SearchKindObject(searchKind); 1088 } 1089 1090 @GraphQLField 1091 @GraphQLName("searchKinds") 1092 @GraphQLNonNull 1093 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1094 static CountingPaginatedData<SearchKindObject> searchKinds(final DataFetchingEnvironment env) { 1095 CountingPaginatedData<SearchKindObject> data; 1096 1097 try { 1098 var searchControl = Session.getModelController(SearchControl.class); 1099 var totalCount = searchControl.countSearchKinds(); 1100 1101 try(var objectLimiter = new ObjectLimiter(env, SearchKindConstants.COMPONENT_VENDOR_NAME, SearchKindConstants.ENTITY_TYPE_NAME, totalCount)) { 1102 var commandForm = SearchUtil.getHome().getGetSearchKindsForm(); 1103 var entities = CDI.current().select(GetSearchKindsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1104 1105 if(entities == null) { 1106 data = Connections.emptyConnection(); 1107 } else { 1108 var searchKinds = entities.stream().map(SearchKindObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1109 1110 data = new CountedObjects<>(objectLimiter, searchKinds); 1111 } 1112 } 1113 } catch (NamingException ex) { 1114 throw new RuntimeException(ex); 1115 } 1116 1117 return data; 1118 } 1119 1120 @GraphQLField 1121 @GraphQLName("searchType") 1122 static SearchTypeObject searchType(final DataFetchingEnvironment env, 1123 @GraphQLName("searchKindName") final String searchKindName, 1124 @GraphQLName("searchTypeName") final String searchTypeName, 1125 @GraphQLName("id") @GraphQLID final String id) { 1126 SearchType searchType; 1127 1128 try { 1129 var commandForm = SearchUtil.getHome().getGetSearchTypeForm(); 1130 1131 commandForm.setSearchKindName(searchKindName); 1132 commandForm.setSearchTypeName(searchTypeName); 1133 commandForm.setUuid(id); 1134 1135 searchType = CDI.current().select(GetSearchTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1136 } catch (NamingException ex) { 1137 throw new RuntimeException(ex); 1138 } 1139 1140 return searchType == null ? null : new SearchTypeObject(searchType); 1141 } 1142 1143 @GraphQLField 1144 @GraphQLName("searchTypes") 1145 @GraphQLNonNull 1146 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1147 static CountingPaginatedData<SearchTypeObject> searchTypes(final DataFetchingEnvironment env, 1148 @GraphQLName("searchKindName") @GraphQLNonNull final String searchKindName) { 1149 CountingPaginatedData<SearchTypeObject> data; 1150 1151 try { 1152 var commandForm = SearchUtil.getHome().getGetSearchTypesForm(); 1153 var command = CDI.current().select(GetSearchTypesCommand.class).get(); 1154 1155 commandForm.setSearchKindName(searchKindName); 1156 1157 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1158 if(totalEntities == null) { 1159 data = Connections.emptyConnection(); 1160 } else { 1161 try(var objectLimiter = new ObjectLimiter(env, SearchTypeConstants.COMPONENT_VENDOR_NAME, SearchTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 1162 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1163 1164 var searchTypes = entities.stream() 1165 .map(SearchTypeObject::new) 1166 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1167 1168 data = new CountedObjects<>(objectLimiter, searchTypes); 1169 } 1170 } 1171 } catch (NamingException ex) { 1172 throw new RuntimeException(ex); 1173 } 1174 1175 return data; 1176 } 1177 1178 @GraphQLField 1179 @GraphQLName("searchSortOrder") 1180 static SearchSortOrderObject searchSortOrder(final DataFetchingEnvironment env, 1181 @GraphQLName("searchKindName") final String searchKindName, 1182 @GraphQLName("searchSortOrderName") final String searchSortOrderName, 1183 @GraphQLName("id") @GraphQLID final String id) { 1184 SearchSortOrder searchSortOrder; 1185 1186 try { 1187 var commandForm = SearchUtil.getHome().getGetSearchSortOrderForm(); 1188 1189 commandForm.setSearchKindName(searchKindName); 1190 commandForm.setSearchSortOrderName(searchSortOrderName); 1191 commandForm.setUuid(id); 1192 1193 searchSortOrder = CDI.current().select(GetSearchSortOrderCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1194 } catch (NamingException ex) { 1195 throw new RuntimeException(ex); 1196 } 1197 1198 return searchSortOrder == null ? null : new SearchSortOrderObject(searchSortOrder); 1199 } 1200 1201 @GraphQLField 1202 @GraphQLName("searchSortOrders") 1203 @GraphQLNonNull 1204 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1205 static CountingPaginatedData<SearchSortOrderObject> searchSortOrders(final DataFetchingEnvironment env, 1206 @GraphQLName("searchKindName") @GraphQLNonNull final String searchKindName) { 1207 CountingPaginatedData<SearchSortOrderObject> data; 1208 1209 try { 1210 var commandForm = SearchUtil.getHome().getGetSearchSortOrdersForm(); 1211 var command = CDI.current().select(GetSearchSortOrdersCommand.class).get(); 1212 1213 commandForm.setSearchKindName(searchKindName); 1214 1215 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1216 if(totalEntities == null) { 1217 data = Connections.emptyConnection(); 1218 } else { 1219 try(var objectLimiter = new ObjectLimiter(env, SearchSortOrderConstants.COMPONENT_VENDOR_NAME, SearchSortOrderConstants.ENTITY_TYPE_NAME, totalEntities)) { 1220 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1221 1222 var searchSortOrders = entities.stream() 1223 .map(SearchSortOrderObject::new) 1224 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1225 1226 data = new CountedObjects<>(objectLimiter, searchSortOrders); 1227 } 1228 } 1229 } catch (NamingException ex) { 1230 throw new RuntimeException(ex); 1231 } 1232 1233 return data; 1234 } 1235 1236 @GraphQLField 1237 @GraphQLName("searchUseType") 1238 static SearchUseTypeObject searchUseType(final DataFetchingEnvironment env, 1239 @GraphQLName("searchUseTypeName") final String searchUseTypeName, 1240 @GraphQLName("id") @GraphQLID final String id) { 1241 SearchUseType searchUseType; 1242 1243 try { 1244 var commandForm = SearchUtil.getHome().getGetSearchUseTypeForm(); 1245 1246 commandForm.setSearchUseTypeName(searchUseTypeName); 1247 commandForm.setUuid(id); 1248 1249 searchUseType = CDI.current().select(GetSearchUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1250 } catch (NamingException ex) { 1251 throw new RuntimeException(ex); 1252 } 1253 1254 return searchUseType == null ? null : new SearchUseTypeObject(searchUseType); 1255 } 1256 1257 @GraphQLField 1258 @GraphQLName("searchUseTypes") 1259 @GraphQLNonNull 1260 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1261 static CountingPaginatedData<SearchUseTypeObject> searchUseTypes(final DataFetchingEnvironment env) { 1262 CountingPaginatedData<SearchUseTypeObject> data; 1263 1264 try { 1265 var searchControl = Session.getModelController(SearchControl.class); 1266 var totalCount = searchControl.countSearchUseTypes(); 1267 1268 try(var objectLimiter = new ObjectLimiter(env, SearchUseTypeConstants.COMPONENT_VENDOR_NAME, SearchUseTypeConstants.ENTITY_TYPE_NAME, totalCount)) { 1269 var commandForm = SearchUtil.getHome().getGetSearchUseTypesForm(); 1270 var entities = CDI.current().select(GetSearchUseTypesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1271 1272 if(entities == null) { 1273 data = Connections.emptyConnection(); 1274 } else { 1275 var searchUseTypes = entities.stream().map(SearchUseTypeObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1276 1277 data = new CountedObjects<>(objectLimiter, searchUseTypes); 1278 } 1279 } 1280 } catch (NamingException ex) { 1281 throw new RuntimeException(ex); 1282 } 1283 1284 return data; 1285 } 1286 1287 @GraphQLField 1288 @GraphQLName("searchDefaultOperator") 1289 static SearchDefaultOperatorObject searchDefaultOperator(final DataFetchingEnvironment env, 1290 @GraphQLName("searchDefaultOperatorName") final String searchDefaultOperatorName, 1291 @GraphQLName("id") @GraphQLID final String id) { 1292 SearchDefaultOperator searchDefaultOperator; 1293 1294 try { 1295 var commandForm = SearchUtil.getHome().getGetSearchDefaultOperatorForm(); 1296 1297 commandForm.setSearchDefaultOperatorName(searchDefaultOperatorName); 1298 commandForm.setUuid(id); 1299 1300 searchDefaultOperator = CDI.current().select(GetSearchDefaultOperatorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1301 } catch (NamingException ex) { 1302 throw new RuntimeException(ex); 1303 } 1304 1305 return searchDefaultOperator == null ? null : new SearchDefaultOperatorObject(searchDefaultOperator); 1306 } 1307 1308 @GraphQLField 1309 @GraphQLName("searchDefaultOperators") 1310 @GraphQLNonNull 1311 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1312 static CountingPaginatedData<SearchDefaultOperatorObject> searchDefaultOperators(final DataFetchingEnvironment env) { 1313 CountingPaginatedData<SearchDefaultOperatorObject> data; 1314 1315 try { 1316 var searchControl = Session.getModelController(SearchControl.class); 1317 var totalCount = searchControl.countSearchDefaultOperators(); 1318 1319 try(var objectLimiter = new ObjectLimiter(env, SearchDefaultOperatorConstants.COMPONENT_VENDOR_NAME, SearchDefaultOperatorConstants.ENTITY_TYPE_NAME, totalCount)) { 1320 var commandForm = SearchUtil.getHome().getGetSearchDefaultOperatorsForm(); 1321 var entities = CDI.current().select(GetSearchDefaultOperatorsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1322 1323 if(entities == null) { 1324 data = Connections.emptyConnection(); 1325 } else { 1326 var searchDefaultOperators = entities.stream().map(SearchDefaultOperatorObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1327 1328 data = new CountedObjects<>(objectLimiter, searchDefaultOperators); 1329 } 1330 } 1331 } catch (NamingException ex) { 1332 throw new RuntimeException(ex); 1333 } 1334 1335 return data; 1336 } 1337 1338 @GraphQLField 1339 @GraphQLName("searchSortDirection") 1340 static SearchSortDirectionObject searchSortDirection(final DataFetchingEnvironment env, 1341 @GraphQLName("searchSortDirectionName") final String searchSortDirectionName, 1342 @GraphQLName("id") @GraphQLID final String id) { 1343 SearchSortDirection searchSortDirection; 1344 1345 try { 1346 var commandForm = SearchUtil.getHome().getGetSearchSortDirectionForm(); 1347 1348 commandForm.setSearchSortDirectionName(searchSortDirectionName); 1349 commandForm.setUuid(id); 1350 1351 searchSortDirection = CDI.current().select(GetSearchSortDirectionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1352 } catch (NamingException ex) { 1353 throw new RuntimeException(ex); 1354 } 1355 1356 return searchSortDirection == null ? null : new SearchSortDirectionObject(searchSortDirection); 1357 } 1358 1359 @GraphQLField 1360 @GraphQLName("searchSortDirections") 1361 @GraphQLNonNull 1362 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1363 static CountingPaginatedData<SearchSortDirectionObject> searchSortDirections(final DataFetchingEnvironment env) { 1364 CountingPaginatedData<SearchSortDirectionObject> data; 1365 1366 try { 1367 var searchControl = Session.getModelController(SearchControl.class); 1368 var totalCount = searchControl.countSearchSortDirections(); 1369 1370 try(var objectLimiter = new ObjectLimiter(env, SearchSortDirectionConstants.COMPONENT_VENDOR_NAME, SearchSortDirectionConstants.ENTITY_TYPE_NAME, totalCount)) { 1371 var commandForm = SearchUtil.getHome().getGetSearchSortDirectionsForm(); 1372 var entities = CDI.current().select(GetSearchSortDirectionsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1373 1374 if(entities == null) { 1375 data = Connections.emptyConnection(); 1376 } else { 1377 var searchSortDirections = entities.stream().map(SearchSortDirectionObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1378 1379 data = new CountedObjects<>(objectLimiter, searchSortDirections); 1380 } 1381 } 1382 } catch (NamingException ex) { 1383 throw new RuntimeException(ex); 1384 } 1385 1386 return data; 1387 } 1388 1389 @GraphQLField 1390 @GraphQLName("searchResultActionType") 1391 static SearchResultActionTypeObject searchResultActionType(final DataFetchingEnvironment env, 1392 @GraphQLName("searchResultActionTypeName") final String searchResultActionTypeName, 1393 @GraphQLName("id") @GraphQLID final String id) { 1394 SearchResultActionType searchResultActionType; 1395 1396 try { 1397 var commandForm = SearchUtil.getHome().getGetSearchResultActionTypeForm(); 1398 1399 commandForm.setSearchResultActionTypeName(searchResultActionTypeName); 1400 commandForm.setUuid(id); 1401 1402 searchResultActionType = CDI.current().select(GetSearchResultActionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1403 } catch (NamingException ex) { 1404 throw new RuntimeException(ex); 1405 } 1406 1407 return searchResultActionType == null ? null : new SearchResultActionTypeObject(searchResultActionType); 1408 } 1409 1410 @GraphQLField 1411 @GraphQLName("searchResultActionTypes") 1412 @GraphQLNonNull 1413 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1414 static CountingPaginatedData<SearchResultActionTypeObject> searchResultActionTypes(final DataFetchingEnvironment env) { 1415 CountingPaginatedData<SearchResultActionTypeObject> data; 1416 1417 try { 1418 var commandForm = SearchUtil.getHome().getGetSearchResultActionTypesForm(); 1419 var command = CDI.current().select(GetSearchResultActionTypesCommand.class).get(); 1420 1421 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1422 if(totalEntities == null) { 1423 data = Connections.emptyConnection(); 1424 } else { 1425 try(var objectLimiter = new ObjectLimiter(env, SearchResultActionTypeConstants.COMPONENT_VENDOR_NAME, SearchResultActionTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 1426 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1427 1428 var searchResultActionTypes = entities.stream() 1429 .map(SearchResultActionTypeObject::new) 1430 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1431 1432 data = new CountedObjects<>(objectLimiter, searchResultActionTypes); 1433 } 1434 } 1435 } catch (NamingException ex) { 1436 throw new RuntimeException(ex); 1437 } 1438 1439 return data; 1440 } 1441 1442 @GraphQLField 1443 @GraphQLName("searchCheckSpellingActionType") 1444 static SearchCheckSpellingActionTypeObject searchCheckSpellingActionType(final DataFetchingEnvironment env, 1445 @GraphQLName("searchCheckSpellingActionTypeName") final String searchCheckSpellingActionTypeName, 1446 @GraphQLName("id") @GraphQLID final String id) { 1447 SearchCheckSpellingActionType searchCheckSpellingActionType; 1448 1449 try { 1450 var commandForm = SearchUtil.getHome().getGetSearchCheckSpellingActionTypeForm(); 1451 1452 commandForm.setSearchCheckSpellingActionTypeName(searchCheckSpellingActionTypeName); 1453 commandForm.setUuid(id); 1454 1455 searchCheckSpellingActionType = CDI.current().select(GetSearchCheckSpellingActionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1456 } catch (NamingException ex) { 1457 throw new RuntimeException(ex); 1458 } 1459 1460 return searchCheckSpellingActionType == null ? null : new SearchCheckSpellingActionTypeObject(searchCheckSpellingActionType); 1461 } 1462 1463 @GraphQLField 1464 @GraphQLName("searchCheckSpellingActionTypes") 1465 @GraphQLNonNull 1466 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1467 static CountingPaginatedData<SearchCheckSpellingActionTypeObject> searchCheckSpellingActionTypes(final DataFetchingEnvironment env) { 1468 CountingPaginatedData<SearchCheckSpellingActionTypeObject> data; 1469 1470 try { 1471 var commandForm = SearchUtil.getHome().getGetSearchCheckSpellingActionTypesForm(); 1472 var command = CDI.current().select(GetSearchCheckSpellingActionTypesCommand.class).get(); 1473 1474 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1475 if(totalEntities == null) { 1476 data = Connections.emptyConnection(); 1477 } else { 1478 try(var objectLimiter = new ObjectLimiter(env, SearchCheckSpellingActionTypeConstants.COMPONENT_VENDOR_NAME, SearchCheckSpellingActionTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 1479 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1480 1481 var searchCheckSpellingActionTypes = entities.stream() 1482 .map(SearchCheckSpellingActionTypeObject::new) 1483 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1484 1485 data = new CountedObjects<>(objectLimiter, searchCheckSpellingActionTypes); 1486 } 1487 } 1488 } catch (NamingException ex) { 1489 throw new RuntimeException(ex); 1490 } 1491 1492 return data; 1493 } 1494 1495 @GraphQLField 1496 @GraphQLName("workflow") 1497 static WorkflowObject workflow(final DataFetchingEnvironment env, 1498 @GraphQLName("workflowName") final String workflowName, 1499 @GraphQLName("id") @GraphQLID final String id) { 1500 Workflow workflow; 1501 1502 try { 1503 var commandForm = WorkflowUtil.getHome().getGetWorkflowForm(); 1504 1505 commandForm.setWorkflowName(workflowName); 1506 commandForm.setUuid(id); 1507 1508 workflow = CDI.current().select(GetWorkflowCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1509 } catch (NamingException ex) { 1510 throw new RuntimeException(ex); 1511 } 1512 1513 return workflow == null ? null : new WorkflowObject(workflow); 1514 } 1515 1516 @GraphQLField 1517 @GraphQLName("workflows") 1518 @GraphQLNonNull 1519 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1520 static CountingPaginatedData<WorkflowObject> workflows(final DataFetchingEnvironment env, 1521 @GraphQLName("selectorKindName") final String selectorKindName) { 1522 CountingPaginatedData<WorkflowObject> data; 1523 1524 try { 1525 var commandForm = WorkflowUtil.getHome().getGetWorkflowsForm(); 1526 var command = CDI.current().select(GetWorkflowsCommand.class).get(); 1527 1528 commandForm.setSelectorKindName(selectorKindName); 1529 1530 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1531 if(totalEntities == null) { 1532 data = Connections.emptyConnection(); 1533 } else { 1534 try(var objectLimiter = new ObjectLimiter(env, WorkflowConstants.COMPONENT_VENDOR_NAME, WorkflowConstants.ENTITY_TYPE_NAME, totalEntities)) { 1535 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1536 1537 var workflows = entities.stream() 1538 .map(WorkflowObject::new) 1539 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1540 1541 data = new CountedObjects<>(objectLimiter, workflows); 1542 } 1543 } 1544 } catch (NamingException ex) { 1545 throw new RuntimeException(ex); 1546 } 1547 1548 return data; 1549 } 1550 1551 @GraphQLField 1552 @GraphQLName("workflowEntityType") 1553 static WorkflowEntityTypeObject workflowEntityType(final DataFetchingEnvironment env, 1554 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1555 @GraphQLName("componentVendorName") @GraphQLNonNull final String componentVendorName, 1556 @GraphQLName("entityTypeName") @GraphQLNonNull final String entityTypeName) { 1557 WorkflowEntityType workflowEntityType; 1558 1559 try { 1560 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntityTypeForm(); 1561 1562 commandForm.setWorkflowName(workflowName); 1563 commandForm.setComponentVendorName(componentVendorName); 1564 commandForm.setEntityTypeName(entityTypeName); 1565 1566 workflowEntityType = CDI.current().select(GetWorkflowEntityTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1567 } catch (NamingException ex) { 1568 throw new RuntimeException(ex); 1569 } 1570 1571 return workflowEntityType == null ? null : new WorkflowEntityTypeObject(workflowEntityType); 1572 } 1573 1574 @GraphQLField 1575 @GraphQLName("workflowEntityTypes") 1576 @GraphQLNonNull 1577 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1578 static CountingPaginatedData<WorkflowEntityTypeObject> workflowEntityTypes(final DataFetchingEnvironment env, 1579 @GraphQLName("workflowName") final String workflowName, 1580 @GraphQLName("componentVendorName") final String componentVendorName, 1581 @GraphQLName("entityTypeName") final String entityTypeName) { 1582 CountingPaginatedData<WorkflowEntityTypeObject> data; 1583 1584 try { 1585 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntityTypesForm(); 1586 var command = CDI.current().select(GetWorkflowEntityTypesCommand.class).get(); 1587 1588 commandForm.setWorkflowName(workflowName); 1589 commandForm.setComponentVendorName(componentVendorName); 1590 commandForm.setEntityTypeName(entityTypeName); 1591 1592 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1593 if(totalEntities == null) { 1594 data = Connections.emptyConnection(); 1595 } else { 1596 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntityTypeConstants.COMPONENT_VENDOR_NAME, WorkflowEntityTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 1597 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1598 1599 var workflowEntityTypes = entities.stream() 1600 .map(WorkflowEntityTypeObject::new) 1601 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1602 1603 data = new CountedObjects<>(objectLimiter, workflowEntityTypes); 1604 } 1605 } 1606 } catch (NamingException ex) { 1607 throw new RuntimeException(ex); 1608 } 1609 1610 return data; 1611 } 1612 1613 @GraphQLField 1614 @GraphQLName("workflowSelectorKind") 1615 static WorkflowSelectorKindObject workflowSelectorKind(final DataFetchingEnvironment env, 1616 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1617 @GraphQLName("selectorKindName") @GraphQLNonNull final String selectorKindName) { 1618 WorkflowSelectorKind workflowSelectorKind; 1619 1620 try { 1621 var commandForm = WorkflowUtil.getHome().getGetWorkflowSelectorKindForm(); 1622 1623 commandForm.setWorkflowName(workflowName); 1624 commandForm.setSelectorKindName(selectorKindName); 1625 1626 workflowSelectorKind = CDI.current().select(GetWorkflowSelectorKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1627 } catch (NamingException ex) { 1628 throw new RuntimeException(ex); 1629 } 1630 1631 return workflowSelectorKind == null ? null : new WorkflowSelectorKindObject(workflowSelectorKind); 1632 } 1633 1634 @GraphQLField 1635 @GraphQLName("workflowSelectorKinds") 1636 @GraphQLNonNull 1637 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1638 static CountingPaginatedData<WorkflowSelectorKindObject> workflowSelectorKinds(final DataFetchingEnvironment env, 1639 @GraphQLName("workflowName") final String workflowName, 1640 @GraphQLName("selectorKindName") final String selectorKindName) { 1641 CountingPaginatedData<WorkflowSelectorKindObject> data; 1642 1643 try { 1644 var commandForm = WorkflowUtil.getHome().getGetWorkflowSelectorKindsForm(); 1645 var command = CDI.current().select(GetWorkflowSelectorKindsCommand.class).get(); 1646 1647 commandForm.setWorkflowName(workflowName); 1648 commandForm.setSelectorKindName(selectorKindName); 1649 1650 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1651 if(totalEntities == null) { 1652 data = Connections.emptyConnection(); 1653 } else { 1654 try(var objectLimiter = new ObjectLimiter(env, WorkflowSelectorKindConstants.COMPONENT_VENDOR_NAME, WorkflowSelectorKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 1655 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1656 1657 var workflowSelectorKinds = entities.stream() 1658 .map(WorkflowSelectorKindObject::new) 1659 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1660 1661 data = new CountedObjects<>(objectLimiter, workflowSelectorKinds); 1662 } 1663 } 1664 } catch (NamingException ex) { 1665 throw new RuntimeException(ex); 1666 } 1667 1668 return data; 1669 } 1670 1671 @GraphQLField 1672 @GraphQLName("workflowEntityStatuses") 1673 @GraphQLNonNull 1674 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1675 static CountingPaginatedData<WorkflowEntityStatusObject> workflowEntityStatuses(final DataFetchingEnvironment env, 1676 @GraphQLName("workflowName") final String workflowName) { 1677 CountingPaginatedData<WorkflowEntityStatusObject> data; 1678 1679 try { 1680 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntityStatusesForm(); 1681 var command = CDI.current().select(GetWorkflowEntityStatusesCommand.class).get(); 1682 1683 commandForm.setWorkflowName(workflowName); 1684 1685 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1686 if(totalEntities == null) { 1687 data = Connections.emptyConnection(); 1688 } else { 1689 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntityStatusConstants.COMPONENT_VENDOR_NAME, WorkflowEntityStatusConstants.ENTITY_TYPE_NAME, totalEntities)) { 1690 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1691 1692 var workflowEntityStatuses = entities.stream() 1693 .map(WorkflowEntityStatusObject::new) 1694 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1695 1696 data = new CountedObjects<>(objectLimiter, workflowEntityStatuses); 1697 } 1698 } 1699 } catch (NamingException ex) { 1700 throw new RuntimeException(ex); 1701 } 1702 1703 return data; 1704 } 1705 1706 @GraphQLField 1707 @GraphQLName("workflowStep") 1708 static WorkflowStepObject workflowStep(final DataFetchingEnvironment env, 1709 @GraphQLName("workflowName") final String workflowName, 1710 @GraphQLName("workflowStepName") final String workflowStepName, 1711 @GraphQLName("id") @GraphQLID final String id) { 1712 WorkflowStep workflowStep; 1713 1714 try { 1715 var commandForm = WorkflowUtil.getHome().getGetWorkflowStepForm(); 1716 1717 commandForm.setWorkflowName(workflowName); 1718 commandForm.setWorkflowStepName(workflowStepName); 1719 commandForm.setUuid(id); 1720 1721 workflowStep = CDI.current().select(GetWorkflowStepCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1722 } catch (NamingException ex) { 1723 throw new RuntimeException(ex); 1724 } 1725 1726 return workflowStep == null ? null : new WorkflowStepObject(workflowStep); 1727 } 1728 1729 @GraphQLField 1730 @GraphQLName("workflowSteps") 1731 @GraphQLNonNull 1732 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1733 static CountingPaginatedData<WorkflowStepObject> workflowSteps(final DataFetchingEnvironment env, 1734 @GraphQLName("workflowName") final String workflowName) { 1735 CountingPaginatedData<WorkflowStepObject> data; 1736 1737 try { 1738 var commandForm = WorkflowUtil.getHome().getGetWorkflowStepsForm(); 1739 var command = CDI.current().select(GetWorkflowStepsCommand.class).get(); 1740 1741 commandForm.setWorkflowName(workflowName); 1742 1743 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1744 if(totalEntities == null) { 1745 data = Connections.emptyConnection(); 1746 } else { 1747 try(var objectLimiter = new ObjectLimiter(env, WorkflowStepConstants.COMPONENT_VENDOR_NAME, WorkflowStepConstants.ENTITY_TYPE_NAME, totalEntities)) { 1748 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1749 1750 var workflowSteps = entities.stream() 1751 .map(WorkflowStepObject::new) 1752 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1753 1754 data = new CountedObjects<>(objectLimiter, workflowSteps); 1755 } 1756 } 1757 } catch (NamingException ex) { 1758 throw new RuntimeException(ex); 1759 } 1760 1761 return data; 1762 } 1763 1764 @GraphQLField 1765 @GraphQLName("workflowDestination") 1766 static WorkflowDestinationObject workflowDestination(final DataFetchingEnvironment env, 1767 @GraphQLName("workflowName") final String workflowName, 1768 @GraphQLName("workflowStepName") final String workflowStepName, 1769 @GraphQLName("workflowDestinationName") final String workflowDestinationName, 1770 @GraphQLName("id") @GraphQLID final String id) { 1771 WorkflowDestination workflowDestination; 1772 1773 try { 1774 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationForm(); 1775 1776 commandForm.setWorkflowName(workflowName); 1777 commandForm.setWorkflowStepName(workflowStepName); 1778 commandForm.setWorkflowDestinationName(workflowDestinationName); 1779 commandForm.setUuid(id); 1780 1781 workflowDestination = CDI.current().select(GetWorkflowDestinationCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1782 } catch (NamingException ex) { 1783 throw new RuntimeException(ex); 1784 } 1785 1786 return workflowDestination == null ? null : new WorkflowDestinationObject(workflowDestination); 1787 } 1788 1789 @GraphQLField 1790 @GraphQLName("workflowDestinations") 1791 @GraphQLNonNull 1792 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1793 static CountingPaginatedData<WorkflowDestinationObject> workflowDestinations(final DataFetchingEnvironment env, 1794 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1795 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName) { 1796 CountingPaginatedData<WorkflowDestinationObject> data; 1797 1798 try { 1799 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationsForm(); 1800 var command = CDI.current().select(GetWorkflowDestinationsCommand.class).get(); 1801 1802 commandForm.setWorkflowName(workflowName); 1803 commandForm.setWorkflowStepName(workflowStepName); 1804 1805 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1806 if(totalEntities == null) { 1807 data = Connections.emptyConnection(); 1808 } else { 1809 try(var objectLimiter = new ObjectLimiter(env, WorkflowDestinationConstants.COMPONENT_VENDOR_NAME, WorkflowDestinationConstants.ENTITY_TYPE_NAME, totalEntities)) { 1810 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1811 1812 var workflowDestinations = entities.stream() 1813 .map(WorkflowDestinationObject::new) 1814 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1815 1816 data = new CountedObjects<>(objectLimiter, workflowDestinations); 1817 } 1818 } 1819 } catch (NamingException ex) { 1820 throw new RuntimeException(ex); 1821 } 1822 1823 return data; 1824 } 1825 1826 @GraphQLField 1827 @GraphQLName("workflowDestinationStep") 1828 static WorkflowDestinationStepObject workflowDestinationStep(final DataFetchingEnvironment env, 1829 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1830 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1831 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName, 1832 @GraphQLName("destinationWorkflowName") @GraphQLNonNull final String destinationWorkflowName, 1833 @GraphQLName("destinationWorkflowStepName") @GraphQLNonNull final String destinationWorkflowStepName) { 1834 WorkflowDestinationStep workflowDestinationStep; 1835 1836 try { 1837 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationStepForm(); 1838 1839 commandForm.setWorkflowName(workflowName); 1840 commandForm.setWorkflowStepName(workflowStepName); 1841 commandForm.setWorkflowDestinationName(workflowDestinationName); 1842 commandForm.setDestinationWorkflowName(destinationWorkflowName); 1843 commandForm.setDestinationWorkflowStepName(destinationWorkflowStepName); 1844 1845 workflowDestinationStep = CDI.current().select(GetWorkflowDestinationStepCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1846 } catch (NamingException ex) { 1847 throw new RuntimeException(ex); 1848 } 1849 1850 return workflowDestinationStep == null ? null : new WorkflowDestinationStepObject(workflowDestinationStep); 1851 } 1852 1853 @GraphQLField 1854 @GraphQLName("workflowDestinationSteps") 1855 @GraphQLNonNull 1856 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1857 static CountingPaginatedData<WorkflowDestinationStepObject> workflowDestinationSteps(final DataFetchingEnvironment env, 1858 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1859 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1860 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName) { 1861 CountingPaginatedData<WorkflowDestinationStepObject> data; 1862 1863 try { 1864 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationStepsForm(); 1865 var command = CDI.current().select(GetWorkflowDestinationStepsCommand.class).get(); 1866 1867 commandForm.setWorkflowName(workflowName); 1868 commandForm.setWorkflowStepName(workflowStepName); 1869 commandForm.setWorkflowDestinationName(workflowDestinationName); 1870 1871 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1872 if(totalEntities == null) { 1873 data = Connections.emptyConnection(); 1874 } else { 1875 try(var objectLimiter = new ObjectLimiter(env, WorkflowDestinationStepConstants.COMPONENT_VENDOR_NAME, WorkflowDestinationStepConstants.ENTITY_TYPE_NAME, totalEntities)) { 1876 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1877 1878 var workflowDestinationSteps = entities.stream() 1879 .map(WorkflowDestinationStepObject::new) 1880 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1881 1882 data = new CountedObjects<>(objectLimiter, workflowDestinationSteps); 1883 } 1884 } 1885 } catch (NamingException ex) { 1886 throw new RuntimeException(ex); 1887 } 1888 1889 return data; 1890 } 1891 1892 @GraphQLField 1893 @GraphQLName("workflowDestinationPartyType") 1894 static WorkflowDestinationPartyTypeObject workflowDestinationPartyType(final DataFetchingEnvironment env, 1895 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1896 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1897 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName, 1898 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName) { 1899 WorkflowDestinationPartyType workflowDestinationPartyType; 1900 1901 try { 1902 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationPartyTypeForm(); 1903 1904 commandForm.setWorkflowName(workflowName); 1905 commandForm.setWorkflowStepName(workflowStepName); 1906 commandForm.setWorkflowDestinationName(workflowDestinationName); 1907 commandForm.setPartyTypeName(partyTypeName); 1908 1909 workflowDestinationPartyType = CDI.current().select(GetWorkflowDestinationPartyTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1910 } catch (NamingException ex) { 1911 throw new RuntimeException(ex); 1912 } 1913 1914 return workflowDestinationPartyType == null ? null : new WorkflowDestinationPartyTypeObject(workflowDestinationPartyType); 1915 } 1916 1917 @GraphQLField 1918 @GraphQLName("workflowDestinationPartyTypes") 1919 @GraphQLNonNull 1920 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1921 static CountingPaginatedData<WorkflowDestinationPartyTypeObject> workflowDestinationPartyTypes(final DataFetchingEnvironment env, 1922 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1923 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1924 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName) { 1925 CountingPaginatedData<WorkflowDestinationPartyTypeObject> data; 1926 1927 try { 1928 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationPartyTypesForm(); 1929 var command = CDI.current().select(GetWorkflowDestinationPartyTypesCommand.class).get(); 1930 1931 commandForm.setWorkflowName(workflowName); 1932 commandForm.setWorkflowStepName(workflowStepName); 1933 commandForm.setWorkflowDestinationName(workflowDestinationName); 1934 1935 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1936 if(totalEntities == null) { 1937 data = Connections.emptyConnection(); 1938 } else { 1939 try(var objectLimiter = new ObjectLimiter(env, WorkflowDestinationPartyTypeConstants.COMPONENT_VENDOR_NAME, WorkflowDestinationPartyTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 1940 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1941 1942 var workflowDestinationPartyTypes = entities.stream() 1943 .map(WorkflowDestinationPartyTypeObject::new) 1944 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1945 1946 data = new CountedObjects<>(objectLimiter, workflowDestinationPartyTypes); 1947 } 1948 } 1949 } catch (NamingException ex) { 1950 throw new RuntimeException(ex); 1951 } 1952 1953 return data; 1954 } 1955 1956 @GraphQLField 1957 @GraphQLName("workflowDestinationSecurityRole") 1958 static WorkflowDestinationSecurityRoleObject workflowDestinationSecurityRole(final DataFetchingEnvironment env, 1959 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1960 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1961 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName, 1962 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName, 1963 @GraphQLName("securityRoleName") @GraphQLNonNull final String securityRoleName) { 1964 WorkflowDestinationSecurityRole workflowDestinationSecurityRole; 1965 1966 try { 1967 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationSecurityRoleForm(); 1968 1969 commandForm.setWorkflowName(workflowName); 1970 commandForm.setWorkflowStepName(workflowStepName); 1971 commandForm.setWorkflowDestinationName(workflowDestinationName); 1972 commandForm.setPartyTypeName(partyTypeName); 1973 commandForm.setSecurityRoleName(securityRoleName); 1974 1975 workflowDestinationSecurityRole = CDI.current().select(GetWorkflowDestinationSecurityRoleCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1976 } catch (NamingException ex) { 1977 throw new RuntimeException(ex); 1978 } 1979 1980 return workflowDestinationSecurityRole == null ? null : new WorkflowDestinationSecurityRoleObject(workflowDestinationSecurityRole); 1981 } 1982 1983 @GraphQLField 1984 @GraphQLName("workflowDestinationSecurityRoles") 1985 @GraphQLNonNull 1986 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1987 static CountingPaginatedData<WorkflowDestinationSecurityRoleObject> workflowDestinationSecurityRoles(final DataFetchingEnvironment env, 1988 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1989 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1990 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName, 1991 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName) { 1992 CountingPaginatedData<WorkflowDestinationSecurityRoleObject> data; 1993 1994 try { 1995 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationSecurityRolesForm(); 1996 var command = CDI.current().select(GetWorkflowDestinationSecurityRolesCommand.class).get(); 1997 1998 commandForm.setWorkflowName(workflowName); 1999 commandForm.setWorkflowStepName(workflowStepName); 2000 commandForm.setWorkflowDestinationName(workflowDestinationName); 2001 commandForm.setPartyTypeName(partyTypeName); 2002 2003 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2004 if(totalEntities == null) { 2005 data = Connections.emptyConnection(); 2006 } else { 2007 try(var objectLimiter = new ObjectLimiter(env, WorkflowDestinationSecurityRoleConstants.COMPONENT_VENDOR_NAME, WorkflowDestinationSecurityRoleConstants.ENTITY_TYPE_NAME, totalEntities)) { 2008 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2009 2010 var workflowDestinationSecurityRoles = entities.stream() 2011 .map(WorkflowDestinationSecurityRoleObject::new) 2012 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2013 2014 data = new CountedObjects<>(objectLimiter, workflowDestinationSecurityRoles); 2015 } 2016 } 2017 } catch (NamingException ex) { 2018 throw new RuntimeException(ex); 2019 } 2020 2021 return data; 2022 } 2023 2024 @GraphQLField 2025 @GraphQLName("workflowDestinationSelector") 2026 static WorkflowDestinationSelectorObject workflowDestinationSelector(final DataFetchingEnvironment env, 2027 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2028 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 2029 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName, 2030 @GraphQLName("selectorName") @GraphQLNonNull final String selectorName) { 2031 WorkflowDestinationSelector workflowDestinationSelector; 2032 2033 try { 2034 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationSelectorForm(); 2035 2036 commandForm.setWorkflowName(workflowName); 2037 commandForm.setWorkflowStepName(workflowStepName); 2038 commandForm.setWorkflowDestinationName(workflowDestinationName); 2039 commandForm.setSelectorName(selectorName); 2040 2041 workflowDestinationSelector = CDI.current().select(GetWorkflowDestinationSelectorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2042 } catch (NamingException ex) { 2043 throw new RuntimeException(ex); 2044 } 2045 2046 return workflowDestinationSelector == null ? null : new WorkflowDestinationSelectorObject(workflowDestinationSelector); 2047 } 2048 2049 @GraphQLField 2050 @GraphQLName("workflowDestinationSelectors") 2051 @GraphQLNonNull 2052 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2053 static CountingPaginatedData<WorkflowDestinationSelectorObject> workflowDestinationSelectors(final DataFetchingEnvironment env, 2054 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2055 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 2056 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName) { 2057 CountingPaginatedData<WorkflowDestinationSelectorObject> data; 2058 2059 try { 2060 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationSelectorsForm(); 2061 var command = CDI.current().select(GetWorkflowDestinationSelectorsCommand.class).get(); 2062 2063 commandForm.setWorkflowName(workflowName); 2064 commandForm.setWorkflowStepName(workflowStepName); 2065 commandForm.setWorkflowDestinationName(workflowDestinationName); 2066 2067 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2068 if(totalEntities == null) { 2069 data = Connections.emptyConnection(); 2070 } else { 2071 try(var objectLimiter = new ObjectLimiter(env, WorkflowDestinationSelectorConstants.COMPONENT_VENDOR_NAME, WorkflowDestinationSelectorConstants.ENTITY_TYPE_NAME, totalEntities)) { 2072 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2073 2074 var workflowDestinationSelectors = entities.stream() 2075 .map(WorkflowDestinationSelectorObject::new) 2076 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2077 2078 data = new CountedObjects<>(objectLimiter, workflowDestinationSelectors); 2079 } 2080 } 2081 } catch (NamingException ex) { 2082 throw new RuntimeException(ex); 2083 } 2084 2085 return data; 2086 } 2087 2088 @GraphQLField 2089 @GraphQLName("workflowEntrance") 2090 static WorkflowEntranceObject workflowEntrance(final DataFetchingEnvironment env, 2091 @GraphQLName("workflowName") final String workflowName, 2092 @GraphQLName("workflowEntranceName") final String workflowEntranceName, 2093 @GraphQLName("id") @GraphQLID final String id) { 2094 WorkflowEntrance workflowEntrance; 2095 2096 try { 2097 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceForm(); 2098 2099 commandForm.setWorkflowName(workflowName); 2100 commandForm.setWorkflowEntranceName(workflowEntranceName); 2101 commandForm.setUuid(id); 2102 2103 workflowEntrance = CDI.current().select(GetWorkflowEntranceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2104 } catch (NamingException ex) { 2105 throw new RuntimeException(ex); 2106 } 2107 2108 return workflowEntrance == null ? null : new WorkflowEntranceObject(workflowEntrance); 2109 } 2110 2111 @GraphQLField 2112 @GraphQLName("workflowEntrances") 2113 @GraphQLNonNull 2114 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2115 static CountingPaginatedData<WorkflowEntranceObject> workflowEntrances(final DataFetchingEnvironment env, 2116 @GraphQLName("workflowName") final String workflowName) { 2117 CountingPaginatedData<WorkflowEntranceObject> data; 2118 2119 try { 2120 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntrancesForm(); 2121 var command = CDI.current().select(GetWorkflowEntrancesCommand.class).get(); 2122 2123 commandForm.setWorkflowName(workflowName); 2124 2125 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2126 if(totalEntities == null) { 2127 data = Connections.emptyConnection(); 2128 } else { 2129 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntranceConstants.COMPONENT_VENDOR_NAME, WorkflowEntranceConstants.ENTITY_TYPE_NAME, totalEntities)) { 2130 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2131 2132 var workflowEntrances = entities.stream() 2133 .map(WorkflowEntranceObject::new) 2134 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2135 2136 data = new CountedObjects<>(objectLimiter, workflowEntrances); 2137 } 2138 } 2139 } catch (NamingException ex) { 2140 throw new RuntimeException(ex); 2141 } 2142 2143 return data; 2144 } 2145 2146 @GraphQLField 2147 @GraphQLName("workflowEntranceStep") 2148 static WorkflowEntranceStepObject workflowEntranceStep(final DataFetchingEnvironment env, 2149 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2150 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName, 2151 @GraphQLName("entranceWorkflowName") @GraphQLNonNull final String entranceWorkflowName, 2152 @GraphQLName("entranceWorkflowStepName") @GraphQLNonNull final String entranceWorkflowStepName) { 2153 WorkflowEntranceStep workflowEntranceStep; 2154 2155 try { 2156 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceStepForm(); 2157 2158 commandForm.setWorkflowName(workflowName); 2159 commandForm.setWorkflowEntranceName(workflowEntranceName); 2160 commandForm.setEntranceWorkflowName(entranceWorkflowName); 2161 commandForm.setEntranceWorkflowStepName(entranceWorkflowStepName); 2162 2163 workflowEntranceStep = CDI.current().select(GetWorkflowEntranceStepCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2164 } catch (NamingException ex) { 2165 throw new RuntimeException(ex); 2166 } 2167 2168 return workflowEntranceStep == null ? null : new WorkflowEntranceStepObject(workflowEntranceStep); 2169 } 2170 2171 @GraphQLField 2172 @GraphQLName("workflowEntranceSteps") 2173 @GraphQLNonNull 2174 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2175 static CountingPaginatedData<WorkflowEntranceStepObject> workflowEntranceSteps(final DataFetchingEnvironment env, 2176 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2177 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName) { 2178 CountingPaginatedData<WorkflowEntranceStepObject> data; 2179 2180 try { 2181 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceStepsForm(); 2182 var command = CDI.current().select(GetWorkflowEntranceStepsCommand.class).get(); 2183 2184 commandForm.setWorkflowName(workflowName); 2185 commandForm.setWorkflowEntranceName(workflowEntranceName); 2186 2187 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2188 if(totalEntities == null) { 2189 data = Connections.emptyConnection(); 2190 } else { 2191 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntranceStepConstants.COMPONENT_VENDOR_NAME, WorkflowEntranceStepConstants.ENTITY_TYPE_NAME, totalEntities)) { 2192 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2193 2194 var workflowEntranceSteps = entities.stream() 2195 .map(WorkflowEntranceStepObject::new) 2196 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2197 2198 data = new CountedObjects<>(objectLimiter, workflowEntranceSteps); 2199 } 2200 } 2201 } catch (NamingException ex) { 2202 throw new RuntimeException(ex); 2203 } 2204 2205 return data; 2206 } 2207 2208 @GraphQLField 2209 @GraphQLName("workflowEntrancePartyType") 2210 static WorkflowEntrancePartyTypeObject workflowEntrancePartyType(final DataFetchingEnvironment env, 2211 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2212 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName, 2213 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName) { 2214 WorkflowEntrancePartyType workflowEntrancePartyType; 2215 2216 try { 2217 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntrancePartyTypeForm(); 2218 2219 commandForm.setWorkflowName(workflowName); 2220 commandForm.setWorkflowEntranceName(workflowEntranceName); 2221 commandForm.setPartyTypeName(partyTypeName); 2222 2223 workflowEntrancePartyType = CDI.current().select(GetWorkflowEntrancePartyTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2224 } catch (NamingException ex) { 2225 throw new RuntimeException(ex); 2226 } 2227 2228 return workflowEntrancePartyType == null ? null : new WorkflowEntrancePartyTypeObject(workflowEntrancePartyType); 2229 } 2230 2231 @GraphQLField 2232 @GraphQLName("workflowEntrancePartyTypes") 2233 @GraphQLNonNull 2234 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2235 static CountingPaginatedData<WorkflowEntrancePartyTypeObject> workflowEntrancePartyTypes(final DataFetchingEnvironment env, 2236 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2237 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName) { 2238 CountingPaginatedData<WorkflowEntrancePartyTypeObject> data; 2239 2240 try { 2241 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntrancePartyTypesForm(); 2242 var command = CDI.current().select(GetWorkflowEntrancePartyTypesCommand.class).get(); 2243 2244 commandForm.setWorkflowName(workflowName); 2245 commandForm.setWorkflowEntranceName(workflowEntranceName); 2246 2247 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2248 if(totalEntities == null) { 2249 data = Connections.emptyConnection(); 2250 } else { 2251 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntrancePartyTypeConstants.COMPONENT_VENDOR_NAME, WorkflowEntrancePartyTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2252 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2253 2254 var workflowEntrancePartyTypes = entities.stream() 2255 .map(WorkflowEntrancePartyTypeObject::new) 2256 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2257 2258 data = new CountedObjects<>(objectLimiter, workflowEntrancePartyTypes); 2259 } 2260 } 2261 } catch (NamingException ex) { 2262 throw new RuntimeException(ex); 2263 } 2264 2265 return data; 2266 } 2267 2268 @GraphQLField 2269 @GraphQLName("workflowEntranceSecurityRole") 2270 static WorkflowEntranceSecurityRoleObject workflowEntranceSecurityRole(final DataFetchingEnvironment env, 2271 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2272 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName, 2273 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName, 2274 @GraphQLName("securityRoleName") @GraphQLNonNull final String securityRoleName) { 2275 WorkflowEntranceSecurityRole workflowEntranceSecurityRole; 2276 2277 try { 2278 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceSecurityRoleForm(); 2279 2280 commandForm.setWorkflowName(workflowName); 2281 commandForm.setWorkflowEntranceName(workflowEntranceName); 2282 commandForm.setPartyTypeName(partyTypeName); 2283 commandForm.setSecurityRoleName(securityRoleName); 2284 2285 workflowEntranceSecurityRole = CDI.current().select(GetWorkflowEntranceSecurityRoleCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2286 } catch (NamingException ex) { 2287 throw new RuntimeException(ex); 2288 } 2289 2290 return workflowEntranceSecurityRole == null ? null : new WorkflowEntranceSecurityRoleObject(workflowEntranceSecurityRole); 2291 } 2292 2293 @GraphQLField 2294 @GraphQLName("workflowEntranceSecurityRoles") 2295 @GraphQLNonNull 2296 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2297 static CountingPaginatedData<WorkflowEntranceSecurityRoleObject> workflowEntranceSecurityRoles(final DataFetchingEnvironment env, 2298 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2299 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName, 2300 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName) { 2301 CountingPaginatedData<WorkflowEntranceSecurityRoleObject> data; 2302 2303 try { 2304 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceSecurityRolesForm(); 2305 var command = CDI.current().select(GetWorkflowEntranceSecurityRolesCommand.class).get(); 2306 2307 commandForm.setWorkflowName(workflowName); 2308 commandForm.setWorkflowEntranceName(workflowEntranceName); 2309 commandForm.setPartyTypeName(partyTypeName); 2310 2311 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2312 if(totalEntities == null) { 2313 data = Connections.emptyConnection(); 2314 } else { 2315 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntranceSecurityRoleConstants.COMPONENT_VENDOR_NAME, WorkflowEntranceSecurityRoleConstants.ENTITY_TYPE_NAME, totalEntities)) { 2316 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2317 2318 var workflowEntranceSecurityRoles = entities.stream() 2319 .map(WorkflowEntranceSecurityRoleObject::new) 2320 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2321 2322 data = new CountedObjects<>(objectLimiter, workflowEntranceSecurityRoles); 2323 } 2324 } 2325 } catch (NamingException ex) { 2326 throw new RuntimeException(ex); 2327 } 2328 2329 return data; 2330 } 2331 2332 @GraphQLField 2333 @GraphQLName("workflowEntranceSelector") 2334 static WorkflowEntranceSelectorObject workflowEntranceSelector(final DataFetchingEnvironment env, 2335 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2336 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName, 2337 @GraphQLName("selectorName") @GraphQLNonNull final String selectorName) { 2338 WorkflowEntranceSelector workflowEntranceSelector; 2339 2340 try { 2341 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceSelectorForm(); 2342 2343 commandForm.setWorkflowName(workflowName); 2344 commandForm.setWorkflowEntranceName(workflowEntranceName); 2345 commandForm.setSelectorName(selectorName); 2346 2347 workflowEntranceSelector = CDI.current().select(GetWorkflowEntranceSelectorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2348 } catch (NamingException ex) { 2349 throw new RuntimeException(ex); 2350 } 2351 2352 return workflowEntranceSelector == null ? null : new WorkflowEntranceSelectorObject(workflowEntranceSelector); 2353 } 2354 2355 @GraphQLField 2356 @GraphQLName("workflowEntranceSelectors") 2357 @GraphQLNonNull 2358 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2359 static CountingPaginatedData<WorkflowEntranceSelectorObject> workflowEntranceSelectors(final DataFetchingEnvironment env, 2360 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2361 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName) { 2362 CountingPaginatedData<WorkflowEntranceSelectorObject> data; 2363 2364 try { 2365 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceSelectorsForm(); 2366 var command = CDI.current().select(GetWorkflowEntranceSelectorsCommand.class).get(); 2367 2368 commandForm.setWorkflowName(workflowName); 2369 commandForm.setWorkflowEntranceName(workflowEntranceName); 2370 2371 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2372 if(totalEntities == null) { 2373 data = Connections.emptyConnection(); 2374 } else { 2375 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntranceSelectorConstants.COMPONENT_VENDOR_NAME, WorkflowEntranceSelectorConstants.ENTITY_TYPE_NAME, totalEntities)) { 2376 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2377 2378 var workflowEntranceSelectors = entities.stream() 2379 .map(WorkflowEntranceSelectorObject::new) 2380 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2381 2382 data = new CountedObjects<>(objectLimiter, workflowEntranceSelectors); 2383 } 2384 } 2385 } catch (NamingException ex) { 2386 throw new RuntimeException(ex); 2387 } 2388 2389 return data; 2390 } 2391 2392 @GraphQLField 2393 @GraphQLName("workflowStepType") 2394 static WorkflowStepTypeObject workflowStepType(final DataFetchingEnvironment env, 2395 @GraphQLName("workflowStepTypeName") final String workflowStepTypeName, 2396 @GraphQLName("id") @GraphQLID final String id) { 2397 WorkflowStepType workflowStepType; 2398 2399 try { 2400 var commandForm = WorkflowUtil.getHome().getGetWorkflowStepTypeForm(); 2401 2402 commandForm.setWorkflowStepTypeName(workflowStepTypeName); 2403 commandForm.setUuid(id); 2404 2405 workflowStepType = CDI.current().select(GetWorkflowStepTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2406 } catch (NamingException ex) { 2407 throw new RuntimeException(ex); 2408 } 2409 2410 return workflowStepType == null ? null : new WorkflowStepTypeObject(workflowStepType); 2411 } 2412 2413 @GraphQLField 2414 @GraphQLName("workflowStepTypes") 2415 @GraphQLNonNull 2416 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2417 static CountingPaginatedData<WorkflowStepTypeObject> workflowStepTypes(final DataFetchingEnvironment env) { 2418 CountingPaginatedData<WorkflowStepTypeObject> data; 2419 2420 try { 2421 var commandForm = WorkflowUtil.getHome().getGetWorkflowStepTypesForm(); 2422 var command = CDI.current().select(GetWorkflowStepTypesCommand.class).get(); 2423 2424 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2425 if(totalEntities == null) { 2426 data = Connections.emptyConnection(); 2427 } else { 2428 try(var objectLimiter = new ObjectLimiter(env, WorkflowStepTypeConstants.COMPONENT_VENDOR_NAME, WorkflowStepTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2429 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2430 2431 var workflowStepTypes = entities.stream() 2432 .map(WorkflowStepTypeObject::new) 2433 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2434 2435 data = new CountedObjects<>(objectLimiter, workflowStepTypes); 2436 } 2437 } 2438 } catch (NamingException ex) { 2439 throw new RuntimeException(ex); 2440 } 2441 2442 return data; 2443 } 2444 2445 @GraphQLField 2446 @GraphQLName("sequence") 2447 static SequenceObject sequence(final DataFetchingEnvironment env, 2448 @GraphQLName("sequenceTypeName") final String sequenceTypeName, 2449 @GraphQLName("sequenceName") final String sequenceName, 2450 @GraphQLName("id") @GraphQLID final String id) { 2451 Sequence sequence; 2452 2453 try { 2454 var commandForm = SequenceUtil.getHome().getGetSequenceForm(); 2455 2456 commandForm.setSequenceTypeName(sequenceTypeName); 2457 commandForm.setSequenceName(sequenceName); 2458 commandForm.setUuid(id); 2459 2460 sequence = CDI.current().select(GetSequenceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2461 } catch (NamingException ex) { 2462 throw new RuntimeException(ex); 2463 } 2464 2465 return sequence == null ? null : new SequenceObject(sequence); 2466 } 2467 2468 @GraphQLField 2469 @GraphQLName("sequenceValue") 2470 static GetSequenceValueResultObject sequenceValue(final DataFetchingEnvironment env, 2471 @GraphQLName("sequenceTypeName") final String sequenceTypeName, 2472 @GraphQLName("sequenceName") final String sequenceName, 2473 @GraphQLName("id") @GraphQLID final String id) { 2474 GetSequenceValueResultObject result = null; 2475 2476 try { 2477 var commandForm = SequenceUtil.getHome().getGetSequenceValueForm(); 2478 2479 commandForm.setSequenceTypeName(sequenceTypeName); 2480 commandForm.setSequenceName(sequenceName); 2481 commandForm.setUuid(id); 2482 2483 var commandResult = SequenceUtil.getHome().getSequenceValue(BaseGraphQl.getUserVisitPK(env), commandForm); 2484 2485 if(!commandResult.hasErrors()) { 2486 result = new GetSequenceValueResultObject((GetSequenceValueResult)commandResult.getExecutionResult().getResult()); 2487 } 2488 } catch (NamingException ex) { 2489 throw new RuntimeException(ex); 2490 } 2491 2492 return result; 2493 } 2494 2495 @GraphQLField 2496 @GraphQLName("sequences") 2497 @GraphQLNonNull 2498 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2499 static CountingPaginatedData<SequenceObject> sequences(final DataFetchingEnvironment env, 2500 @GraphQLName("sequenceTypeName") @GraphQLNonNull final String sequenceTypeName) { 2501 CountingPaginatedData<SequenceObject> data; 2502 2503 try { 2504 var commandForm = SequenceUtil.getHome().getGetSequencesForm(); 2505 var command = CDI.current().select(GetSequencesCommand.class).get(); 2506 2507 commandForm.setSequenceTypeName(sequenceTypeName); 2508 2509 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2510 if(totalEntities == null) { 2511 data = Connections.emptyConnection(); 2512 } else { 2513 try(var objectLimiter = new ObjectLimiter(env, SequenceConstants.COMPONENT_VENDOR_NAME, SequenceConstants.ENTITY_TYPE_NAME, totalEntities)) { 2514 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2515 2516 var sequences = entities.stream() 2517 .map(SequenceObject::new) 2518 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2519 2520 data = new CountedObjects<>(objectLimiter, sequences); 2521 } 2522 } 2523 } catch (NamingException ex) { 2524 throw new RuntimeException(ex); 2525 } 2526 2527 return data; 2528 } 2529 2530 @GraphQLField 2531 @GraphQLName("sequenceType") 2532 static SequenceTypeObject sequenceType(final DataFetchingEnvironment env, 2533 @GraphQLName("sequenceTypeName") final String sequenceTypeName, 2534 @GraphQLName("id") @GraphQLID final String id) { 2535 SequenceType sequenceType; 2536 2537 try { 2538 var commandForm = SequenceUtil.getHome().getGetSequenceTypeForm(); 2539 2540 commandForm.setSequenceTypeName(sequenceTypeName); 2541 commandForm.setUuid(id); 2542 2543 sequenceType = CDI.current().select(GetSequenceTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2544 } catch (NamingException ex) { 2545 throw new RuntimeException(ex); 2546 } 2547 2548 return sequenceType == null ? null : new SequenceTypeObject(sequenceType); 2549 } 2550 2551 @GraphQLField 2552 @GraphQLName("sequenceTypes") 2553 @GraphQLNonNull 2554 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2555 static CountingPaginatedData<SequenceTypeObject> sequenceTypes(final DataFetchingEnvironment env) { 2556 CountingPaginatedData<SequenceTypeObject> data; 2557 2558 try { 2559 var commandForm = SequenceUtil.getHome().getGetSequenceTypesForm(); 2560 var command = CDI.current().select(GetSequenceTypesCommand.class).get(); 2561 2562 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2563 if(totalEntities == null) { 2564 data = Connections.emptyConnection(); 2565 } else { 2566 try(var objectLimiter = new ObjectLimiter(env, SequenceTypeConstants.COMPONENT_VENDOR_NAME, SequenceTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2567 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2568 2569 var sequenceTypes = entities.stream() 2570 .map(SequenceTypeObject::new) 2571 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2572 2573 data = new CountedObjects<>(objectLimiter, sequenceTypes); 2574 } 2575 } 2576 } catch (NamingException ex) { 2577 throw new RuntimeException(ex); 2578 } 2579 2580 return data; 2581 } 2582 2583 @GraphQLField 2584 @GraphQLName("sequenceChecksumType") 2585 static SequenceChecksumTypeObject sequenceChecksumType(final DataFetchingEnvironment env, 2586 @GraphQLName("sequenceChecksumTypeName") @GraphQLNonNull final String sequenceChecksumTypeName) { 2587 SequenceChecksumType sequenceChecksumType; 2588 2589 try { 2590 var commandForm = SequenceUtil.getHome().getGetSequenceChecksumTypeForm(); 2591 2592 commandForm.setSequenceChecksumTypeName(sequenceChecksumTypeName); 2593 2594 sequenceChecksumType = CDI.current().select(GetSequenceChecksumTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2595 } catch (NamingException ex) { 2596 throw new RuntimeException(ex); 2597 } 2598 2599 return sequenceChecksumType == null ? null : new SequenceChecksumTypeObject(sequenceChecksumType); 2600 } 2601 2602 @GraphQLField 2603 @GraphQLName("sequenceChecksumTypes") 2604 @GraphQLNonNull 2605 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2606 static CountingPaginatedData<SequenceChecksumTypeObject> sequenceChecksumTypes(final DataFetchingEnvironment env) { 2607 CountingPaginatedData<SequenceChecksumTypeObject> data; 2608 2609 try { 2610 var commandForm = SequenceUtil.getHome().getGetSequenceChecksumTypesForm(); 2611 var command = CDI.current().select(GetSequenceChecksumTypesCommand.class).get(); 2612 2613 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2614 if(totalEntities == null) { 2615 data = Connections.emptyConnection(); 2616 } else { 2617 try(var objectLimiter = new ObjectLimiter(env, SequenceChecksumTypeConstants.COMPONENT_VENDOR_NAME, SequenceChecksumTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2618 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2619 2620 var sequenceChecksumTypes = entities.stream() 2621 .map(SequenceChecksumTypeObject::new) 2622 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2623 2624 data = new CountedObjects<>(objectLimiter, sequenceChecksumTypes); 2625 } 2626 } 2627 } catch (NamingException ex) { 2628 throw new RuntimeException(ex); 2629 } 2630 2631 return data; 2632 } 2633 2634 @GraphQLField 2635 @GraphQLName("sequenceEncoderType") 2636 static SequenceEncoderTypeObject sequenceEncoderType(final DataFetchingEnvironment env, 2637 @GraphQLName("sequenceEncoderTypeName") @GraphQLNonNull final String sequenceEncoderTypeName) { 2638 SequenceEncoderType sequenceEncoderType; 2639 2640 try { 2641 var commandForm = SequenceUtil.getHome().getGetSequenceEncoderTypeForm(); 2642 2643 commandForm.setSequenceEncoderTypeName(sequenceEncoderTypeName); 2644 2645 sequenceEncoderType = CDI.current().select(GetSequenceEncoderTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2646 } catch (NamingException ex) { 2647 throw new RuntimeException(ex); 2648 } 2649 2650 return sequenceEncoderType == null ? null : new SequenceEncoderTypeObject(sequenceEncoderType); 2651 } 2652 2653 @GraphQLField 2654 @GraphQLName("sequenceEncoderTypes") 2655 @GraphQLNonNull 2656 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2657 static CountingPaginatedData<SequenceEncoderTypeObject> sequenceEncoderTypes(final DataFetchingEnvironment env) { 2658 CountingPaginatedData<SequenceEncoderTypeObject> data; 2659 2660 try { 2661 var commandForm = SequenceUtil.getHome().getGetSequenceEncoderTypesForm(); 2662 var command = CDI.current().select(GetSequenceEncoderTypesCommand.class).get(); 2663 2664 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2665 if(totalEntities == null) { 2666 data = Connections.emptyConnection(); 2667 } else { 2668 try(var objectLimiter = new ObjectLimiter(env, SequenceEncoderTypeConstants.COMPONENT_VENDOR_NAME, SequenceEncoderTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2669 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2670 2671 var sequenceEncoderTypes = entities.stream() 2672 .map(SequenceEncoderTypeObject::new) 2673 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2674 2675 data = new CountedObjects<>(objectLimiter, sequenceEncoderTypes); 2676 } 2677 } 2678 } catch (NamingException ex) { 2679 throw new RuntimeException(ex); 2680 } 2681 2682 return data; 2683 } 2684 2685 @GraphQLField 2686 @GraphQLName("selectorKind") 2687 static SelectorKindObject selectorKind(final DataFetchingEnvironment env, 2688 @GraphQLName("selectorKindName") final String selectorKindName, 2689 @GraphQLName("id") @GraphQLID final String id) { 2690 SelectorKind selectorKind; 2691 2692 try { 2693 var commandForm = SelectorUtil.getHome().getGetSelectorKindForm(); 2694 2695 commandForm.setSelectorKindName(selectorKindName); 2696 commandForm.setUuid(id); 2697 2698 selectorKind = CDI.current().select(GetSelectorKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2699 } catch (NamingException ex) { 2700 throw new RuntimeException(ex); 2701 } 2702 2703 return selectorKind == null ? null : new SelectorKindObject(selectorKind); 2704 } 2705 2706 @GraphQLField 2707 @GraphQLName("selectorKinds") 2708 @GraphQLNonNull 2709 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2710 static CountingPaginatedData<SelectorKindObject> selectorKinds(final DataFetchingEnvironment env) { 2711 CountingPaginatedData<SelectorKindObject> data; 2712 2713 try { 2714 var commandForm = SelectorUtil.getHome().getGetSelectorKindsForm(); 2715 var command = CDI.current().select(GetSelectorKindsCommand.class).get(); 2716 2717 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2718 if(totalEntities == null) { 2719 data = Connections.emptyConnection(); 2720 } else { 2721 try(var objectLimiter = new ObjectLimiter(env, SelectorKindConstants.COMPONENT_VENDOR_NAME, SelectorKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 2722 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2723 2724 var selectorKinds = entities.stream() 2725 .map(SelectorKindObject::new) 2726 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2727 2728 data = new CountedObjects<>(objectLimiter, selectorKinds); 2729 } 2730 } 2731 } catch (NamingException ex) { 2732 throw new RuntimeException(ex); 2733 } 2734 2735 return data; 2736 } 2737 2738 @GraphQLField 2739 @GraphQLName("selectorType") 2740 static SelectorTypeObject selectorType(final DataFetchingEnvironment env, 2741 @GraphQLName("selectorKindName") final String selectorKindName, 2742 @GraphQLName("selectorTypeName") final String selectorTypeName, 2743 @GraphQLName("id") @GraphQLID final String id) { 2744 SelectorType selectorType; 2745 2746 try { 2747 var commandForm = SelectorUtil.getHome().getGetSelectorTypeForm(); 2748 2749 commandForm.setSelectorKindName(selectorKindName); 2750 commandForm.setSelectorTypeName(selectorTypeName); 2751 commandForm.setUuid(id); 2752 2753 selectorType = CDI.current().select(GetSelectorTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2754 } catch (NamingException ex) { 2755 throw new RuntimeException(ex); 2756 } 2757 2758 return selectorType == null ? null : new SelectorTypeObject(selectorType); 2759 } 2760 2761 @GraphQLField 2762 @GraphQLName("selectorTypes") 2763 @GraphQLNonNull 2764 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2765 static CountingPaginatedData<SelectorTypeObject> selectorTypes(final DataFetchingEnvironment env, 2766 @GraphQLName("selectorKindName") @GraphQLNonNull final String selectorKindName) { 2767 CountingPaginatedData<SelectorTypeObject> data; 2768 2769 try { 2770 var commandForm = SelectorUtil.getHome().getGetSelectorTypesForm(); 2771 var command = CDI.current().select(GetSelectorTypesCommand.class).get(); 2772 2773 commandForm.setSelectorKindName(selectorKindName); 2774 2775 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2776 if(totalEntities == null) { 2777 data = Connections.emptyConnection(); 2778 } else { 2779 try(var objectLimiter = new ObjectLimiter(env, SelectorTypeConstants.COMPONENT_VENDOR_NAME, SelectorTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2780 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2781 2782 var selectorTypes = entities.stream() 2783 .map(SelectorTypeObject::new) 2784 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2785 2786 data = new CountedObjects<>(objectLimiter, selectorTypes); 2787 } 2788 } 2789 } catch (NamingException ex) { 2790 throw new RuntimeException(ex); 2791 } 2792 2793 return data; 2794 } 2795 2796 @GraphQLField 2797 @GraphQLName("selector") 2798 static SelectorObject selector(final DataFetchingEnvironment env, 2799 @GraphQLName("selectorKindName") final String selectorKindName, 2800 @GraphQLName("selectorTypeName") final String selectorTypeName, 2801 @GraphQLName("selectorName") final String selectorName, 2802 @GraphQLName("id") @GraphQLID final String id) { 2803 Selector selector; 2804 2805 try { 2806 var commandForm = SelectorUtil.getHome().getGetSelectorForm(); 2807 2808 commandForm.setSelectorKindName(selectorKindName); 2809 commandForm.setSelectorTypeName(selectorTypeName); 2810 commandForm.setSelectorName(selectorName); 2811 commandForm.setUuid(id); 2812 2813 selector = CDI.current().select(GetSelectorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2814 } catch (NamingException ex) { 2815 throw new RuntimeException(ex); 2816 } 2817 2818 return selector == null ? null : new SelectorObject(selector); 2819 } 2820 2821 @GraphQLField 2822 @GraphQLName("selectors") 2823 static Collection<SelectorObject> selectors(final DataFetchingEnvironment env, 2824 @GraphQLName("selectorKindName") @GraphQLNonNull final String selectorKindName, 2825 @GraphQLName("selectorTypeName") @GraphQLNonNull final String selectorTypeName) { 2826 Collection<Selector> selectors; 2827 Collection<SelectorObject> selectorObjects; 2828 2829 try { 2830 var commandForm = SelectorUtil.getHome().getGetSelectorsForm(); 2831 2832 commandForm.setSelectorKindName(selectorKindName); 2833 commandForm.setSelectorTypeName(selectorTypeName); 2834 2835 selectors = CDI.current().select(GetSelectorsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2836 } catch (NamingException ex) { 2837 throw new RuntimeException(ex); 2838 } 2839 2840 if(selectors == null) { 2841 selectorObjects = emptyList(); 2842 } else { 2843 selectorObjects = new ArrayList<>(selectors.size()); 2844 2845 selectors.stream() 2846 .map(SelectorObject::new) 2847 .forEachOrdered(selectorObjects::add); 2848 } 2849 2850 return selectorObjects; 2851 } 2852 2853 @GraphQLField 2854 @GraphQLName("filterKind") 2855 static FilterKindObject filterKind(final DataFetchingEnvironment env, 2856 @GraphQLName("filterKindName") final String filterKindName, 2857 @GraphQLName("id") @GraphQLID final String id) { 2858 FilterKind filterKind; 2859 2860 try { 2861 var commandForm = FilterUtil.getHome().getGetFilterKindForm(); 2862 2863 commandForm.setFilterKindName(filterKindName); 2864 commandForm.setUuid(id); 2865 2866 filterKind = CDI.current().select(GetFilterKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2867 } catch (NamingException ex) { 2868 throw new RuntimeException(ex); 2869 } 2870 2871 return filterKind == null ? null : new FilterKindObject(filterKind); 2872 } 2873 2874 @GraphQLField 2875 @GraphQLName("filterKinds") 2876 @GraphQLNonNull 2877 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2878 static CountingPaginatedData<FilterKindObject> filterKinds(final DataFetchingEnvironment env) { 2879 CountingPaginatedData<FilterKindObject> data; 2880 2881 try { 2882 var commandForm = FilterUtil.getHome().getGetFilterKindsForm(); 2883 var command = CDI.current().select(GetFilterKindsCommand.class).get(); 2884 2885 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2886 if(totalEntities == null) { 2887 data = Connections.emptyConnection(); 2888 } else { 2889 try(var objectLimiter = new ObjectLimiter(env, FilterKindConstants.COMPONENT_VENDOR_NAME, FilterKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 2890 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2891 2892 var filterKinds = entities.stream() 2893 .map(FilterKindObject::new) 2894 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2895 2896 data = new CountedObjects<>(objectLimiter, filterKinds); 2897 } 2898 } 2899 } catch (NamingException ex) { 2900 throw new RuntimeException(ex); 2901 } 2902 2903 return data; 2904 } 2905 2906 @GraphQLField 2907 @GraphQLName("filterType") 2908 static FilterTypeObject filterType(final DataFetchingEnvironment env, 2909 @GraphQLName("filterKindName") final String filterKindName, 2910 @GraphQLName("filterTypeName") final String filterTypeName, 2911 @GraphQLName("id") @GraphQLID final String id) { 2912 FilterType filterType; 2913 2914 try { 2915 var commandForm = FilterUtil.getHome().getGetFilterTypeForm(); 2916 2917 commandForm.setFilterKindName(filterKindName); 2918 commandForm.setFilterTypeName(filterTypeName); 2919 commandForm.setUuid(id); 2920 2921 filterType = CDI.current().select(GetFilterTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2922 } catch (NamingException ex) { 2923 throw new RuntimeException(ex); 2924 } 2925 2926 return filterType == null ? null : new FilterTypeObject(filterType); 2927 } 2928 2929 @GraphQLField 2930 @GraphQLName("filterTypes") 2931 @GraphQLNonNull 2932 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2933 static CountingPaginatedData<FilterTypeObject> filterTypes(final DataFetchingEnvironment env, 2934 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName) { 2935 CountingPaginatedData<FilterTypeObject> data; 2936 2937 try { 2938 var commandForm = FilterUtil.getHome().getGetFilterTypesForm(); 2939 var command = CDI.current().select(GetFilterTypesCommand.class).get(); 2940 2941 commandForm.setFilterKindName(filterKindName); 2942 2943 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2944 if(totalEntities == null) { 2945 data = Connections.emptyConnection(); 2946 } else { 2947 try(var objectLimiter = new ObjectLimiter(env, FilterTypeConstants.COMPONENT_VENDOR_NAME, FilterTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2948 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2949 2950 var filterTypes = entities.stream() 2951 .map(FilterTypeObject::new) 2952 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2953 2954 data = new CountedObjects<>(objectLimiter, filterTypes); 2955 } 2956 } 2957 } catch (NamingException ex) { 2958 throw new RuntimeException(ex); 2959 } 2960 2961 return data; 2962 } 2963 2964 @GraphQLField 2965 @GraphQLName("filter") 2966 static FilterObject filter(final DataFetchingEnvironment env, 2967 @GraphQLName("filterKindName") final String filterKindName, 2968 @GraphQLName("filterTypeName") final String filterTypeName, 2969 @GraphQLName("filterName") final String filterName, 2970 @GraphQLName("id") @GraphQLID final String id) { 2971 Filter filter; 2972 2973 try { 2974 var commandForm = FilterUtil.getHome().getGetFilterForm(); 2975 2976 commandForm.setFilterKindName(filterKindName); 2977 commandForm.setFilterTypeName(filterTypeName); 2978 commandForm.setFilterName(filterName); 2979 commandForm.setUuid(id); 2980 2981 filter = CDI.current().select(GetFilterCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2982 } catch (NamingException ex) { 2983 throw new RuntimeException(ex); 2984 } 2985 2986 return filter == null ? null : new FilterObject(filter); 2987 } 2988 2989 @GraphQLField 2990 @GraphQLName("filters") 2991 @GraphQLNonNull 2992 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2993 static CountingPaginatedData<FilterObject> filters(final DataFetchingEnvironment env, 2994 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 2995 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName) { 2996 CountingPaginatedData<FilterObject> data; 2997 2998 try { 2999 var commandForm = FilterUtil.getHome().getGetFiltersForm(); 3000 var command = CDI.current().select(GetFiltersCommand.class).get(); 3001 3002 commandForm.setFilterKindName(filterKindName); 3003 commandForm.setFilterTypeName(filterTypeName); 3004 3005 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3006 if(totalEntities == null) { 3007 data = Connections.emptyConnection(); 3008 } else { 3009 try(var objectLimiter = new ObjectLimiter(env, FilterConstants.COMPONENT_VENDOR_NAME, FilterConstants.ENTITY_TYPE_NAME, totalEntities)) { 3010 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3011 3012 var filters = entities.stream() 3013 .map(FilterObject::new) 3014 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3015 3016 data = new CountedObjects<>(objectLimiter, filters); 3017 } 3018 } 3019 } catch (NamingException ex) { 3020 throw new RuntimeException(ex); 3021 } 3022 3023 return data; 3024 } 3025 3026 @GraphQLField 3027 @GraphQLName("filterEntranceStep") 3028 static FilterEntranceStepObject filterEntranceStep(final DataFetchingEnvironment env, 3029 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3030 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3031 @GraphQLName("filterName") @GraphQLNonNull final String filterName, 3032 @GraphQLName("filterStepName") @GraphQLNonNull final String filterStepName) { 3033 FilterEntranceStep filterEntranceStep; 3034 3035 try { 3036 var commandForm = FilterUtil.getHome().getGetFilterEntranceStepForm(); 3037 3038 commandForm.setFilterKindName(filterKindName); 3039 commandForm.setFilterTypeName(filterTypeName); 3040 commandForm.setFilterName(filterName); 3041 commandForm.setFilterStepName(filterStepName); 3042 3043 filterEntranceStep = CDI.current().select(GetFilterEntranceStepCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3044 } catch (NamingException ex) { 3045 throw new RuntimeException(ex); 3046 } 3047 3048 return filterEntranceStep == null ? null : new FilterEntranceStepObject(filterEntranceStep); 3049 } 3050 3051 @GraphQLField 3052 @GraphQLName("filterEntranceSteps") 3053 @GraphQLNonNull 3054 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3055 static CountingPaginatedData<FilterEntranceStepObject> filterEntranceSteps(final DataFetchingEnvironment env, 3056 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3057 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3058 @GraphQLName("filterName") @GraphQLNonNull final String filterName) { 3059 CountingPaginatedData<FilterEntranceStepObject> data; 3060 3061 try { 3062 var commandForm = FilterUtil.getHome().getGetFilterEntranceStepsForm(); 3063 var command = CDI.current().select(GetFilterEntranceStepsCommand.class).get(); 3064 3065 commandForm.setFilterKindName(filterKindName); 3066 commandForm.setFilterTypeName(filterTypeName); 3067 commandForm.setFilterName(filterName); 3068 3069 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3070 if(totalEntities == null) { 3071 data = Connections.emptyConnection(); 3072 } else { 3073 try(var objectLimiter = new ObjectLimiter(env, FilterEntranceStepConstants.COMPONENT_VENDOR_NAME, FilterEntranceStepConstants.ENTITY_TYPE_NAME, totalEntities)) { 3074 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3075 3076 var filterEntranceSteps = entities.stream() 3077 .map(FilterEntranceStepObject::new) 3078 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3079 3080 data = new CountedObjects<>(objectLimiter, filterEntranceSteps); 3081 } 3082 } 3083 } catch (NamingException ex) { 3084 throw new RuntimeException(ex); 3085 } 3086 3087 return data; 3088 } 3089 3090 @GraphQLField 3091 @GraphQLName("filterStep") 3092 static FilterStepObject filterStep(final DataFetchingEnvironment env, 3093 @GraphQLName("filterKindName") final String filterKindName, 3094 @GraphQLName("filterTypeName") final String filterTypeName, 3095 @GraphQLName("filterName") final String filterName, 3096 @GraphQLName("filterStepName") final String filterStepName, 3097 @GraphQLName("id") @GraphQLID final String id) { 3098 FilterStep filterStep; 3099 3100 try { 3101 var commandForm = FilterUtil.getHome().getGetFilterStepForm(); 3102 3103 commandForm.setFilterKindName(filterKindName); 3104 commandForm.setFilterTypeName(filterTypeName); 3105 commandForm.setFilterName(filterName); 3106 commandForm.setFilterStepName(filterStepName); 3107 commandForm.setUuid(id); 3108 3109 filterStep = CDI.current().select(GetFilterStepCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3110 } catch (NamingException ex) { 3111 throw new RuntimeException(ex); 3112 } 3113 3114 return filterStep == null ? null : new FilterStepObject(filterStep); 3115 } 3116 3117 @GraphQLField 3118 @GraphQLName("filterSteps") 3119 @GraphQLNonNull 3120 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3121 static CountingPaginatedData<FilterStepObject> filterSteps(final DataFetchingEnvironment env, 3122 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3123 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3124 @GraphQLName("filterName") @GraphQLNonNull final String filterName) { 3125 CountingPaginatedData<FilterStepObject> data; 3126 3127 try { 3128 var commandForm = FilterUtil.getHome().getGetFilterStepsForm(); 3129 var command = CDI.current().select(GetFilterStepsCommand.class).get(); 3130 3131 commandForm.setFilterKindName(filterKindName); 3132 commandForm.setFilterTypeName(filterTypeName); 3133 commandForm.setFilterName(filterName); 3134 3135 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3136 if(totalEntities == null) { 3137 data = Connections.emptyConnection(); 3138 } else { 3139 try(var objectLimiter = new ObjectLimiter(env, FilterStepConstants.COMPONENT_VENDOR_NAME, FilterStepConstants.ENTITY_TYPE_NAME, totalEntities)) { 3140 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3141 3142 var filterSteps = entities.stream() 3143 .map(FilterStepObject::new) 3144 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3145 3146 data = new CountedObjects<>(objectLimiter, filterSteps); 3147 } 3148 } 3149 } catch (NamingException ex) { 3150 throw new RuntimeException(ex); 3151 } 3152 3153 return data; 3154 } 3155 3156 @GraphQLField 3157 @GraphQLName("filterStepElement") 3158 static FilterStepElementObject filterStepElement(final DataFetchingEnvironment env, 3159 @GraphQLName("filterKindName") final String filterKindName, 3160 @GraphQLName("filterTypeName") final String filterTypeName, 3161 @GraphQLName("filterName") final String filterName, 3162 @GraphQLName("filterStepName") final String filterStepName, 3163 @GraphQLName("filterStepElementName") final String filterStepElementName, 3164 @GraphQLName("id") @GraphQLID final String id) { 3165 FilterStepElement filterStepElement; 3166 3167 try { 3168 var commandForm = FilterUtil.getHome().getGetFilterStepElementForm(); 3169 3170 commandForm.setFilterKindName(filterKindName); 3171 commandForm.setFilterTypeName(filterTypeName); 3172 commandForm.setFilterName(filterName); 3173 commandForm.setFilterStepName(filterStepName); 3174 commandForm.setFilterStepElementName(filterStepElementName); 3175 commandForm.setUuid(id); 3176 3177 filterStepElement = CDI.current().select(GetFilterStepElementCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3178 } catch (NamingException ex) { 3179 throw new RuntimeException(ex); 3180 } 3181 3182 return filterStepElement == null ? null : new FilterStepElementObject(filterStepElement); 3183 } 3184 3185 @GraphQLField 3186 @GraphQLName("filterStepElements") 3187 @GraphQLNonNull 3188 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3189 static CountingPaginatedData<FilterStepElementObject> filterStepElements(final DataFetchingEnvironment env, 3190 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3191 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3192 @GraphQLName("filterName") @GraphQLNonNull final String filterName, 3193 @GraphQLName("filterStepName") @GraphQLNonNull final String filterStepName) { 3194 CountingPaginatedData<FilterStepElementObject> data; 3195 3196 try { 3197 var commandForm = FilterUtil.getHome().getGetFilterStepElementsForm(); 3198 var command = CDI.current().select(GetFilterStepElementsCommand.class).get(); 3199 3200 commandForm.setFilterKindName(filterKindName); 3201 commandForm.setFilterTypeName(filterTypeName); 3202 commandForm.setFilterName(filterName); 3203 commandForm.setFilterStepName(filterStepName); 3204 3205 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3206 if(totalEntities == null) { 3207 data = Connections.emptyConnection(); 3208 } else { 3209 try(var objectLimiter = new ObjectLimiter(env, FilterStepElementConstants.COMPONENT_VENDOR_NAME, FilterStepElementConstants.ENTITY_TYPE_NAME, totalEntities)) { 3210 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3211 3212 var filterStepElements = entities.stream() 3213 .map(FilterStepElementObject::new) 3214 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3215 3216 data = new CountedObjects<>(objectLimiter, filterStepElements); 3217 } 3218 } 3219 } catch (NamingException ex) { 3220 throw new RuntimeException(ex); 3221 } 3222 3223 return data; 3224 } 3225 3226 @GraphQLField 3227 @GraphQLName("filterStepDestination") 3228 static FilterStepDestinationObject filterStepDestination(final DataFetchingEnvironment env, 3229 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3230 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3231 @GraphQLName("filterName") @GraphQLNonNull final String filterName, 3232 @GraphQLName("fromFilterStepName") @GraphQLNonNull final String fromFilterStepName, 3233 @GraphQLName("toFilterStepName") @GraphQLNonNull final String toFilterStepName) { 3234 FilterStepDestination filterStepDestination; 3235 3236 try { 3237 var commandForm = FilterUtil.getHome().getGetFilterStepDestinationForm(); 3238 3239 commandForm.setFilterKindName(filterKindName); 3240 commandForm.setFilterTypeName(filterTypeName); 3241 commandForm.setFilterName(filterName); 3242 commandForm.setFromFilterStepName(fromFilterStepName); 3243 commandForm.setToFilterStepName(toFilterStepName); 3244 3245 filterStepDestination = CDI.current().select(GetFilterStepDestinationCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3246 } catch (NamingException ex) { 3247 throw new RuntimeException(ex); 3248 } 3249 3250 return filterStepDestination == null ? null : new FilterStepDestinationObject(filterStepDestination); 3251 } 3252 3253 @GraphQLField 3254 @GraphQLName("filterStepDestinations") 3255 @GraphQLNonNull 3256 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3257 static CountingPaginatedData<FilterStepDestinationObject> filterStepDestinations(final DataFetchingEnvironment env, 3258 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3259 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3260 @GraphQLName("filterName") @GraphQLNonNull final String filterName, 3261 @GraphQLName("fromFilterStepName") final String fromFilterStepName, 3262 @GraphQLName("toFilterStepName") final String toFilterStepName) { 3263 CountingPaginatedData<FilterStepDestinationObject> data; 3264 3265 try { 3266 var commandForm = FilterUtil.getHome().getGetFilterStepDestinationsForm(); 3267 var command = CDI.current().select(GetFilterStepDestinationsCommand.class).get(); 3268 3269 commandForm.setFilterKindName(filterKindName); 3270 commandForm.setFilterTypeName(filterTypeName); 3271 commandForm.setFilterName(filterName); 3272 commandForm.setFromFilterStepName(fromFilterStepName); 3273 commandForm.setToFilterStepName(toFilterStepName); 3274 3275 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3276 if(totalEntities == null) { 3277 data = Connections.emptyConnection(); 3278 } else { 3279 try(var objectLimiter = new ObjectLimiter(env, FilterStepDestinationConstants.COMPONENT_VENDOR_NAME, FilterStepDestinationConstants.ENTITY_TYPE_NAME, totalEntities)) { 3280 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3281 3282 var filterStepDestinations = entities.stream() 3283 .map(FilterStepDestinationObject::new) 3284 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3285 3286 data = new CountedObjects<>(objectLimiter, filterStepDestinations); 3287 } 3288 } 3289 } catch (NamingException ex) { 3290 throw new RuntimeException(ex); 3291 } 3292 3293 return data; 3294 } 3295 3296 @GraphQLField 3297 @GraphQLName("filterAdjustmentSource") 3298 static FilterAdjustmentSourceObject filterAdjustmentSource(final DataFetchingEnvironment env, 3299 @GraphQLName("filterAdjustmentSourceName") @GraphQLNonNull final String filterAdjustmentSourceName) { 3300 FilterAdjustmentSource filterAdjustmentSource; 3301 3302 try { 3303 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentSourceForm(); 3304 3305 commandForm.setFilterAdjustmentSourceName(filterAdjustmentSourceName); 3306 3307 filterAdjustmentSource = CDI.current().select(GetFilterAdjustmentSourceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3308 } catch (NamingException ex) { 3309 throw new RuntimeException(ex); 3310 } 3311 3312 return filterAdjustmentSource == null ? null : new FilterAdjustmentSourceObject(filterAdjustmentSource); 3313 } 3314 3315 @GraphQLField 3316 @GraphQLName("filterAdjustmentSources") 3317 @GraphQLNonNull 3318 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3319 static CountingPaginatedData<FilterAdjustmentSourceObject> filterAdjustmentSources(final DataFetchingEnvironment env) { 3320 CountingPaginatedData<FilterAdjustmentSourceObject> data; 3321 3322 try { 3323 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentSourcesForm(); 3324 var command = CDI.current().select(GetFilterAdjustmentSourcesCommand.class).get(); 3325 3326 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3327 if(totalEntities == null) { 3328 data = Connections.emptyConnection(); 3329 } else { 3330 try(var objectLimiter = new ObjectLimiter(env, com.echothree.model.data.filter.common.FilterAdjustmentSourceConstants.COMPONENT_VENDOR_NAME, com.echothree.model.data.filter.common.FilterAdjustmentSourceConstants.ENTITY_TYPE_NAME, totalEntities)) { 3331 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3332 3333 var filterAdjustmentSources = entities.stream() 3334 .map(FilterAdjustmentSourceObject::new) 3335 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3336 3337 data = new CountedObjects<>(objectLimiter, filterAdjustmentSources); 3338 } 3339 } 3340 } catch (NamingException ex) { 3341 throw new RuntimeException(ex); 3342 } 3343 3344 return data; 3345 } 3346 3347 @GraphQLField 3348 @GraphQLName("filterAdjustmentType") 3349 static FilterAdjustmentTypeObject filterAdjustmentType(final DataFetchingEnvironment env, 3350 @GraphQLName("filterAdjustmentTypeName") @GraphQLNonNull final String filterAdjustmentTypeName) { 3351 FilterAdjustmentType filterAdjustmentType; 3352 3353 try { 3354 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentTypeForm(); 3355 3356 commandForm.setFilterAdjustmentTypeName(filterAdjustmentTypeName); 3357 3358 filterAdjustmentType = CDI.current().select(GetFilterAdjustmentTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3359 } catch (NamingException ex) { 3360 throw new RuntimeException(ex); 3361 } 3362 3363 return filterAdjustmentType == null ? null : new FilterAdjustmentTypeObject(filterAdjustmentType); 3364 } 3365 3366 @GraphQLField 3367 @GraphQLName("filterAdjustmentTypes") 3368 @GraphQLNonNull 3369 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3370 static CountingPaginatedData<FilterAdjustmentTypeObject> filterAdjustmentTypes(final DataFetchingEnvironment env) { 3371 CountingPaginatedData<FilterAdjustmentTypeObject> data; 3372 3373 try { 3374 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentTypesForm(); 3375 var command = CDI.current().select(GetFilterAdjustmentTypesCommand.class).get(); 3376 3377 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3378 if(totalEntities == null) { 3379 data = Connections.emptyConnection(); 3380 } else { 3381 try(var objectLimiter = new ObjectLimiter(env, FilterAdjustmentTypeConstants.COMPONENT_VENDOR_NAME, FilterAdjustmentTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 3382 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3383 3384 var filterAdjustmentTypes = entities.stream() 3385 .map(FilterAdjustmentTypeObject::new) 3386 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3387 3388 data = new CountedObjects<>(objectLimiter, filterAdjustmentTypes); 3389 } 3390 } 3391 } catch (NamingException ex) { 3392 throw new RuntimeException(ex); 3393 } 3394 3395 return data; 3396 } 3397 3398 @GraphQLField 3399 @GraphQLName("filterAdjustment") 3400 static FilterAdjustmentObject filterAdjustment(final DataFetchingEnvironment env, 3401 @GraphQLName("filterKindName") final String filterKindName, 3402 @GraphQLName("filterAdjustmentName") final String filterAdjustmentName, 3403 @GraphQLName("id") @GraphQLID final String id) { 3404 FilterAdjustment filterAdjustment; 3405 3406 try { 3407 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentForm(); 3408 3409 commandForm.setFilterKindName(filterKindName); 3410 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3411 commandForm.setUuid(id); 3412 3413 filterAdjustment = CDI.current().select(GetFilterAdjustmentCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3414 } catch (NamingException ex) { 3415 throw new RuntimeException(ex); 3416 } 3417 3418 return filterAdjustment == null ? null : new FilterAdjustmentObject(filterAdjustment); 3419 } 3420 3421 @GraphQLField 3422 @GraphQLName("filterAdjustments") 3423 static Collection<FilterAdjustmentObject> filterAdjustments(final DataFetchingEnvironment env, 3424 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName) { 3425 Collection<FilterAdjustment> filterAdjustments; 3426 Collection<FilterAdjustmentObject> filterAdjustmentObjects; 3427 3428 try { 3429 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentsForm(); 3430 3431 commandForm.setFilterKindName(filterKindName); 3432 3433 filterAdjustments = CDI.current().select(GetFilterAdjustmentsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3434 } catch (NamingException ex) { 3435 throw new RuntimeException(ex); 3436 } 3437 3438 if(filterAdjustments == null) { 3439 filterAdjustmentObjects = emptyList(); 3440 } else { 3441 filterAdjustmentObjects = new ArrayList<>(filterAdjustments.size()); 3442 3443 filterAdjustments.stream() 3444 .map(FilterAdjustmentObject::new) 3445 .forEachOrdered(filterAdjustmentObjects::add); 3446 } 3447 3448 return filterAdjustmentObjects; 3449 } 3450 3451 @GraphQLField 3452 @GraphQLName("filterAdjustmentAmount") 3453 static FilterAdjustmentAmountObject filterAdjustmentAmount(final DataFetchingEnvironment env, 3454 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3455 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName, 3456 @GraphQLName("unitOfMeasureName") final String unitOfMeasureName, 3457 @GraphQLName("unitOfMeasureKindName") final String unitOfMeasureKindName, 3458 @GraphQLName("unitOfMeasureTypeName") final String unitOfMeasureTypeName, 3459 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 3460 FilterAdjustmentAmount filterAdjustmentAmount; 3461 3462 try { 3463 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentAmountForm(); 3464 3465 commandForm.setFilterKindName(filterKindName); 3466 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3467 commandForm.setUnitOfMeasureName(unitOfMeasureName); 3468 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 3469 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 3470 commandForm.setCurrencyIsoName(currencyIsoName); 3471 3472 filterAdjustmentAmount = CDI.current().select(GetFilterAdjustmentAmountCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3473 } catch (NamingException ex) { 3474 throw new RuntimeException(ex); 3475 } 3476 3477 return filterAdjustmentAmount == null ? null : new FilterAdjustmentAmountObject(filterAdjustmentAmount); 3478 } 3479 3480 @GraphQLField 3481 @GraphQLName("filterAdjustmentAmounts") 3482 static Collection<FilterAdjustmentAmountObject> filterAdjustmentAmounts(final DataFetchingEnvironment env, 3483 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3484 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName) { 3485 Collection<FilterAdjustmentAmount> filterAdjustmentAmounts; 3486 Collection<FilterAdjustmentAmountObject> filterAdjustmentAmountObjects; 3487 3488 try { 3489 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentAmountsForm(); 3490 3491 commandForm.setFilterKindName(filterKindName); 3492 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3493 3494 filterAdjustmentAmounts = CDI.current().select(GetFilterAdjustmentAmountsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3495 } catch (NamingException ex) { 3496 throw new RuntimeException(ex); 3497 } 3498 3499 if(filterAdjustmentAmounts == null) { 3500 filterAdjustmentAmountObjects = emptyList(); 3501 } else { 3502 filterAdjustmentAmountObjects = new ArrayList<>(filterAdjustmentAmounts.size()); 3503 3504 filterAdjustmentAmounts.stream() 3505 .map(FilterAdjustmentAmountObject::new) 3506 .forEachOrdered(filterAdjustmentAmountObjects::add); 3507 } 3508 3509 return filterAdjustmentAmountObjects; 3510 } 3511 3512 @GraphQLField 3513 @GraphQLName("filterAdjustmentFixedAmount") 3514 static FilterAdjustmentFixedAmountObject filterAdjustmentFixedAmount(final DataFetchingEnvironment env, 3515 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3516 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName, 3517 @GraphQLName("unitOfMeasureName") final String unitOfMeasureName, 3518 @GraphQLName("unitOfMeasureKindName") final String unitOfMeasureKindName, 3519 @GraphQLName("unitOfMeasureTypeName") final String unitOfMeasureTypeName, 3520 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 3521 FilterAdjustmentFixedAmount filterAdjustmentFixedAmount; 3522 3523 try { 3524 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentFixedAmountForm(); 3525 3526 commandForm.setFilterKindName(filterKindName); 3527 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3528 commandForm.setUnitOfMeasureName(unitOfMeasureName); 3529 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 3530 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 3531 commandForm.setCurrencyIsoName(currencyIsoName); 3532 3533 filterAdjustmentFixedAmount = CDI.current().select(GetFilterAdjustmentFixedAmountCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3534 } catch (NamingException ex) { 3535 throw new RuntimeException(ex); 3536 } 3537 3538 return filterAdjustmentFixedAmount == null ? null : new FilterAdjustmentFixedAmountObject(filterAdjustmentFixedAmount); 3539 } 3540 3541 @GraphQLField 3542 @GraphQLName("filterAdjustmentFixedAmounts") 3543 static Collection<FilterAdjustmentFixedAmountObject> filterAdjustmentFixedAmounts(final DataFetchingEnvironment env, 3544 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3545 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName) { 3546 Collection<FilterAdjustmentFixedAmount> filterAdjustmentFixedAmounts; 3547 Collection<FilterAdjustmentFixedAmountObject> filterAdjustmentFixedAmountObjects; 3548 3549 try { 3550 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentFixedAmountsForm(); 3551 3552 commandForm.setFilterKindName(filterKindName); 3553 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3554 3555 filterAdjustmentFixedAmounts = CDI.current().select(GetFilterAdjustmentFixedAmountsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3556 } catch (NamingException ex) { 3557 throw new RuntimeException(ex); 3558 } 3559 3560 if(filterAdjustmentFixedAmounts == null) { 3561 filterAdjustmentFixedAmountObjects = emptyList(); 3562 } else { 3563 filterAdjustmentFixedAmountObjects = new ArrayList<>(filterAdjustmentFixedAmounts.size()); 3564 3565 filterAdjustmentFixedAmounts.stream() 3566 .map(FilterAdjustmentFixedAmountObject::new) 3567 .forEachOrdered(filterAdjustmentFixedAmountObjects::add); 3568 } 3569 3570 return filterAdjustmentFixedAmountObjects; 3571 } 3572 3573 @GraphQLField 3574 @GraphQLName("filterAdjustmentPercent") 3575 static FilterAdjustmentPercentObject filterAdjustmentPercent(final DataFetchingEnvironment env, 3576 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3577 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName, 3578 @GraphQLName("unitOfMeasureName") final String unitOfMeasureName, 3579 @GraphQLName("unitOfMeasureKindName") final String unitOfMeasureKindName, 3580 @GraphQLName("unitOfMeasureTypeName") final String unitOfMeasureTypeName, 3581 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 3582 FilterAdjustmentPercent filterAdjustmentPercent; 3583 3584 try { 3585 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentPercentForm(); 3586 3587 commandForm.setFilterKindName(filterKindName); 3588 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3589 commandForm.setUnitOfMeasureName(unitOfMeasureName); 3590 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 3591 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 3592 commandForm.setCurrencyIsoName(currencyIsoName); 3593 3594 filterAdjustmentPercent = CDI.current().select(GetFilterAdjustmentPercentCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3595 } catch (NamingException ex) { 3596 throw new RuntimeException(ex); 3597 } 3598 3599 return filterAdjustmentPercent == null ? null : new FilterAdjustmentPercentObject(filterAdjustmentPercent); 3600 } 3601 3602 @GraphQLField 3603 @GraphQLName("filterAdjustmentPercents") 3604 static Collection<FilterAdjustmentPercentObject> filterAdjustmentPercents(final DataFetchingEnvironment env, 3605 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3606 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName) { 3607 Collection<FilterAdjustmentPercent> filterAdjustmentPercents; 3608 Collection<FilterAdjustmentPercentObject> filterAdjustmentPercentObjects; 3609 3610 try { 3611 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentPercentsForm(); 3612 3613 commandForm.setFilterKindName(filterKindName); 3614 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3615 3616 filterAdjustmentPercents = CDI.current().select(GetFilterAdjustmentPercentsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3617 } catch (NamingException ex) { 3618 throw new RuntimeException(ex); 3619 } 3620 3621 if(filterAdjustmentPercents == null) { 3622 filterAdjustmentPercentObjects = emptyList(); 3623 } else { 3624 filterAdjustmentPercentObjects = new ArrayList<>(filterAdjustmentPercents.size()); 3625 3626 filterAdjustmentPercents.stream() 3627 .map(FilterAdjustmentPercentObject::new) 3628 .forEachOrdered(filterAdjustmentPercentObjects::add); 3629 } 3630 3631 return filterAdjustmentPercentObjects; 3632 } 3633 3634 @GraphQLField 3635 @GraphQLName("offerUse") 3636 static OfferUseObject offerUse(final DataFetchingEnvironment env, 3637 @GraphQLName("offerName") @GraphQLNonNull final String offerName, 3638 @GraphQLName("useName") @GraphQLNonNull final String useName) { 3639 OfferUse offerUse; 3640 3641 try { 3642 var commandForm = OfferUtil.getHome().getGetOfferUseForm(); 3643 3644 commandForm.setOfferName(offerName); 3645 commandForm.setUseName(useName); 3646 3647 offerUse = CDI.current().select(GetOfferUseCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3648 } catch (NamingException ex) { 3649 throw new RuntimeException(ex); 3650 } 3651 3652 return offerUse == null ? null : new OfferUseObject(offerUse); 3653 } 3654 3655 @GraphQLField 3656 @GraphQLName("offerUses") 3657 @GraphQLNonNull 3658 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3659 static CountingPaginatedData<OfferUseObject> offerUses(final DataFetchingEnvironment env, 3660 @GraphQLName("offerName") final String offerName, 3661 @GraphQLName("useName") final String useName) { 3662 CountingPaginatedData<OfferUseObject> data; 3663 3664 try { 3665 var commandForm = OfferUtil.getHome().getGetOfferUsesForm(); 3666 3667 commandForm.setOfferName(offerName); 3668 commandForm.setUseName(useName); 3669 3670 var command = CDI.current().select(GetOfferUsesCommand.class).get(); 3671 3672 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3673 if(totalEntities == null) { 3674 data = Connections.emptyConnection(); 3675 } else { 3676 try(var objectLimiter = new ObjectLimiter(env, OfferConstants.COMPONENT_VENDOR_NAME, OfferConstants.ENTITY_TYPE_NAME, totalEntities)) { 3677 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3678 3679 var offerUses = entities.stream() 3680 .map(OfferUseObject::new) 3681 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3682 3683 data = new CountedObjects<>(objectLimiter, offerUses); 3684 } 3685 } 3686 } catch (NamingException ex) { 3687 throw new RuntimeException(ex); 3688 } 3689 3690 return data; 3691 } 3692 3693 @GraphQLField 3694 @GraphQLName("offer") 3695 static OfferObject offer(final DataFetchingEnvironment env, 3696 @GraphQLName("offerName") final String offerName, 3697 @GraphQLName("id") @GraphQLID final String id) { 3698 Offer offer; 3699 3700 try { 3701 var commandForm = OfferUtil.getHome().getGetOfferForm(); 3702 3703 commandForm.setOfferName(offerName); 3704 commandForm.setUuid(id); 3705 3706 offer = CDI.current().select(GetOfferCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3707 } catch (NamingException ex) { 3708 throw new RuntimeException(ex); 3709 } 3710 3711 return offer == null ? null : new OfferObject(offer); 3712 } 3713 3714 @GraphQLField 3715 @GraphQLName("offers") 3716 @GraphQLNonNull 3717 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3718 static CountingPaginatedData<OfferObject> offers(final DataFetchingEnvironment env) { 3719 CountingPaginatedData<OfferObject> data; 3720 3721 try { 3722 var commandForm = OfferUtil.getHome().getGetOffersForm(); 3723 var command = CDI.current().select(GetOffersCommand.class).get(); 3724 3725 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3726 if(totalEntities == null) { 3727 data = Connections.emptyConnection(); 3728 } else { 3729 try(var objectLimiter = new ObjectLimiter(env, OfferConstants.COMPONENT_VENDOR_NAME, OfferConstants.ENTITY_TYPE_NAME, totalEntities)) { 3730 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3731 3732 var offers = entities.stream() 3733 .map(OfferObject::new) 3734 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3735 3736 data = new CountedObjects<>(objectLimiter, offers); 3737 } 3738 } 3739 } catch (NamingException ex) { 3740 throw new RuntimeException(ex); 3741 } 3742 3743 return data; 3744 } 3745 3746 @GraphQLField 3747 @GraphQLName("offerItem") 3748 static OfferItemObject offerItem(final DataFetchingEnvironment env, 3749 @GraphQLName("offerName") final String offerName, 3750 @GraphQLName("itemName") final String itemName, 3751 @GraphQLName("id") @GraphQLID final String id) { 3752 OfferItem offerItem; 3753 3754 try { 3755 var commandForm = OfferUtil.getHome().getGetOfferItemForm(); 3756 3757 commandForm.setOfferName(offerName); 3758 commandForm.setItemName(itemName); 3759 commandForm.setUuid(id); 3760 3761 offerItem = CDI.current().select(GetOfferItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3762 } catch (NamingException ex) { 3763 throw new RuntimeException(ex); 3764 } 3765 3766 return offerItem == null ? null : new OfferItemObject(offerItem); 3767 } 3768 3769 @GraphQLField 3770 @GraphQLName("offerItems") 3771 @GraphQLNonNull 3772 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3773 static CountingPaginatedData<OfferItemObject> offerItems(final DataFetchingEnvironment env, 3774 @GraphQLName("offerName") @GraphQLNonNull final String offerName) { 3775 CountingPaginatedData<OfferItemObject> data; 3776 3777 try { 3778 var commandForm = OfferUtil.getHome().getGetOfferItemsForm(); 3779 var command = CDI.current().select(GetOfferItemsCommand.class).get(); 3780 3781 commandForm.setOfferName(offerName); 3782 3783 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3784 if(totalEntities == null) { 3785 data = Connections.emptyConnection(); 3786 } else { 3787 try(var objectLimiter = new ObjectLimiter(env, OfferItemConstants.COMPONENT_VENDOR_NAME, OfferItemConstants.ENTITY_TYPE_NAME, totalEntities)) { 3788 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3789 3790 var offerItemObjects = entities.stream() 3791 .map(OfferItemObject::new) 3792 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3793 3794 data = new CountedObjects<>(objectLimiter, offerItemObjects); 3795 } 3796 } 3797 } catch (NamingException ex) { 3798 throw new RuntimeException(ex); 3799 } 3800 3801 return data; 3802 } 3803 3804 @GraphQLField 3805 @GraphQLName("offerItemPrice") 3806 static OfferItemPriceObject offerItemPrice(final DataFetchingEnvironment env, 3807 @GraphQLName("offerName") @GraphQLNonNull final String offerName, 3808 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 3809 @GraphQLName("inventoryConditionName") @GraphQLNonNull final String inventoryConditionName, 3810 @GraphQLName("unitOfMeasureTypeName") @GraphQLNonNull final String unitOfMeasureTypeName, 3811 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 3812 OfferItemPrice offerItemPrice; 3813 3814 try { 3815 var commandForm = OfferUtil.getHome().getGetOfferItemPriceForm(); 3816 3817 commandForm.setOfferName(offerName); 3818 commandForm.setItemName(itemName); 3819 commandForm.setInventoryConditionName(inventoryConditionName); 3820 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 3821 commandForm.setCurrencyIsoName(currencyIsoName); 3822 3823 offerItemPrice = CDI.current().select(GetOfferItemPriceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3824 } catch (NamingException ex) { 3825 throw new RuntimeException(ex); 3826 } 3827 3828 return offerItemPrice == null ? null : new OfferItemPriceObject(offerItemPrice); 3829 } 3830 3831 @GraphQLField 3832 @GraphQLName("offerItemPrices") 3833 @GraphQLNonNull 3834 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3835 static CountingPaginatedData<OfferItemPriceObject> offerItemPrices(final DataFetchingEnvironment env, 3836 @GraphQLName("offerName") @GraphQLNonNull final String offerName, 3837 @GraphQLName("itemName") @GraphQLNonNull final String itemName) { 3838 CountingPaginatedData<OfferItemPriceObject> data; 3839 3840 try { 3841 var commandForm = OfferUtil.getHome().getGetOfferItemPricesForm(); 3842 var command = CDI.current().select(GetOfferItemPricesCommand.class).get(); 3843 3844 commandForm.setOfferName(offerName); 3845 commandForm.setItemName(itemName); 3846 3847 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3848 if(totalEntities == null) { 3849 data = Connections.emptyConnection(); 3850 } else { 3851 try(var objectLimiter = new ObjectLimiter(env, OfferItemPriceConstants.COMPONENT_VENDOR_NAME, OfferItemPriceConstants.ENTITY_TYPE_NAME, totalEntities)) { 3852 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3853 3854 var offerItemPrices = entities.stream() 3855 .map(OfferItemPriceObject::new) 3856 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3857 3858 data = new CountedObjects<>(objectLimiter, offerItemPrices); 3859 } 3860 } 3861 } catch (NamingException ex) { 3862 throw new RuntimeException(ex); 3863 } 3864 3865 return data; 3866 } 3867 3868 @GraphQLField 3869 @GraphQLName("use") 3870 static UseObject use(final DataFetchingEnvironment env, 3871 @GraphQLName("useName") final String useName, 3872 @GraphQLName("id") @GraphQLID final String id) { 3873 Use use; 3874 3875 try { 3876 var commandForm = OfferUtil.getHome().getGetUseForm(); 3877 3878 commandForm.setUseName(useName); 3879 commandForm.setUuid(id); 3880 3881 use = CDI.current().select(GetUseCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3882 } catch (NamingException ex) { 3883 throw new RuntimeException(ex); 3884 } 3885 3886 return use == null ? null : new UseObject(use); 3887 } 3888 3889 @GraphQLField 3890 @GraphQLName("uses") 3891 @GraphQLNonNull 3892 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3893 static CountingPaginatedData<UseObject> uses(final DataFetchingEnvironment env) { 3894 CountingPaginatedData<UseObject> data; 3895 3896 try { 3897 var commandForm = OfferUtil.getHome().getGetUsesForm(); 3898 var command = CDI.current().select(GetUsesCommand.class).get(); 3899 3900 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3901 if(totalEntities == null) { 3902 data = Connections.emptyConnection(); 3903 } else { 3904 try(var objectLimiter = new ObjectLimiter(env, UseConstants.COMPONENT_VENDOR_NAME, UseConstants.ENTITY_TYPE_NAME, totalEntities)) { 3905 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3906 3907 var uses = entities.stream() 3908 .map(UseObject::new) 3909 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3910 3911 data = new CountedObjects<>(objectLimiter, uses); 3912 } 3913 } 3914 } catch (NamingException ex) { 3915 throw new RuntimeException(ex); 3916 } 3917 3918 return data; 3919 } 3920 3921 @GraphQLField 3922 @GraphQLName("offerNameElement") 3923 static OfferNameElementObject offerNameElement(final DataFetchingEnvironment env, 3924 @GraphQLName("offerNameElementName") final String offerNameElementName, 3925 @GraphQLName("id") @GraphQLID final String id) { 3926 OfferNameElement offerNameElement; 3927 3928 try { 3929 var commandForm = OfferUtil.getHome().getGetOfferNameElementForm(); 3930 3931 commandForm.setOfferNameElementName(offerNameElementName); 3932 commandForm.setUuid(id); 3933 3934 offerNameElement = CDI.current().select(GetOfferNameElementCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3935 } catch (NamingException ex) { 3936 throw new RuntimeException(ex); 3937 } 3938 3939 return offerNameElement == null ? null : new OfferNameElementObject(offerNameElement); 3940 } 3941 3942 @GraphQLField 3943 @GraphQLName("offerNameElements") 3944 @GraphQLNonNull 3945 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3946 static CountingPaginatedData<OfferNameElementObject> offerNameElements(final DataFetchingEnvironment env) { 3947 CountingPaginatedData<OfferNameElementObject> data; 3948 3949 try { 3950 var commandForm = OfferUtil.getHome().getGetOfferNameElementsForm(); 3951 var command = CDI.current().select(GetOfferNameElementsCommand.class).get(); 3952 3953 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3954 if(totalEntities == null) { 3955 data = Connections.emptyConnection(); 3956 } else { 3957 try(var objectLimiter = new ObjectLimiter(env, OfferNameElementConstants.COMPONENT_VENDOR_NAME, OfferNameElementConstants.ENTITY_TYPE_NAME, totalEntities)) { 3958 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3959 3960 var offerNameElementObjects = entities.stream() 3961 .map(OfferNameElementObject::new) 3962 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3963 3964 data = new CountedObjects<>(objectLimiter, offerNameElementObjects); 3965 } 3966 } 3967 } catch (NamingException ex) { 3968 throw new RuntimeException(ex); 3969 } 3970 3971 return data; 3972 } 3973 3974 @GraphQLField 3975 @GraphQLName("useNameElement") 3976 static UseNameElementObject useNameElement(final DataFetchingEnvironment env, 3977 @GraphQLName("useNameElementName") final String useNameElementName, 3978 @GraphQLName("id") @GraphQLID final String id) { 3979 UseNameElement useNameElement; 3980 3981 try { 3982 var commandForm = OfferUtil.getHome().getGetUseNameElementForm(); 3983 3984 commandForm.setUseNameElementName(useNameElementName); 3985 commandForm.setUuid(id); 3986 3987 useNameElement = CDI.current().select(GetUseNameElementCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3988 } catch (NamingException ex) { 3989 throw new RuntimeException(ex); 3990 } 3991 3992 return useNameElement == null ? null : new UseNameElementObject(useNameElement); 3993 } 3994 3995 @GraphQLField 3996 @GraphQLName("useNameElements") 3997 @GraphQLNonNull 3998 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3999 static CountingPaginatedData<UseNameElementObject> useNameElements(final DataFetchingEnvironment env) { 4000 CountingPaginatedData<UseNameElementObject> data; 4001 4002 try { 4003 var commandForm = OfferUtil.getHome().getGetUseNameElementsForm(); 4004 var command = CDI.current().select(GetUseNameElementsCommand.class).get(); 4005 4006 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4007 if(totalEntities == null) { 4008 data = Connections.emptyConnection(); 4009 } else { 4010 try(var objectLimiter = new ObjectLimiter(env, UseNameElementConstants.COMPONENT_VENDOR_NAME, UseNameElementConstants.ENTITY_TYPE_NAME, totalEntities)) { 4011 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4012 4013 var useNameElementObjects = entities.stream() 4014 .map(UseNameElementObject::new) 4015 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4016 4017 data = new CountedObjects<>(objectLimiter, useNameElementObjects); 4018 } 4019 } 4020 } catch (NamingException ex) { 4021 throw new RuntimeException(ex); 4022 } 4023 4024 return data; 4025 } 4026 4027 @GraphQLField 4028 @GraphQLName("useType") 4029 static UseTypeObject useType(final DataFetchingEnvironment env, 4030 @GraphQLName("useTypeName") final String useTypeName, 4031 @GraphQLName("id") @GraphQLID final String id) { 4032 UseType useType; 4033 4034 try { 4035 var commandForm = OfferUtil.getHome().getGetUseTypeForm(); 4036 4037 commandForm.setUseTypeName(useTypeName); 4038 commandForm.setUuid(id); 4039 4040 useType = CDI.current().select(GetUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4041 } catch (NamingException ex) { 4042 throw new RuntimeException(ex); 4043 } 4044 4045 return useType == null ? null : new UseTypeObject(useType); 4046 } 4047 4048 @GraphQLField 4049 @GraphQLName("useTypes") 4050 @GraphQLNonNull 4051 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4052 static CountingPaginatedData<UseTypeObject> useTypes(final DataFetchingEnvironment env) { 4053 CountingPaginatedData<UseTypeObject> data; 4054 4055 try { 4056 var commandForm = OfferUtil.getHome().getGetUseTypesForm(); 4057 var command = CDI.current().select(GetUseTypesCommand.class).get(); 4058 4059 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4060 if(totalEntities == null) { 4061 data = Connections.emptyConnection(); 4062 } else { 4063 try(var objectLimiter = new ObjectLimiter(env, UseTypeConstants.COMPONENT_VENDOR_NAME, UseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4064 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4065 4066 var useTypes = entities.stream() 4067 .map(UseTypeObject::new) 4068 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4069 4070 data = new CountedObjects<>(objectLimiter, useTypes); 4071 } 4072 } 4073 } catch (NamingException ex) { 4074 throw new RuntimeException(ex); 4075 } 4076 4077 return data; 4078 } 4079 4080 @GraphQLField 4081 @GraphQLName("freeOnBoard") 4082 static FreeOnBoardObject freeOnBoard(final DataFetchingEnvironment env, 4083 @GraphQLName("freeOnBoardName") final String freeOnBoardName, 4084 @GraphQLName("id") @GraphQLID final String id) { 4085 FreeOnBoard freeOnBoard; 4086 4087 try { 4088 var commandForm = ShipmentUtil.getHome().getGetFreeOnBoardForm(); 4089 4090 commandForm.setFreeOnBoardName(freeOnBoardName); 4091 commandForm.setUuid(id); 4092 4093 freeOnBoard = CDI.current().select(GetFreeOnBoardCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4094 } catch (NamingException ex) { 4095 throw new RuntimeException(ex); 4096 } 4097 4098 return freeOnBoard == null ? null : new FreeOnBoardObject(freeOnBoard); 4099 } 4100 4101 @GraphQLField 4102 @GraphQLName("freeOnBoards") 4103 @GraphQLNonNull 4104 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4105 static CountingPaginatedData<FreeOnBoardObject> freeOnBoards(final DataFetchingEnvironment env) { 4106 CountingPaginatedData<FreeOnBoardObject> data; 4107 4108 try { 4109 var commandForm = ShipmentUtil.getHome().getGetFreeOnBoardsForm(); 4110 var command = CDI.current().select(GetFreeOnBoardsCommand.class).get(); 4111 4112 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4113 if(totalEntities == null) { 4114 data = Connections.emptyConnection(); 4115 } else { 4116 try(var objectLimiter = new ObjectLimiter(env, FreeOnBoardConstants.COMPONENT_VENDOR_NAME, FreeOnBoardConstants.ENTITY_TYPE_NAME, totalEntities)) { 4117 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4118 4119 var freeOnBoards = entities.stream() 4120 .map(FreeOnBoardObject::new) 4121 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4122 4123 data = new CountedObjects<>(objectLimiter, freeOnBoards); 4124 } 4125 } 4126 } catch (NamingException ex) { 4127 throw new RuntimeException(ex); 4128 } 4129 4130 return data; 4131 } 4132 4133 @GraphQLField 4134 @GraphQLName("paymentProcessorTypeCodeType") 4135 static PaymentProcessorTypeCodeTypeObject paymentProcessorTypeCodeType(final DataFetchingEnvironment env, 4136 @GraphQLName("paymentProcessorTypeName") final String paymentProcessorTypeName, 4137 @GraphQLName("paymentProcessorTypeCodeTypeName") final String paymentProcessorTypeCodeTypeName, 4138 @GraphQLName("id") @GraphQLID final String id) { 4139 PaymentProcessorTypeCodeType paymentProcessorTypeCodeType; 4140 4141 try { 4142 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTypeCodeTypeForm(); 4143 4144 commandForm.setPaymentProcessorTypeName(paymentProcessorTypeName); 4145 commandForm.setPaymentProcessorTypeCodeTypeName(paymentProcessorTypeCodeTypeName); 4146 commandForm.setUuid(id); 4147 4148 paymentProcessorTypeCodeType = CDI.current().select(GetPaymentProcessorTypeCodeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4149 } catch (NamingException ex) { 4150 throw new RuntimeException(ex); 4151 } 4152 4153 return paymentProcessorTypeCodeType == null ? null : new PaymentProcessorTypeCodeTypeObject(paymentProcessorTypeCodeType); 4154 } 4155 4156 @GraphQLField 4157 @GraphQLName("paymentProcessorTypeCode") 4158 static PaymentProcessorTypeCodeObject paymentProcessorTypeCode(final DataFetchingEnvironment env, 4159 @GraphQLName("paymentProcessorTypeName") final String paymentProcessorTypeName, 4160 @GraphQLName("paymentProcessorTypeCodeTypeName") final String paymentProcessorTypeCodeTypeName, 4161 @GraphQLName("paymentProcessorTypeCodeName") final String paymentProcessorTypeCodeName, 4162 @GraphQLName("id") @GraphQLID final String id) { 4163 PaymentProcessorTypeCode paymentProcessorTypeCode; 4164 4165 try { 4166 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTypeCodeForm(); 4167 4168 commandForm.setPaymentProcessorTypeName(paymentProcessorTypeName); 4169 commandForm.setPaymentProcessorTypeCodeTypeName(paymentProcessorTypeCodeTypeName); 4170 commandForm.setPaymentProcessorTypeCodeName(paymentProcessorTypeCodeName); 4171 commandForm.setUuid(id); 4172 4173 paymentProcessorTypeCode = CDI.current().select(GetPaymentProcessorTypeCodeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4174 } catch (NamingException ex) { 4175 throw new RuntimeException(ex); 4176 } 4177 4178 return paymentProcessorTypeCode == null ? null : new PaymentProcessorTypeCodeObject(paymentProcessorTypeCode); 4179 } 4180 4181 @GraphQLField 4182 @GraphQLName("paymentProcessorTransaction") 4183 static PaymentProcessorTransactionObject paymentProcessorTransaction(final DataFetchingEnvironment env, 4184 @GraphQLName("paymentProcessorTransactionName") final String paymentProcessorTransactionName, 4185 @GraphQLName("id") @GraphQLID final String id) { 4186 PaymentProcessorTransaction paymentProcessorTransaction; 4187 4188 try { 4189 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTransactionForm(); 4190 4191 commandForm.setPaymentProcessorTransactionName(paymentProcessorTransactionName); 4192 commandForm.setUuid(id); 4193 4194 paymentProcessorTransaction = CDI.current().select(GetPaymentProcessorTransactionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4195 } catch (NamingException ex) { 4196 throw new RuntimeException(ex); 4197 } 4198 4199 return paymentProcessorTransaction == null ? null : new PaymentProcessorTransactionObject(paymentProcessorTransaction); 4200 } 4201 4202 @GraphQLField 4203 @GraphQLName("paymentProcessorTransactions") 4204 static Collection<PaymentProcessorTransactionObject> paymentProcessorTransactions(final DataFetchingEnvironment env) { 4205 Collection<PaymentProcessorTransaction> paymentProcessorTransactions; 4206 Collection<PaymentProcessorTransactionObject> paymentProcessorTransactionObjects; 4207 4208 try { 4209 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTransactionsForm(); 4210 4211 paymentProcessorTransactions = CDI.current().select(GetPaymentProcessorTransactionsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4212 } catch (NamingException ex) { 4213 throw new RuntimeException(ex); 4214 } 4215 4216 if(paymentProcessorTransactions == null) { 4217 paymentProcessorTransactionObjects = emptyList(); 4218 } else { 4219 paymentProcessorTransactionObjects = new ArrayList<>(paymentProcessorTransactions.size()); 4220 4221 paymentProcessorTransactions.stream() 4222 .map(PaymentProcessorTransactionObject::new) 4223 .forEachOrdered(paymentProcessorTransactionObjects::add); 4224 } 4225 4226 return paymentProcessorTransactionObjects; 4227 } 4228 4229 @GraphQLField 4230 @GraphQLName("paymentProcessor") 4231 static PaymentProcessorObject paymentProcessor(final DataFetchingEnvironment env, 4232 @GraphQLName("paymentProcessorName") final String paymentProcessorName, 4233 @GraphQLName("id") @GraphQLID final String id) { 4234 PaymentProcessor paymentProcessor; 4235 4236 try { 4237 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorForm(); 4238 4239 commandForm.setPaymentProcessorName(paymentProcessorName); 4240 commandForm.setUuid(id); 4241 4242 paymentProcessor = CDI.current().select(GetPaymentProcessorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4243 } catch (NamingException ex) { 4244 throw new RuntimeException(ex); 4245 } 4246 4247 return paymentProcessor == null ? null : new PaymentProcessorObject(paymentProcessor); 4248 } 4249 4250 @GraphQLField 4251 @GraphQLName("paymentProcessors") 4252 @GraphQLNonNull 4253 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4254 static CountingPaginatedData<PaymentProcessorObject> paymentProcessors(final DataFetchingEnvironment env) { 4255 CountingPaginatedData<PaymentProcessorObject> data; 4256 4257 try { 4258 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorsForm(); 4259 var command = CDI.current().select(GetPaymentProcessorsCommand.class).get(); 4260 4261 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4262 if(totalEntities == null) { 4263 data = Connections.emptyConnection(); 4264 } else { 4265 try(var objectLimiter = new ObjectLimiter(env, PaymentProcessorConstants.COMPONENT_VENDOR_NAME, PaymentProcessorConstants.ENTITY_TYPE_NAME, totalEntities)) { 4266 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4267 4268 var paymentProcessors = entities.stream() 4269 .map(PaymentProcessorObject::new) 4270 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4271 4272 data = new CountedObjects<>(objectLimiter, paymentProcessors); 4273 } 4274 } 4275 } catch (NamingException ex) { 4276 throw new RuntimeException(ex); 4277 } 4278 4279 return data; 4280 } 4281 4282 @GraphQLField 4283 @GraphQLName("paymentProcessorType") 4284 static PaymentProcessorTypeObject paymentProcessorType(final DataFetchingEnvironment env, 4285 @GraphQLName("paymentProcessorTypeName") final String paymentProcessorTypeName, 4286 @GraphQLName("id") @GraphQLID final String id) { 4287 PaymentProcessorType paymentProcessorType; 4288 4289 try { 4290 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTypeForm(); 4291 4292 commandForm.setPaymentProcessorTypeName(paymentProcessorTypeName); 4293 commandForm.setUuid(id); 4294 4295 paymentProcessorType = CDI.current().select(GetPaymentProcessorTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4296 } catch (NamingException ex) { 4297 throw new RuntimeException(ex); 4298 } 4299 4300 return paymentProcessorType == null ? null : new PaymentProcessorTypeObject(paymentProcessorType); 4301 } 4302 4303 @GraphQLField 4304 @GraphQLName("paymentProcessorTypes") 4305 @GraphQLNonNull 4306 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4307 static CountingPaginatedData<PaymentProcessorTypeObject> paymentProcessorTypes(final DataFetchingEnvironment env) { 4308 CountingPaginatedData<PaymentProcessorTypeObject> data; 4309 4310 try { 4311 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTypesForm(); 4312 var command = CDI.current().select(GetPaymentProcessorTypesCommand.class).get(); 4313 4314 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4315 if(totalEntities == null) { 4316 data = Connections.emptyConnection(); 4317 } else { 4318 try(var objectLimiter = new ObjectLimiter(env, PaymentProcessorTypeConstants.COMPONENT_VENDOR_NAME, PaymentProcessorTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4319 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4320 4321 var paymentProcessorTypes = entities.stream() 4322 .map(PaymentProcessorTypeObject::new) 4323 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4324 4325 data = new CountedObjects<>(objectLimiter, paymentProcessorTypes); 4326 } 4327 } 4328 } catch (NamingException ex) { 4329 throw new RuntimeException(ex); 4330 } 4331 4332 return data; 4333 } 4334 4335 @GraphQLField 4336 @GraphQLName("paymentMethodType") 4337 static PaymentMethodTypeObject paymentMethodType(final DataFetchingEnvironment env, 4338 @GraphQLName("paymentMethodTypeName") final String paymentMethodTypeName, 4339 @GraphQLName("id") @GraphQLID final String id) { 4340 PaymentMethodType paymentMethodType; 4341 4342 try { 4343 var commandForm = PaymentUtil.getHome().getGetPaymentMethodTypeForm(); 4344 4345 commandForm.setPaymentMethodTypeName(paymentMethodTypeName); 4346 commandForm.setUuid(id); 4347 4348 paymentMethodType = CDI.current().select(GetPaymentMethodTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4349 } catch (NamingException ex) { 4350 throw new RuntimeException(ex); 4351 } 4352 4353 return paymentMethodType == null ? null : new PaymentMethodTypeObject(paymentMethodType); 4354 } 4355 4356 @GraphQLField 4357 @GraphQLName("paymentMethodTypes") 4358 @GraphQLNonNull 4359 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4360 static CountingPaginatedData<PaymentMethodTypeObject> paymentMethodTypes(final DataFetchingEnvironment env) { 4361 CountingPaginatedData<PaymentMethodTypeObject> data; 4362 4363 try { 4364 var commandForm = PaymentUtil.getHome().getGetPaymentMethodTypesForm(); 4365 var command = CDI.current().select(GetPaymentMethodTypesCommand.class).get(); 4366 4367 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4368 if(totalEntities == null) { 4369 data = Connections.emptyConnection(); 4370 } else { 4371 try(var objectLimiter = new ObjectLimiter(env, PaymentMethodTypeConstants.COMPONENT_VENDOR_NAME, PaymentMethodTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4372 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4373 4374 var paymentMethodTypes = entities.stream() 4375 .map(PaymentMethodTypeObject::new) 4376 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4377 4378 data = new CountedObjects<>(objectLimiter, paymentMethodTypes); 4379 } 4380 } 4381 } catch (NamingException ex) { 4382 throw new RuntimeException(ex); 4383 } 4384 4385 return data; 4386 } 4387 4388 @GraphQLField 4389 @GraphQLName("paymentProcessorResultCode") 4390 static PaymentProcessorResultCodeObject paymentProcessorResultCode(final DataFetchingEnvironment env, 4391 @GraphQLName("paymentProcessorResultCodeName") final String paymentProcessorResultCodeName, 4392 @GraphQLName("id") @GraphQLID final String id) { 4393 PaymentProcessorResultCode paymentProcessorResultCode; 4394 4395 try { 4396 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorResultCodeForm(); 4397 4398 commandForm.setPaymentProcessorResultCodeName(paymentProcessorResultCodeName); 4399 commandForm.setUuid(id); 4400 4401 paymentProcessorResultCode = CDI.current().select(GetPaymentProcessorResultCodeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4402 } catch (NamingException ex) { 4403 throw new RuntimeException(ex); 4404 } 4405 4406 return paymentProcessorResultCode == null ? null : new PaymentProcessorResultCodeObject(paymentProcessorResultCode); 4407 } 4408 4409 @GraphQLField 4410 @GraphQLName("paymentProcessorResultCodes") 4411 static Collection<PaymentProcessorResultCodeObject> paymentProcessorResultCodes(final DataFetchingEnvironment env) { 4412 Collection<PaymentProcessorResultCode> paymentProcessorResultCodes; 4413 Collection<PaymentProcessorResultCodeObject> paymentProcessorResultCodeObjects; 4414 4415 try { 4416 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorResultCodesForm(); 4417 4418 paymentProcessorResultCodes = CDI.current().select(GetPaymentProcessorResultCodesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4419 } catch (NamingException ex) { 4420 throw new RuntimeException(ex); 4421 } 4422 4423 if(paymentProcessorResultCodes == null) { 4424 paymentProcessorResultCodeObjects = emptyList(); 4425 } else { 4426 paymentProcessorResultCodeObjects = new ArrayList<>(paymentProcessorResultCodes.size()); 4427 4428 paymentProcessorResultCodes.stream() 4429 .map(PaymentProcessorResultCodeObject::new) 4430 .forEachOrdered(paymentProcessorResultCodeObjects::add); 4431 } 4432 4433 return paymentProcessorResultCodeObjects; 4434 } 4435 4436 @GraphQLField 4437 @GraphQLName("paymentProcessorActionType") 4438 static PaymentProcessorActionTypeObject paymentProcessorActionType(final DataFetchingEnvironment env, 4439 @GraphQLName("paymentProcessorActionTypeName") final String paymentProcessorActionTypeName, 4440 @GraphQLName("id") @GraphQLID final String id) { 4441 PaymentProcessorActionType paymentProcessorActionType; 4442 4443 try { 4444 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorActionTypeForm(); 4445 4446 commandForm.setPaymentProcessorActionTypeName(paymentProcessorActionTypeName); 4447 commandForm.setUuid(id); 4448 4449 paymentProcessorActionType = CDI.current().select(GetPaymentProcessorActionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4450 } catch (NamingException ex) { 4451 throw new RuntimeException(ex); 4452 } 4453 4454 return paymentProcessorActionType == null ? null : new PaymentProcessorActionTypeObject(paymentProcessorActionType); 4455 } 4456 4457 @GraphQLField 4458 @GraphQLName("paymentProcessorActionTypes") 4459 static Collection<PaymentProcessorActionTypeObject> paymentProcessorActionTypes(final DataFetchingEnvironment env) { 4460 Collection<PaymentProcessorActionType> paymentProcessorActionTypes; 4461 Collection<PaymentProcessorActionTypeObject> paymentProcessorActionTypeObjects; 4462 4463 try { 4464 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorActionTypesForm(); 4465 4466 paymentProcessorActionTypes = CDI.current().select(GetPaymentProcessorActionTypesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4467 } catch (NamingException ex) { 4468 throw new RuntimeException(ex); 4469 } 4470 4471 if(paymentProcessorActionTypes == null) { 4472 paymentProcessorActionTypeObjects = emptyList(); 4473 } else { 4474 paymentProcessorActionTypeObjects = new ArrayList<>(paymentProcessorActionTypes.size()); 4475 4476 paymentProcessorActionTypes.stream() 4477 .map(PaymentProcessorActionTypeObject::new) 4478 .forEachOrdered(paymentProcessorActionTypeObjects::add); 4479 } 4480 4481 return paymentProcessorActionTypeObjects; 4482 } 4483 4484 @GraphQLField 4485 @GraphQLName("appearance") 4486 static AppearanceObject appearance(final DataFetchingEnvironment env, 4487 @GraphQLName("appearanceName") final String appearanceName, 4488 @GraphQLName("id") @GraphQLID final String id) { 4489 Appearance appearance; 4490 4491 try { 4492 var commandForm = CoreUtil.getHome().getGetAppearanceForm(); 4493 4494 commandForm.setAppearanceName(appearanceName); 4495 commandForm.setUuid(id); 4496 4497 appearance = CDI.current().select(GetAppearanceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4498 } catch (NamingException ex) { 4499 throw new RuntimeException(ex); 4500 } 4501 4502 return appearance == null ? null : new AppearanceObject(appearance); 4503 } 4504 4505 @GraphQLField 4506 @GraphQLName("appearances") 4507 @GraphQLNonNull 4508 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4509 static CountingPaginatedData<AppearanceObject> appearances(final DataFetchingEnvironment env) { 4510 CountingPaginatedData<AppearanceObject> data; 4511 4512 try { 4513 var commandForm = CoreUtil.getHome().getGetAppearancesForm(); 4514 var command = CDI.current().select(GetAppearancesCommand.class).get(); 4515 4516 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4517 if(totalEntities == null) { 4518 data = Connections.emptyConnection(); 4519 } else { 4520 try(var objectLimiter = new ObjectLimiter(env, AppearanceConstants.COMPONENT_VENDOR_NAME, AppearanceConstants.ENTITY_TYPE_NAME, totalEntities)) { 4521 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4522 4523 var appearances = entities.stream() 4524 .map(AppearanceObject::new) 4525 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4526 4527 data = new CountedObjects<>(objectLimiter, appearances); 4528 } 4529 } 4530 } catch (NamingException ex) { 4531 throw new RuntimeException(ex); 4532 } 4533 4534 return data; 4535 } 4536 4537 @GraphQLField 4538 @GraphQLName("eventType") 4539 static EventTypeObject eventType(final DataFetchingEnvironment env, 4540 @GraphQLName("eventTypeName") final String eventTypeName, 4541 @GraphQLName("id") @GraphQLID final String id) { 4542 EventType eventType; 4543 4544 try { 4545 var commandForm = CoreUtil.getHome().getGetEventTypeForm(); 4546 4547 commandForm.setEventTypeName(eventTypeName); 4548 commandForm.setUuid(id); 4549 4550 eventType = CDI.current().select(GetEventTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4551 } catch (NamingException ex) { 4552 throw new RuntimeException(ex); 4553 } 4554 4555 return eventType == null ? null : new EventTypeObject(eventType); 4556 } 4557 4558 @GraphQLField 4559 @GraphQLName("eventTypes") 4560 @GraphQLNonNull 4561 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4562 static CountingPaginatedData<EventTypeObject> eventTypes(final DataFetchingEnvironment env) { 4563 CountingPaginatedData<EventTypeObject> data; 4564 4565 try { 4566 var commandForm = CoreUtil.getHome().getGetEventTypesForm(); 4567 var command = CDI.current().select(GetEventTypesCommand.class).get(); 4568 4569 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4570 if(totalEntities == null) { 4571 data = Connections.emptyConnection(); 4572 } else { 4573 try(var objectLimiter = new ObjectLimiter(env, EventTypeConstants.COMPONENT_VENDOR_NAME, EventTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4574 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4575 4576 var eventTypes = entities.stream() 4577 .map(EventTypeObject::new) 4578 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4579 4580 data = new CountedObjects<>(objectLimiter, eventTypes); 4581 } 4582 } 4583 } catch (NamingException ex) { 4584 throw new RuntimeException(ex); 4585 } 4586 4587 return data; 4588 } 4589 4590 @GraphQLField 4591 @GraphQLName("entityAliasType") 4592 static EntityAliasTypeObject entityAliasType(final DataFetchingEnvironment env, 4593 @GraphQLName("componentVendorName") final String componentVendorName, 4594 @GraphQLName("entityTypeName") final String entityTypeName, 4595 @GraphQLName("entityAliasTypeName") final String entityAliasTypeName, 4596 @GraphQLName("id") @GraphQLID final String id) { 4597 EntityAliasType entityAliasType; 4598 4599 try { 4600 var commandForm = CoreUtil.getHome().getGetEntityAliasTypeForm(); 4601 4602 commandForm.setComponentVendorName(componentVendorName); 4603 commandForm.setEntityTypeName(entityTypeName); 4604 commandForm.setEntityAliasTypeName(entityAliasTypeName); 4605 commandForm.setUuid(id); 4606 4607 entityAliasType = CDI.current().select(GetEntityAliasTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4608 } catch (NamingException ex) { 4609 throw new RuntimeException(ex); 4610 } 4611 4612 return entityAliasType == null ? null : new EntityAliasTypeObject(entityAliasType, null); 4613 } 4614 4615 @GraphQLField 4616 @GraphQLName("entityAliasTypes") 4617 @GraphQLNonNull 4618 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4619 static CountingPaginatedData<EntityAliasTypeObject> entityAliasTypes(final DataFetchingEnvironment env, 4620 @GraphQLName("componentVendorName") final String componentVendorName, 4621 @GraphQLName("entityTypeName") final String entityTypeName, 4622 @GraphQLName("id") @GraphQLID final String id) { 4623 CountingPaginatedData<EntityAliasTypeObject> data; 4624 4625 try { 4626 var commandForm = CoreUtil.getHome().getGetEntityAliasTypesForm(); 4627 var command = CDI.current().select(GetEntityAliasTypesCommand.class).get(); 4628 4629 commandForm.setComponentVendorName(componentVendorName); 4630 commandForm.setEntityTypeName(entityTypeName); 4631 commandForm.setUuid(id); 4632 4633 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4634 if(totalEntities == null) { 4635 data = Connections.emptyConnection(); 4636 } else { 4637 try(var objectLimiter = new ObjectLimiter(env, EntityAliasTypeConstants.COMPONENT_VENDOR_NAME, EntityAliasTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4638 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4639 4640 var entityAliasTypes = entities.stream() 4641 .map(entityAliasType -> new EntityAliasTypeObject(entityAliasType, null)) 4642 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4643 4644 data = new CountedObjects<>(objectLimiter, entityAliasTypes); 4645 } 4646 } 4647 } catch (NamingException ex) { 4648 throw new RuntimeException(ex); 4649 } 4650 4651 return data; 4652 } 4653 4654 @GraphQLField 4655 @GraphQLName("entityAlias") 4656 static EntityAliasObject entityAlias(final DataFetchingEnvironment env, 4657 @GraphQLName("componentVendorName") final String componentVendorName, 4658 @GraphQLName("entityTypeName") final String entityTypeName, 4659 @GraphQLName("entityAliasTypeName") final String entityAliasTypeName, 4660 @GraphQLName("id") @GraphQLID final String id, 4661 @GraphQLName("alias") @GraphQLNonNull final String alias) { 4662 EntityAlias entityAlias; 4663 4664 try { 4665 var commandForm = CoreUtil.getHome().getGetEntityAliasForm(); 4666 4667 commandForm.setComponentVendorName(componentVendorName); 4668 commandForm.setEntityTypeName(entityTypeName); 4669 commandForm.setEntityAliasTypeName(entityAliasTypeName); 4670 commandForm.setUuid(id); 4671 commandForm.setAlias(alias); 4672 4673 entityAlias = CDI.current().select(GetEntityAliasCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4674 } catch (NamingException ex) { 4675 throw new RuntimeException(ex); 4676 } 4677 4678 return entityAlias == null ? null : new EntityAliasObject(entityAlias); 4679 } 4680 4681 @GraphQLField 4682 @GraphQLName("entityAliases") 4683 @GraphQLNonNull 4684 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4685 static CountingPaginatedData<EntityAliasObject> entityAliases(final DataFetchingEnvironment env, 4686 @GraphQLName("componentVendorName") final String componentVendorName, 4687 @GraphQLName("entityTypeName") final String entityTypeName, 4688 @GraphQLName("entityAliasTypeName") final String entityAliasTypeName, 4689 @GraphQLName("id") @GraphQLID final String id) { 4690 CountingPaginatedData<EntityAliasObject> data; 4691 4692 try { 4693 var commandForm = CoreUtil.getHome().getGetEntityAliasesForm(); 4694 var command = CDI.current().select(GetEntityAliasesCommand.class).get(); 4695 4696 commandForm.setComponentVendorName(componentVendorName); 4697 commandForm.setEntityTypeName(entityTypeName); 4698 commandForm.setEntityAliasTypeName(entityAliasTypeName); 4699 commandForm.setUuid(id); 4700 4701 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4702 if(totalEntities == null) { 4703 data = Connections.emptyConnection(); 4704 } else { 4705 try(var objectLimiter = new ObjectLimiter(env, EntityAliasConstants.COMPONENT_VENDOR_NAME, EntityAliasConstants.ENTITY_TYPE_NAME, totalEntities)) { 4706 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4707 4708 var entityAliases = entities.stream() 4709 .map(EntityAliasObject::new) 4710 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4711 4712 data = new CountedObjects<>(objectLimiter, entityAliases); 4713 } 4714 } 4715 } catch (NamingException ex) { 4716 throw new RuntimeException(ex); 4717 } 4718 4719 return data; 4720 } 4721 4722 4723 @GraphQLField 4724 @GraphQLName("entityAttributeGroup") 4725 static EntityAttributeGroupObject entityAttributeGroup(final DataFetchingEnvironment env, 4726 @GraphQLName("entityAttributeGroupName") final String entityAttributeGroupName, 4727 @GraphQLName("id") @GraphQLID final String id) { 4728 EntityAttributeGroup entityAttributeGroup; 4729 4730 try { 4731 var commandForm = CoreUtil.getHome().getGetEntityAttributeGroupForm(); 4732 4733 commandForm.setEntityAttributeGroupName(entityAttributeGroupName); 4734 commandForm.setUuid(id); 4735 4736 entityAttributeGroup = CDI.current().select(GetEntityAttributeGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4737 } catch (NamingException ex) { 4738 throw new RuntimeException(ex); 4739 } 4740 4741 return entityAttributeGroup == null ? null : new EntityAttributeGroupObject(entityAttributeGroup, null); 4742 } 4743 4744 @GraphQLField 4745 @GraphQLName("entityAttributeGroups") 4746 @GraphQLNonNull 4747 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4748 static CountingPaginatedData<EntityAttributeGroupObject> entityAttributeGroups(final DataFetchingEnvironment env) { 4749 CountingPaginatedData<EntityAttributeGroupObject> data; 4750 4751 try { 4752 var commandForm = CoreUtil.getHome().getGetEntityAttributeGroupsForm(); 4753 var command = CDI.current().select(GetEntityAttributeGroupsCommand.class).get(); 4754 4755 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4756 if(totalEntities == null) { 4757 data = Connections.emptyConnection(); 4758 } else { 4759 try(var objectLimiter = new ObjectLimiter(env, EntityAttributeGroupConstants.COMPONENT_VENDOR_NAME, EntityAttributeGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 4760 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4761 4762 var entityAttributeGroups = entities.stream() 4763 .map(entityAttributeGroup -> new EntityAttributeGroupObject(entityAttributeGroup, null)) 4764 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4765 4766 data = new CountedObjects<>(objectLimiter, entityAttributeGroups); 4767 } 4768 } 4769 } catch (NamingException ex) { 4770 throw new RuntimeException(ex); 4771 } 4772 4773 return data; 4774 } 4775 4776 @GraphQLField 4777 @GraphQLName("entityAttribute") 4778 static EntityAttributeObject entityAttribute(final DataFetchingEnvironment env, 4779 @GraphQLName("componentVendorName") final String componentVendorName, 4780 @GraphQLName("entityTypeName") final String entityTypeName, 4781 @GraphQLName("entityAttributeName") final String entityAttributeName, 4782 @GraphQLName("id") @GraphQLID final String id) { 4783 EntityAttribute entityAttribute; 4784 4785 try { 4786 var commandForm = CoreUtil.getHome().getGetEntityAttributeForm(); 4787 4788 commandForm.setComponentVendorName(componentVendorName); 4789 commandForm.setEntityTypeName(entityTypeName); 4790 commandForm.setEntityAttributeName(entityAttributeName); 4791 commandForm.setUuid(id); 4792 4793 entityAttribute = CDI.current().select(GetEntityAttributeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4794 } catch (NamingException ex) { 4795 throw new RuntimeException(ex); 4796 } 4797 4798 return entityAttribute == null ? null : new EntityAttributeObject(entityAttribute, null); 4799 } 4800 4801 @GraphQLField 4802 @GraphQLName("entityAttributes") 4803 @GraphQLNonNull 4804 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4805 static CountingPaginatedData<EntityAttributeObject> entityAttributes(final DataFetchingEnvironment env, 4806 @GraphQLName("componentVendorName") final String componentVendorName, 4807 @GraphQLName("entityTypeName") final String entityTypeName, 4808 @GraphQLName("entityAttributeTypeNames") final String entityAttributeTypeNames, 4809 @GraphQLName("id") @GraphQLID final String id) { 4810 CountingPaginatedData<EntityAttributeObject> data; 4811 4812 try { 4813 var commandForm = CoreUtil.getHome().getGetEntityAttributesForm(); 4814 var command = CDI.current().select(GetEntityAttributesCommand.class).get(); 4815 4816 commandForm.setComponentVendorName(componentVendorName); 4817 commandForm.setEntityTypeName(entityTypeName); 4818 commandForm.setEntityAttributeTypeNames(entityAttributeTypeNames); 4819 commandForm.setUuid(id); 4820 4821 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4822 if(totalEntities == null) { 4823 data = Connections.emptyConnection(); 4824 } else { 4825 try(var objectLimiter = new ObjectLimiter(env, EntityAttributeConstants.COMPONENT_VENDOR_NAME, EntityAttributeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4826 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4827 4828 var entityAttributes = entities.stream() 4829 .map(entityAttribute -> new EntityAttributeObject(entityAttribute, null)) 4830 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4831 4832 data = new CountedObjects<>(objectLimiter, entityAttributes); 4833 } 4834 } 4835 } catch (NamingException ex) { 4836 throw new RuntimeException(ex); 4837 } 4838 4839 return data; 4840 } 4841 4842 @GraphQLField 4843 @GraphQLName("entityAttributeEntityAttributeGroup") 4844 static EntityAttributeEntityAttributeGroupObject entityAttributeEntityAttributeGroup(final DataFetchingEnvironment env, 4845 @GraphQLName("componentVendorName") @GraphQLNonNull final String componentVendorName, 4846 @GraphQLName("entityTypeName") @GraphQLNonNull final String entityTypeName, 4847 @GraphQLName("entityAttributeName") @GraphQLNonNull final String entityAttributeName, 4848 @GraphQLName("entityAttributeGroupName") @GraphQLNonNull final String entityAttributeGroupName) { 4849 EntityAttributeEntityAttributeGroup entityAttributeEntityAttributeGroup; 4850 4851 try { 4852 var commandForm = CoreUtil.getHome().getGetEntityAttributeEntityAttributeGroupForm(); 4853 4854 commandForm.setComponentVendorName(componentVendorName); 4855 commandForm.setEntityTypeName(entityTypeName); 4856 commandForm.setEntityAttributeName(entityAttributeName); 4857 commandForm.setEntityAttributeGroupName(entityAttributeGroupName); 4858 4859 entityAttributeEntityAttributeGroup = CDI.current().select(GetEntityAttributeEntityAttributeGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4860 } catch (NamingException ex) { 4861 throw new RuntimeException(ex); 4862 } 4863 4864 return entityAttributeEntityAttributeGroup == null ? null : new EntityAttributeEntityAttributeGroupObject(entityAttributeEntityAttributeGroup); 4865 } 4866 4867 @GraphQLField 4868 @GraphQLName("entityAttributeEntityAttributeGroups") 4869 @GraphQLNonNull 4870 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4871 static CountingPaginatedData<EntityAttributeEntityAttributeGroupObject> entityAttributeEntityAttributeGroups(final DataFetchingEnvironment env, 4872 @GraphQLName("componentVendorName") final String componentVendorName, 4873 @GraphQLName("entityTypeName") final String entityTypeName, 4874 @GraphQLName("entityAttributeName") final String entityAttributeName, 4875 @GraphQLName("entityAttributeGroupName") final String entityAttributeGroupName) { 4876 CountingPaginatedData<EntityAttributeEntityAttributeGroupObject> data; 4877 4878 try { 4879 var commandForm = CoreUtil.getHome().getGetEntityAttributeEntityAttributeGroupsForm(); 4880 var command = CDI.current().select(GetEntityAttributeEntityAttributeGroupsCommand.class).get(); 4881 4882 commandForm.setComponentVendorName(componentVendorName); 4883 commandForm.setEntityTypeName(entityTypeName); 4884 commandForm.setEntityAttributeName(entityAttributeName); 4885 commandForm.setEntityAttributeGroupName(entityAttributeGroupName); 4886 4887 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4888 if(totalEntities == null) { 4889 data = Connections.emptyConnection(); 4890 } else { 4891 try(var objectLimiter = new ObjectLimiter(env, EntityAttributeEntityAttributeGroupConstants.COMPONENT_VENDOR_NAME, EntityAttributeEntityAttributeGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 4892 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4893 4894 var entityAttributeEntityAttributeGroups = entities.stream() 4895 .map(EntityAttributeEntityAttributeGroupObject::new) 4896 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4897 4898 data = new CountedObjects<>(objectLimiter, entityAttributeEntityAttributeGroups); 4899 } 4900 } 4901 } catch (NamingException ex) { 4902 throw new RuntimeException(ex); 4903 } 4904 4905 return data; 4906 } 4907 4908 @GraphQLField 4909 @GraphQLName("entityInstance") 4910 static EntityInstanceObject entityInstance(final DataFetchingEnvironment env, 4911 @GraphQLName("id") @GraphQLID final String id, 4912 @GraphQLName("entityRef") final String entityRef) { 4913 EntityInstance entityInstance; 4914 4915 try { 4916 var commandForm = CoreUtil.getHome().getGetEntityInstanceForm(); 4917 4918 commandForm.setUuid(id); 4919 commandForm.setEntityRef(entityRef); 4920 4921 entityInstance = CDI.current().select(GetEntityInstanceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4922 } catch (NamingException ex) { 4923 throw new RuntimeException(ex); 4924 } 4925 4926 return entityInstance == null ? null : new EntityInstanceObject(entityInstance); 4927 } 4928 4929 @GraphQLField 4930 @GraphQLName("entityInstances") 4931 @GraphQLNonNull 4932 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4933 static CountingPaginatedData<EntityInstanceObject> entityInstances(final DataFetchingEnvironment env, 4934 @GraphQLName("componentVendorName") @GraphQLNonNull final String componentVendorName, 4935 @GraphQLName("entityTypeName") @GraphQLNonNull final String entityTypeName) { 4936 CountingPaginatedData<EntityInstanceObject> data; 4937 4938 try { 4939 var commandForm = CoreUtil.getHome().getGetEntityInstancesForm(); 4940 var command = CDI.current().select(GetEntityInstancesCommand.class).get(); 4941 4942 commandForm.setComponentVendorName(componentVendorName); 4943 commandForm.setEntityTypeName(entityTypeName); 4944 4945 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4946 if(totalEntities == null) { 4947 data = Connections.emptyConnection(); 4948 } else { 4949 try(var objectLimiter = new ObjectLimiter(env, EntityInstanceConstants.COMPONENT_VENDOR_NAME, EntityInstanceConstants.ENTITY_TYPE_NAME, totalEntities)) { 4950 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4951 4952 var entityInstances = entities.stream() 4953 .map(EntityInstanceObject::new) 4954 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4955 4956 data = new CountedObjects<>(objectLimiter, entityInstances); 4957 } 4958 } 4959 } catch (NamingException ex) { 4960 throw new RuntimeException(ex); 4961 } 4962 4963 return data; 4964 } 4965 4966 @GraphQLField 4967 @GraphQLName("entityType") 4968 static EntityTypeObject entityType(final DataFetchingEnvironment env, 4969 @GraphQLName("componentVendorName") final String componentVendorName, 4970 @GraphQLName("entityTypeName") final String entityTypeName, 4971 @GraphQLName("id") @GraphQLID final String id) { 4972 EntityType entityType; 4973 4974 try { 4975 var commandForm = CoreUtil.getHome().getGetEntityTypeForm(); 4976 4977 commandForm.setComponentVendorName(componentVendorName); 4978 commandForm.setEntityTypeName(entityTypeName); 4979 commandForm.setUuid(id); 4980 4981 entityType = CDI.current().select(GetEntityTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4982 } catch (NamingException ex) { 4983 throw new RuntimeException(ex); 4984 } 4985 4986 return entityType == null ? null : new EntityTypeObject(entityType); 4987 } 4988 4989 @GraphQLField 4990 @GraphQLName("entityTypes") 4991 @GraphQLNonNull 4992 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4993 static CountingPaginatedData<EntityTypeObject> entityTypes(final DataFetchingEnvironment env, 4994 @GraphQLName("componentVendorName") final String componentVendorName) { 4995 CountingPaginatedData<EntityTypeObject> data; 4996 4997 try { 4998 var commandForm = CoreUtil.getHome().getGetEntityTypesForm(); 4999 var command = CDI.current().select(GetEntityTypesCommand.class).get(); 5000 5001 commandForm.setComponentVendorName(componentVendorName); 5002 5003 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5004 if(totalEntities == null) { 5005 data = Connections.emptyConnection(); 5006 } else { 5007 try(var objectLimiter = new ObjectLimiter(env, EntityTypeConstants.COMPONENT_VENDOR_NAME, EntityTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 5008 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5009 5010 var entityTypes = entities.stream() 5011 .map(EntityTypeObject::new) 5012 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5013 5014 data = new CountedObjects<>(objectLimiter, entityTypes); 5015 } 5016 } 5017 } catch (NamingException ex) { 5018 throw new RuntimeException(ex); 5019 } 5020 5021 return data; 5022 } 5023 5024 @GraphQLField 5025 @GraphQLName("componentVendor") 5026 static ComponentVendorObject componentVendor(final DataFetchingEnvironment env, 5027 @GraphQLName("componentVendorName") final String componentVendorName, 5028 @GraphQLName("id") @GraphQLID final String id) { 5029 ComponentVendor componentVendor; 5030 5031 try { 5032 var commandForm = CoreUtil.getHome().getGetComponentVendorForm(); 5033 5034 commandForm.setComponentVendorName(componentVendorName); 5035 commandForm.setUuid(id); 5036 5037 componentVendor = CDI.current().select(GetComponentVendorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5038 } catch (NamingException ex) { 5039 throw new RuntimeException(ex); 5040 } 5041 5042 return componentVendor == null ? null : new ComponentVendorObject(componentVendor); 5043 } 5044 5045 @GraphQLField 5046 @GraphQLName("componentVendors") 5047 @GraphQLNonNull 5048 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5049 static CountingPaginatedData<ComponentVendorObject> componentVendors(final DataFetchingEnvironment env) { 5050 CountingPaginatedData<ComponentVendorObject> data; 5051 5052 try { 5053 var commandForm = CoreUtil.getHome().getGetComponentVendorsForm(); 5054 var command = CDI.current().select(GetComponentVendorsCommand.class).get(); 5055 5056 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5057 if(totalEntities == null) { 5058 data = Connections.emptyConnection(); 5059 } else { 5060 try(var objectLimiter = new ObjectLimiter(env, ComponentVendorConstants.COMPONENT_VENDOR_NAME, ComponentVendorConstants.ENTITY_TYPE_NAME, totalEntities)) { 5061 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5062 5063 var componentVendors = entities.stream() 5064 .map(ComponentVendorObject::new) 5065 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5066 5067 data = new CountedObjects<>(objectLimiter, componentVendors); 5068 } 5069 } 5070 } catch (NamingException ex) { 5071 throw new RuntimeException(ex); 5072 } 5073 5074 return data; 5075 } 5076 5077 @GraphQLField 5078 @GraphQLName("inventoryCondition") 5079 static InventoryConditionObject inventoryCondition(final DataFetchingEnvironment env, 5080 @GraphQLName("inventoryConditionName") final String inventoryConditionName, 5081 @GraphQLName("id") @GraphQLID final String id) { 5082 InventoryCondition inventoryCondition; 5083 5084 try { 5085 var commandForm = InventoryUtil.getHome().getGetInventoryConditionForm(); 5086 5087 commandForm.setInventoryConditionName(inventoryConditionName); 5088 commandForm.setUuid(id); 5089 5090 inventoryCondition = CDI.current().select(GetInventoryConditionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5091 } catch (NamingException ex) { 5092 throw new RuntimeException(ex); 5093 } 5094 5095 return inventoryCondition == null ? null : new InventoryConditionObject(inventoryCondition); 5096 } 5097 5098 @GraphQLField 5099 @GraphQLName("inventoryConditions") 5100 @GraphQLNonNull 5101 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5102 static CountingPaginatedData<InventoryConditionObject> inventoryConditions(final DataFetchingEnvironment env) { 5103 CountingPaginatedData<InventoryConditionObject> data; 5104 5105 try { 5106 var commandForm = InventoryUtil.getHome().getGetInventoryConditionsForm(); 5107 var command = CDI.current().select(GetInventoryConditionsCommand.class).get(); 5108 5109 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5110 if(totalEntities == null) { 5111 data = Connections.emptyConnection(); 5112 } else { 5113 try(var objectLimiter = new ObjectLimiter(env, InventoryConditionConstants.COMPONENT_VENDOR_NAME, InventoryConditionConstants.ENTITY_TYPE_NAME, totalEntities)) { 5114 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5115 5116 var inventoryConditions = entities.stream() 5117 .map(InventoryConditionObject::new) 5118 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5119 5120 data = new CountedObjects<>(objectLimiter, inventoryConditions); 5121 } 5122 } 5123 } catch (NamingException ex) { 5124 throw new RuntimeException(ex); 5125 } 5126 5127 return data; 5128 } 5129 5130 @GraphQLField 5131 @GraphQLName("allocationPriority") 5132 static AllocationPriorityObject allocationPriority(final DataFetchingEnvironment env, 5133 @GraphQLName("allocationPriorityName") final String allocationPriorityName, 5134 @GraphQLName("id") @GraphQLID final String id) { 5135 AllocationPriority allocationPriority; 5136 5137 try { 5138 var commandForm = InventoryUtil.getHome().getGetAllocationPriorityForm(); 5139 5140 commandForm.setAllocationPriorityName(allocationPriorityName); 5141 commandForm.setUuid(id); 5142 5143 allocationPriority = CDI.current().select(GetAllocationPriorityCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5144 } catch (NamingException ex) { 5145 throw new RuntimeException(ex); 5146 } 5147 5148 return allocationPriority == null ? null : new AllocationPriorityObject(allocationPriority); 5149 } 5150 5151 @GraphQLField 5152 @GraphQLName("allocationPriorities") 5153 @GraphQLNonNull 5154 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5155 static CountingPaginatedData<AllocationPriorityObject> allocationPriorities(final DataFetchingEnvironment env) { 5156 CountingPaginatedData<AllocationPriorityObject> data; 5157 5158 try { 5159 var commandForm = InventoryUtil.getHome().getGetAllocationPrioritiesForm(); 5160 var command = CDI.current().select(GetAllocationPrioritiesCommand.class).get(); 5161 5162 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5163 if(totalEntities == null) { 5164 data = Connections.emptyConnection(); 5165 } else { 5166 try(var objectLimiter = new ObjectLimiter(env, AllocationPriorityConstants.COMPONENT_VENDOR_NAME, AllocationPriorityConstants.ENTITY_TYPE_NAME, totalEntities)) { 5167 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5168 5169 var allocationPriorities = entities.stream() 5170 .map(AllocationPriorityObject::new) 5171 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5172 5173 data = new CountedObjects<>(objectLimiter, allocationPriorities); 5174 } 5175 } 5176 } catch (NamingException ex) { 5177 throw new RuntimeException(ex); 5178 } 5179 5180 return data; 5181 } 5182 5183 @GraphQLField 5184 @GraphQLName("inventoryTransactionType") 5185 static InventoryTransactionTypeObject inventoryTransactionType(final DataFetchingEnvironment env, 5186 @GraphQLName("inventoryTransactionTypeName") final String inventoryTransactionTypeName, 5187 @GraphQLName("id") @GraphQLID final String id) { 5188 InventoryTransactionType inventoryTransactionType; 5189 5190 try { 5191 var commandForm = InventoryUtil.getHome().getGetInventoryTransactionTypeForm(); 5192 5193 commandForm.setInventoryTransactionTypeName(inventoryTransactionTypeName); 5194 commandForm.setUuid(id); 5195 5196 inventoryTransactionType = CDI.current().select(GetInventoryTransactionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5197 } catch (NamingException ex) { 5198 throw new RuntimeException(ex); 5199 } 5200 5201 return inventoryTransactionType == null ? null : new InventoryTransactionTypeObject(inventoryTransactionType); 5202 } 5203 5204 @GraphQLField 5205 @GraphQLName("inventoryAdjustmentType") 5206 static InventoryAdjustmentTypeObject inventoryAdjustmentType(final DataFetchingEnvironment env, 5207 @GraphQLName("inventoryAdjustmentTypeName") final String inventoryAdjustmentTypeName, 5208 @GraphQLName("id") @GraphQLID final String id) { 5209 InventoryAdjustmentType inventoryAdjustmentType; 5210 5211 try { 5212 var commandForm = InventoryUtil.getHome().getGetInventoryAdjustmentTypeForm(); 5213 5214 commandForm.setInventoryAdjustmentTypeName(inventoryAdjustmentTypeName); 5215 commandForm.setUuid(id); 5216 5217 inventoryAdjustmentType = CDI.current().select(GetInventoryAdjustmentTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5218 } catch (NamingException ex) { 5219 throw new RuntimeException(ex); 5220 } 5221 5222 return inventoryAdjustmentType == null ? null : new InventoryAdjustmentTypeObject(inventoryAdjustmentType); 5223 } 5224 5225 @GraphQLField 5226 @GraphQLName("inventoryAdjustmentTypes") 5227 @GraphQLNonNull 5228 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5229 static CountingPaginatedData<InventoryAdjustmentTypeObject> inventoryAdjustmentTypes(final DataFetchingEnvironment env) { 5230 CountingPaginatedData<InventoryAdjustmentTypeObject> data; 5231 5232 try { 5233 var commandForm = InventoryUtil.getHome().getGetInventoryAdjustmentTypesForm(); 5234 var command = CDI.current().select(GetInventoryAdjustmentTypesCommand.class).get(); 5235 5236 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5237 if(totalEntities == null) { 5238 data = Connections.emptyConnection(); 5239 } else { 5240 try(var objectLimiter = new ObjectLimiter(env, InventoryAdjustmentTypeConstants.COMPONENT_VENDOR_NAME, InventoryAdjustmentTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 5241 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5242 5243 var inventoryAdjustmentTypes = entities.stream() 5244 .map(InventoryAdjustmentTypeObject::new) 5245 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5246 5247 data = new CountedObjects<>(objectLimiter, inventoryAdjustmentTypes); 5248 } 5249 } 5250 } catch (NamingException ex) { 5251 throw new RuntimeException(ex); 5252 } 5253 5254 return data; 5255 } 5256 5257 @GraphQLField 5258 @GraphQLName("inventoryTransactionTypes") 5259 @GraphQLNonNull 5260 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5261 static CountingPaginatedData<InventoryTransactionTypeObject> inventoryTransactionTypes(final DataFetchingEnvironment env) { 5262 CountingPaginatedData<InventoryTransactionTypeObject> data; 5263 5264 try { 5265 var commandForm = InventoryUtil.getHome().getGetInventoryTransactionTypesForm(); 5266 var command = CDI.current().select(GetInventoryTransactionTypesCommand.class).get(); 5267 5268 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5269 if(totalEntities == null) { 5270 data = Connections.emptyConnection(); 5271 } else { 5272 try(var objectLimiter = new ObjectLimiter(env, InventoryTransactionTypeConstants.COMPONENT_VENDOR_NAME, InventoryTransactionTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 5273 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5274 5275 var inventoryTransactionTypes = entities.stream() 5276 .map(InventoryTransactionTypeObject::new) 5277 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5278 5279 data = new CountedObjects<>(objectLimiter, inventoryTransactionTypes); 5280 } 5281 } 5282 } catch (NamingException ex) { 5283 throw new RuntimeException(ex); 5284 } 5285 5286 return data; 5287 } 5288 5289 @GraphQLField 5290 @GraphQLName("lot") 5291 static LotObject lot(final DataFetchingEnvironment env, 5292 @GraphQLName("itemName") final String itemName, 5293 @GraphQLName("lotIdentifier") final String lotIdentifier, 5294 @GraphQLName("id") @GraphQLID final String id) { 5295 Lot lot; 5296 5297 try { 5298 var commandForm = InventoryUtil.getHome().getGetLotForm(); 5299 5300 commandForm.setItemName(itemName); 5301 commandForm.setLotIdentifier(lotIdentifier); 5302 commandForm.setUuid(id); 5303 5304 lot = CDI.current().select(GetLotCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5305 } catch (NamingException ex) { 5306 throw new RuntimeException(ex); 5307 } 5308 5309 return lot == null ? null : new LotObject(lot); 5310 } 5311 5312 @GraphQLField 5313 @GraphQLName("lots") 5314 @GraphQLNonNull 5315 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5316 static CountingPaginatedData<LotObject> lots(final DataFetchingEnvironment env, 5317 @GraphQLName("itemName") @GraphQLNonNull final String itemName) { 5318 CountingPaginatedData<LotObject> data; 5319 5320 try { 5321 var commandForm = InventoryUtil.getHome().getGetLotsForm(); 5322 var command = CDI.current().select(GetLotsCommand.class).get(); 5323 5324 commandForm.setItemName(itemName); 5325 5326 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5327 if(totalEntities == null) { 5328 data = Connections.emptyConnection(); 5329 } else { 5330 try(var objectLimiter = new ObjectLimiter(env, LotConstants.COMPONENT_VENDOR_NAME, LotConstants.ENTITY_TYPE_NAME, totalEntities)) { 5331 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5332 5333 var lots = entities.stream() 5334 .map(LotObject::new) 5335 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5336 5337 data = new CountedObjects<>(objectLimiter, lots); 5338 } 5339 } 5340 } catch (NamingException ex) { 5341 throw new RuntimeException(ex); 5342 } 5343 5344 return data; 5345 } 5346 5347 @GraphQLField 5348 @GraphQLName("contentPageLayout") 5349 static ContentPageLayoutObject contentPageLayout(final DataFetchingEnvironment env, 5350 @GraphQLName("contentPageLayoutName") final String contentPageLayoutName, 5351 @GraphQLName("id") @GraphQLID final String id) { 5352 ContentPageLayout contentPageLayout; 5353 5354 try { 5355 var commandForm = ContentUtil.getHome().getGetContentPageLayoutForm(); 5356 5357 commandForm.setContentPageLayoutName(contentPageLayoutName); 5358 commandForm.setUuid(id); 5359 5360 contentPageLayout = CDI.current().select(GetContentPageLayoutCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5361 } catch (NamingException ex) { 5362 throw new RuntimeException(ex); 5363 } 5364 5365 return contentPageLayout == null ? null : new ContentPageLayoutObject(contentPageLayout); 5366 } 5367 5368 @GraphQLField 5369 @GraphQLName("contentPageLayouts") 5370 @GraphQLNonNull 5371 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5372 static CountingPaginatedData<ContentPageLayoutObject> contentPageLayouts(final DataFetchingEnvironment env) { 5373 CountingPaginatedData<ContentPageLayoutObject> data; 5374 5375 try { 5376 var commandForm = ContentUtil.getHome().getGetContentPageLayoutsForm(); 5377 var command = CDI.current().select(GetContentPageLayoutsCommand.class).get(); 5378 5379 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5380 if(totalEntities == null) { 5381 data = Connections.emptyConnection(); 5382 } else { 5383 try(var objectLimiter = new ObjectLimiter(env, ContentPageLayoutConstants.COMPONENT_VENDOR_NAME, ContentPageLayoutConstants.ENTITY_TYPE_NAME, totalEntities)) { 5384 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5385 5386 var contentPageLayouts = entities.stream() 5387 .map(ContentPageLayoutObject::new) 5388 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5389 5390 data = new CountedObjects<>(objectLimiter, contentPageLayouts); 5391 } 5392 } 5393 } catch (NamingException ex) { 5394 throw new RuntimeException(ex); 5395 } 5396 5397 return data; 5398 } 5399 5400 @GraphQLField 5401 @GraphQLName("contentPageLayoutArea") 5402 static ContentPageLayoutAreaObject contentPageLayoutArea(final DataFetchingEnvironment env, 5403 @GraphQLName("contentCollectionName") @GraphQLNonNull final String contentCollectionName, 5404 @GraphQLName("contentSectionName") @GraphQLNonNull final String contentSectionName, 5405 @GraphQLName("contentPageName") @GraphQLNonNull final String contentPageName, 5406 @GraphQLName("sortOrder") @GraphQLNonNull final String sortOrder) { 5407 ContentPageLayoutArea contentPageLayoutArea; 5408 5409 try { 5410 var commandForm = ContentUtil.getHome().getGetContentPageLayoutAreaForm(); 5411 5412 commandForm.setContentCollectionName(contentCollectionName); 5413 commandForm.setContentSectionName(contentSectionName); 5414 commandForm.setContentPageName(contentPageName); 5415 commandForm.setSortOrder(sortOrder); 5416 5417 contentPageLayoutArea = CDI.current().select(GetContentPageLayoutAreaCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5418 } catch (NamingException ex) { 5419 throw new RuntimeException(ex); 5420 } 5421 5422 return contentPageLayoutArea == null ? null : new ContentPageLayoutAreaObject(contentPageLayoutArea); 5423 } 5424 5425 @GraphQLField 5426 @GraphQLName("contentPageLayoutAreas") 5427 @GraphQLNonNull 5428 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5429 static CountingPaginatedData<ContentPageLayoutAreaObject> contentPageLayoutAreas(final DataFetchingEnvironment env, 5430 @GraphQLName("contentCollectionName") @GraphQLNonNull final String contentCollectionName, 5431 @GraphQLName("contentSectionName") @GraphQLNonNull final String contentSectionName, 5432 @GraphQLName("contentPageName") @GraphQLNonNull final String contentPageName) { 5433 CountingPaginatedData<ContentPageLayoutAreaObject> data; 5434 5435 try { 5436 var commandForm = ContentUtil.getHome().getGetContentPageLayoutAreasForm(); 5437 var command = CDI.current().select(GetContentPageLayoutAreasCommand.class).get(); 5438 5439 5440 commandForm.setContentCollectionName(contentCollectionName); 5441 commandForm.setContentSectionName(contentSectionName); 5442 commandForm.setContentPageName(contentPageName); 5443 5444 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5445 if(totalEntities == null) { 5446 data = Connections.emptyConnection(); 5447 } else { 5448 try(var objectLimiter = new ObjectLimiter(env, ContentPageLayoutAreaConstants.COMPONENT_VENDOR_NAME, ContentPageLayoutAreaConstants.ENTITY_TYPE_NAME, totalEntities)) { 5449 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5450 5451 var contentPageLayoutAreas = entities.stream() 5452 .map(ContentPageLayoutAreaObject::new) 5453 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5454 5455 data = new CountedObjects<>(objectLimiter, contentPageLayoutAreas); 5456 } 5457 } 5458 } catch (NamingException ex) { 5459 throw new RuntimeException(ex); 5460 } 5461 5462 return data; 5463 } 5464 5465 @GraphQLField 5466 @GraphQLName("contentPageAreaType") 5467 static ContentPageAreaTypeObject contentPageAreaType(final DataFetchingEnvironment env, 5468 @GraphQLName("contentPageAreaTypeName") final String contentPageAreaTypeName, 5469 @GraphQLName("id") @GraphQLID final String id) { 5470 ContentPageAreaType contentPageAreaType; 5471 5472 try { 5473 var commandForm = ContentUtil.getHome().getGetContentPageAreaTypeForm(); 5474 5475 commandForm.setContentPageAreaTypeName(contentPageAreaTypeName); 5476 commandForm.setUuid(id); 5477 5478 contentPageAreaType = CDI.current().select(GetContentPageAreaTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5479 } catch (NamingException ex) { 5480 throw new RuntimeException(ex); 5481 } 5482 5483 return contentPageAreaType == null ? null : new ContentPageAreaTypeObject(contentPageAreaType); 5484 } 5485 5486 @GraphQLField 5487 @GraphQLName("contentPageAreaTypes") 5488 @GraphQLNonNull 5489 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5490 static CountingPaginatedData<ContentPageAreaTypeObject> contentPageAreaTypes(final DataFetchingEnvironment env) { 5491 CountingPaginatedData<ContentPageAreaTypeObject> data; 5492 5493 try { 5494 var commandForm = ContentUtil.getHome().getGetContentPageAreaTypesForm(); 5495 var command = CDI.current().select(GetContentPageAreaTypesCommand.class).get(); 5496 5497 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5498 if(totalEntities == null) { 5499 data = Connections.emptyConnection(); 5500 } else { 5501 try(var objectLimiter = new ObjectLimiter(env, ContentPageAreaTypeConstants.COMPONENT_VENDOR_NAME, ContentPageAreaTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 5502 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5503 5504 var contentPageAreaTypes = entities.stream() 5505 .map(ContentPageAreaTypeObject::new) 5506 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5507 5508 data = new CountedObjects<>(objectLimiter, contentPageAreaTypes); 5509 } 5510 } 5511 } catch (NamingException ex) { 5512 throw new RuntimeException(ex); 5513 } 5514 5515 return data; 5516 } 5517 5518 @GraphQLField 5519 @GraphQLName("contentWebAddress") 5520 static ContentWebAddressObject contentWebAddress(final DataFetchingEnvironment env, 5521 @GraphQLName("contentWebAddressName") @GraphQLNonNull final String contentWebAddressName) { 5522 ContentWebAddress contentWebAddress; 5523 5524 try { 5525 var commandForm = ContentUtil.getHome().getGetContentWebAddressForm(); 5526 5527 commandForm.setContentWebAddressName(contentWebAddressName); 5528 5529 contentWebAddress = CDI.current().select(GetContentWebAddressCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5530 } catch (NamingException ex) { 5531 throw new RuntimeException(ex); 5532 } 5533 5534 return contentWebAddress == null ? null : new ContentWebAddressObject(contentWebAddress); 5535 } 5536 5537 @GraphQLField 5538 @GraphQLName("contentWebAddresses") 5539 @GraphQLNonNull 5540 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5541 static CountingPaginatedData<ContentWebAddressObject> contentWebAddresses(final DataFetchingEnvironment env) { 5542 CountingPaginatedData<ContentWebAddressObject> data; 5543 5544 try { 5545 var commandForm = ContentUtil.getHome().getGetContentWebAddressesForm(); 5546 var command = CDI.current().select(GetContentWebAddressesCommand.class).get(); 5547 5548 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5549 if(totalEntities == null) { 5550 data = Connections.emptyConnection(); 5551 } else { 5552 try(var objectLimiter = new ObjectLimiter(env, ContentWebAddressConstants.COMPONENT_VENDOR_NAME, ContentWebAddressConstants.ENTITY_TYPE_NAME, totalEntities)) { 5553 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5554 5555 var contentWebAddresses = entities.stream() 5556 .map(ContentWebAddressObject::new) 5557 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5558 5559 data = new CountedObjects<>(objectLimiter, contentWebAddresses); 5560 } 5561 } 5562 } catch (NamingException ex) { 5563 throw new RuntimeException(ex); 5564 } 5565 5566 return data; 5567 } 5568 5569 @GraphQLField 5570 @GraphQLName("contentCollection") 5571 static ContentCollectionObject contentCollection(final DataFetchingEnvironment env, 5572 @GraphQLName("contentCollectionName") final String contentCollectionName) { 5573 ContentCollection contentCollection; 5574 5575 try { 5576 var commandForm = ContentUtil.getHome().getGetContentCollectionForm(); 5577 5578 commandForm.setContentCollectionName(contentCollectionName); 5579 5580 contentCollection = CDI.current().select(GetContentCollectionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5581 } catch (NamingException ex) { 5582 throw new RuntimeException(ex); 5583 } 5584 5585 return contentCollection == null ? null : new ContentCollectionObject(contentCollection); 5586 } 5587 5588 @GraphQLField 5589 @GraphQLName("contentCollections") 5590 @GraphQLNonNull 5591 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5592 static CountingPaginatedData<ContentCollectionObject> contentCollections(final DataFetchingEnvironment env) { 5593 CountingPaginatedData<ContentCollectionObject> data; 5594 5595 try { 5596 var commandForm = ContentUtil.getHome().getGetContentCollectionsForm(); 5597 var command = CDI.current().select(GetContentCollectionsCommand.class).get(); 5598 5599 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5600 if(totalEntities == null) { 5601 data = Connections.emptyConnection(); 5602 } else { 5603 try(var objectLimiter = new ObjectLimiter(env, ContentCollectionConstants.COMPONENT_VENDOR_NAME, ContentCollectionConstants.ENTITY_TYPE_NAME, totalEntities)) { 5604 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5605 5606 var contentCollections = entities.stream() 5607 .map(ContentCollectionObject::new) 5608 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5609 5610 data = new CountedObjects<>(objectLimiter, contentCollections); 5611 } 5612 } 5613 } catch (NamingException ex) { 5614 throw new RuntimeException(ex); 5615 } 5616 5617 return data; 5618 } 5619 5620 @GraphQLField 5621 @GraphQLName("contentSection") 5622 static ContentSectionObject contentSection(final DataFetchingEnvironment env, 5623 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5624 @GraphQLName("contentCollectionName") final String contentCollectionName, 5625 @GraphQLName("contentSectionName") final String contentSectionName, 5626 @GraphQLName("associateProgramName") final String associateProgramName, 5627 @GraphQLName("associateName") final String associateName, 5628 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5629 ContentSection contentSection; 5630 5631 try { 5632 var commandForm = ContentUtil.getHome().getGetContentSectionForm(); 5633 5634 commandForm.setContentWebAddressName(contentWebAddressName); 5635 commandForm.setContentCollectionName(contentCollectionName); 5636 commandForm.setContentSectionName(contentSectionName); 5637 commandForm.setAssociateProgramName(associateProgramName); 5638 commandForm.setAssociateName(associateName); 5639 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5640 5641 contentSection = CDI.current().select(GetContentSectionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5642 } catch (NamingException ex) { 5643 throw new RuntimeException(ex); 5644 } 5645 5646 return contentSection == null ? null : new ContentSectionObject(contentSection); 5647 } 5648 5649 @GraphQLField 5650 @GraphQLName("contentSections") 5651 @GraphQLNonNull 5652 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5653 static CountingPaginatedData<ContentSectionObject> contentSections(final DataFetchingEnvironment env, 5654 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5655 @GraphQLName("contentCollectionName") final String contentCollectionName, 5656 @GraphQLName("parentContentSectionName") final String parentContentSectionName, 5657 @GraphQLName("associateProgramName") final String associateProgramName, 5658 @GraphQLName("associateName") final String associateName, 5659 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5660 CountingPaginatedData<ContentSectionObject> data; 5661 5662 try { 5663 var commandForm = ContentUtil.getHome().getGetContentSectionsForm(); 5664 var command = CDI.current().select(GetContentSectionsCommand.class).get(); 5665 5666 commandForm.setContentWebAddressName(contentWebAddressName); 5667 commandForm.setContentCollectionName(contentCollectionName); 5668 commandForm.setParentContentSectionName(parentContentSectionName); 5669 commandForm.setAssociateProgramName(associateProgramName); 5670 commandForm.setAssociateName(associateName); 5671 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5672 5673 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5674 if(totalEntities == null) { 5675 data = Connections.emptyConnection(); 5676 } else { 5677 try(var objectLimiter = new ObjectLimiter(env, ContentSectionConstants.COMPONENT_VENDOR_NAME, ContentSectionConstants.ENTITY_TYPE_NAME, totalEntities)) { 5678 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5679 5680 var contentSections = entities.stream() 5681 .map(ContentSectionObject::new) 5682 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5683 5684 data = new CountedObjects<>(objectLimiter, contentSections); 5685 } 5686 } 5687 } catch (NamingException ex) { 5688 throw new RuntimeException(ex); 5689 } 5690 5691 return data; 5692 } 5693 5694 @GraphQLField 5695 @GraphQLName("contentPage") 5696 static ContentPageObject contentPage(final DataFetchingEnvironment env, 5697 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5698 @GraphQLName("contentCollectionName") final String contentCollectionName, 5699 @GraphQLName("contentSectionName") final String contentSectionName, 5700 @GraphQLName("contentPageName") final String contentPageName, 5701 @GraphQLName("associateProgramName") final String associateProgramName, 5702 @GraphQLName("associateName") final String associateName, 5703 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5704 ContentPage contentPage; 5705 5706 try { 5707 var commandForm = ContentUtil.getHome().getGetContentPageForm(); 5708 5709 commandForm.setContentWebAddressName(contentWebAddressName); 5710 commandForm.setContentCollectionName(contentCollectionName); 5711 commandForm.setContentSectionName(contentSectionName); 5712 commandForm.setContentPageName(contentPageName); 5713 commandForm.setAssociateProgramName(associateProgramName); 5714 commandForm.setAssociateName(associateName); 5715 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5716 5717 contentPage = CDI.current().select(GetContentPageCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5718 } catch (NamingException ex) { 5719 throw new RuntimeException(ex); 5720 } 5721 5722 return contentPage == null ? null : new ContentPageObject(contentPage); 5723 } 5724 5725 @GraphQLField 5726 @GraphQLName("contentPages") 5727 @GraphQLNonNull 5728 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5729 static CountingPaginatedData<ContentPageObject> contentPages(final DataFetchingEnvironment env, 5730 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5731 @GraphQLName("contentCollectionName") final String contentCollectionName, 5732 @GraphQLName("contentSectionName") final String contentSectionName, 5733 @GraphQLName("associateProgramName") final String associateProgramName, 5734 @GraphQLName("associateName") final String associateName, 5735 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5736 CountingPaginatedData<ContentPageObject> data; 5737 5738 try { 5739 var commandForm = ContentUtil.getHome().getGetContentPagesForm(); 5740 var command = CDI.current().select(GetContentPagesCommand.class).get(); 5741 5742 commandForm.setContentWebAddressName(contentWebAddressName); 5743 commandForm.setContentCollectionName(contentCollectionName); 5744 commandForm.setContentSectionName(contentSectionName); 5745 commandForm.setAssociateProgramName(associateProgramName); 5746 commandForm.setAssociateName(associateName); 5747 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5748 5749 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5750 if(totalEntities == null) { 5751 data = Connections.emptyConnection(); 5752 } else { 5753 try(var objectLimiter = new ObjectLimiter(env, ContentPageConstants.COMPONENT_VENDOR_NAME, ContentPageConstants.ENTITY_TYPE_NAME, totalEntities)) { 5754 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5755 5756 var contentPages = entities.stream() 5757 .map(ContentPageObject::new) 5758 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5759 5760 data = new CountedObjects<>(objectLimiter, contentPages); 5761 } 5762 } 5763 } catch (NamingException ex) { 5764 throw new RuntimeException(ex); 5765 } 5766 5767 return data; 5768 } 5769 5770 @GraphQLField 5771 @GraphQLName("contentPageArea") 5772 static ContentPageAreaObject contentPageArea(final DataFetchingEnvironment env, 5773 @GraphQLName("contentCollectionName") @GraphQLNonNull final String contentCollectionName, 5774 @GraphQLName("contentSectionName") @GraphQLNonNull final String contentSectionName, 5775 @GraphQLName("contentPageName") @GraphQLNonNull final String contentPageName, 5776 @GraphQLName("sortOrder") @GraphQLNonNull final String sortOrder, 5777 @GraphQLName("languageIsoName") @GraphQLNonNull final String languageIsoName) { 5778 ContentPageArea contentPageArea; 5779 5780 try { 5781 var commandForm = ContentUtil.getHome().getGetContentPageAreaForm(); 5782 5783 commandForm.setContentCollectionName(contentCollectionName); 5784 commandForm.setContentSectionName(contentSectionName); 5785 commandForm.setContentPageName(contentPageName); 5786 commandForm.setSortOrder(sortOrder); 5787 commandForm.setLanguageIsoName(languageIsoName); 5788 5789 contentPageArea = CDI.current().select(GetContentPageAreaCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5790 } catch (NamingException ex) { 5791 throw new RuntimeException(ex); 5792 } 5793 5794 return contentPageArea == null ? null : new ContentPageAreaObject(contentPageArea); 5795 } 5796 5797 @GraphQLField 5798 @GraphQLName("contentPageAreas") 5799 @GraphQLNonNull 5800 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5801 static CountingPaginatedData<ContentPageAreaObject> contentPageAreas(final DataFetchingEnvironment env, 5802 @GraphQLName("contentCollectionName") @GraphQLNonNull final String contentCollectionName, 5803 @GraphQLName("contentSectionName") @GraphQLNonNull final String contentSectionName, 5804 @GraphQLName("contentPageName") @GraphQLNonNull final String contentPageName) { 5805 CountingPaginatedData<ContentPageAreaObject> data; 5806 5807 try { 5808 var commandForm = ContentUtil.getHome().getGetContentPageAreasForm(); 5809 var command = CDI.current().select(GetContentPageAreasCommand.class).get(); 5810 5811 5812 commandForm.setContentCollectionName(contentCollectionName); 5813 commandForm.setContentSectionName(contentSectionName); 5814 commandForm.setContentPageName(contentPageName); 5815 5816 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5817 if(totalEntities == null) { 5818 data = Connections.emptyConnection(); 5819 } else { 5820 try(var objectLimiter = new ObjectLimiter(env, ContentPageAreaConstants.COMPONENT_VENDOR_NAME, ContentPageAreaConstants.ENTITY_TYPE_NAME, totalEntities)) { 5821 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5822 5823 var contentPageAreas = entities.stream() 5824 .map(ContentPageAreaObject::new) 5825 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5826 5827 data = new CountedObjects<>(objectLimiter, contentPageAreas); 5828 } 5829 } 5830 } catch (NamingException ex) { 5831 throw new RuntimeException(ex); 5832 } 5833 5834 return data; 5835 } 5836 5837 5838 @GraphQLField 5839 @GraphQLName("contentCatalog") 5840 static ContentCatalogObject contentCatalog(final DataFetchingEnvironment env, 5841 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5842 @GraphQLName("contentCollectionName") final String contentCollectionName, 5843 @GraphQLName("contentCatalogName") final String contentCatalogName, 5844 @GraphQLName("associateProgramName") final String associateProgramName, 5845 @GraphQLName("associateName") final String associateName, 5846 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5847 ContentCatalog contentCatalog; 5848 5849 try { 5850 var commandForm = ContentUtil.getHome().getGetContentCatalogForm(); 5851 5852 commandForm.setContentWebAddressName(contentWebAddressName); 5853 commandForm.setContentCollectionName(contentCollectionName); 5854 commandForm.setContentCatalogName(contentCatalogName); 5855 commandForm.setAssociateProgramName(associateProgramName); 5856 commandForm.setAssociateName(associateName); 5857 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5858 5859 contentCatalog = CDI.current().select(GetContentCatalogCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5860 } catch (NamingException ex) { 5861 throw new RuntimeException(ex); 5862 } 5863 5864 return contentCatalog == null ? null : new ContentCatalogObject(contentCatalog); 5865 } 5866 5867 @GraphQLField 5868 @GraphQLName("contentCatalogs") 5869 @GraphQLNonNull 5870 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5871 static CountingPaginatedData<ContentCatalogObject> contentCatalogs(final DataFetchingEnvironment env, 5872 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5873 @GraphQLName("contentCollectionName") final String contentCollectionName, 5874 @GraphQLName("associateProgramName") final String associateProgramName, 5875 @GraphQLName("associateName") final String associateName, 5876 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5877 CountingPaginatedData<ContentCatalogObject> data; 5878 5879 try { 5880 var commandForm = ContentUtil.getHome().getGetContentCatalogsForm(); 5881 var command = CDI.current().select(GetContentCatalogsCommand.class).get(); 5882 5883 commandForm.setContentWebAddressName(contentWebAddressName); 5884 commandForm.setContentCollectionName(contentCollectionName); 5885 commandForm.setAssociateProgramName(associateProgramName); 5886 commandForm.setAssociateName(associateName); 5887 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5888 5889 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5890 if(totalEntities == null) { 5891 data = Connections.emptyConnection(); 5892 } else { 5893 try(var objectLimiter = new ObjectLimiter(env, ContentCatalogConstants.COMPONENT_VENDOR_NAME, ContentCatalogConstants.ENTITY_TYPE_NAME, totalEntities)) { 5894 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5895 5896 var contentCatalogs = entities.stream() 5897 .map(ContentCatalogObject::new) 5898 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5899 5900 data = new CountedObjects<>(objectLimiter, contentCatalogs); 5901 } 5902 } 5903 } catch (NamingException ex) { 5904 throw new RuntimeException(ex); 5905 } 5906 5907 return data; 5908 } 5909 5910 @GraphQLField 5911 @GraphQLName("contentCatalogItem") 5912 static ContentCatalogItemObject contentCatalogItem(final DataFetchingEnvironment env, 5913 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5914 @GraphQLName("contentCollectionName") final String contentCollectionName, 5915 @GraphQLName("contentCatalogName") final String contentCatalogName, 5916 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 5917 @GraphQLName("inventoryConditionName") final String inventoryConditionName, 5918 @GraphQLName("unitOfMeasureTypeName") final String unitOfMeasureTypeName, 5919 @GraphQLName("currencyIsoName") final String currencyIsoName, 5920 @GraphQLName("associateProgramName") final String associateProgramName, 5921 @GraphQLName("associateName") final String associateName, 5922 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5923 ContentCatalogItem contentCatalogItem; 5924 5925 try { 5926 var commandForm = ContentUtil.getHome().getGetContentCatalogItemForm(); 5927 5928 commandForm.setContentWebAddressName(contentWebAddressName); 5929 commandForm.setContentCollectionName(contentCollectionName); 5930 commandForm.setContentCatalogName(contentCatalogName); 5931 commandForm.setItemName(itemName); 5932 commandForm.setInventoryConditionName(inventoryConditionName); 5933 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 5934 commandForm.setCurrencyIsoName(currencyIsoName); 5935 commandForm.setAssociateProgramName(associateProgramName); 5936 commandForm.setAssociateName(associateName); 5937 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5938 5939 contentCatalogItem = CDI.current().select(GetContentCatalogItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5940 } catch (NamingException ex) { 5941 throw new RuntimeException(ex); 5942 } 5943 5944 return contentCatalogItem == null ? null : new ContentCatalogItemObject(contentCatalogItem); 5945 } 5946 5947 @GraphQLField 5948 @GraphQLName("contentCatalogItems") 5949 @GraphQLNonNull 5950 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5951 static CountingPaginatedData<ContentCatalogItemObject> contentCatalogItems(final DataFetchingEnvironment env, 5952 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5953 @GraphQLName("contentCollectionName") final String contentCollectionName, 5954 @GraphQLName("contentCatalogName") final String contentCatalogName, 5955 @GraphQLName("associateProgramName") final String associateProgramName, 5956 @GraphQLName("associateName") final String associateName, 5957 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5958 CountingPaginatedData<ContentCatalogItemObject> data; 5959 5960 try { 5961 var commandForm = ContentUtil.getHome().getGetContentCatalogItemsForm(); 5962 var command = CDI.current().select(GetContentCatalogItemsCommand.class).get(); 5963 5964 commandForm.setContentWebAddressName(contentWebAddressName); 5965 commandForm.setContentCollectionName(contentCollectionName); 5966 commandForm.setContentCatalogName(contentCatalogName); 5967 commandForm.setAssociateProgramName(associateProgramName); 5968 commandForm.setAssociateName(associateName); 5969 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5970 5971 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5972 if(totalEntities == null) { 5973 data = Connections.emptyConnection(); 5974 } else { 5975 try(var objectLimiter = new ObjectLimiter(env, ContentCatalogItemConstants.COMPONENT_VENDOR_NAME, ContentCatalogItemConstants.ENTITY_TYPE_NAME, totalEntities)) { 5976 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5977 5978 var contentCatalogItems = entities.stream() 5979 .map(ContentCatalogItemObject::new) 5980 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5981 5982 data = new CountedObjects<>(objectLimiter, contentCatalogItems); 5983 } 5984 } 5985 } catch (NamingException ex) { 5986 throw new RuntimeException(ex); 5987 } 5988 5989 return data; 5990 } 5991 5992 @GraphQLField 5993 @GraphQLName("contentCategory") 5994 static ContentCategoryObject contentCategory(final DataFetchingEnvironment env, 5995 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5996 @GraphQLName("contentCollectionName") final String contentCollectionName, 5997 @GraphQLName("contentCatalogName") final String contentCatalogName, 5998 @GraphQLName("contentCategoryName") final String contentCategoryName, 5999 @GraphQLName("associateProgramName") final String associateProgramName, 6000 @GraphQLName("associateName") final String associateName, 6001 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 6002 ContentCategory contentCategory; 6003 6004 try { 6005 var commandForm = ContentUtil.getHome().getGetContentCategoryForm(); 6006 6007 commandForm.setContentWebAddressName(contentWebAddressName); 6008 commandForm.setContentCollectionName(contentCollectionName); 6009 commandForm.setContentCatalogName(contentCatalogName); 6010 commandForm.setContentCategoryName(contentCategoryName); 6011 commandForm.setAssociateProgramName(associateProgramName); 6012 commandForm.setAssociateName(associateName); 6013 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 6014 6015 contentCategory = CDI.current().select(GetContentCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6016 } catch (NamingException ex) { 6017 throw new RuntimeException(ex); 6018 } 6019 6020 return contentCategory == null ? null : new ContentCategoryObject(contentCategory); 6021 } 6022 6023 @GraphQLField 6024 @GraphQLName("contentCategories") 6025 @GraphQLNonNull 6026 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6027 static CountingPaginatedData<ContentCategoryObject> contentCategories(final DataFetchingEnvironment env, 6028 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 6029 @GraphQLName("contentCollectionName") final String contentCollectionName, 6030 @GraphQLName("contentCatalogName") final String contentCatalogName, 6031 @GraphQLName("parentContentCategoryName") final String parentContentCategoryName, 6032 @GraphQLName("associateProgramName") final String associateProgramName, 6033 @GraphQLName("associateName") final String associateName, 6034 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 6035 CountingPaginatedData<ContentCategoryObject> data; 6036 6037 try { 6038 var commandForm = ContentUtil.getHome().getGetContentCategoriesForm(); 6039 var command = CDI.current().select(GetContentCategoriesCommand.class).get(); 6040 6041 commandForm.setContentWebAddressName(contentWebAddressName); 6042 commandForm.setContentCollectionName(contentCollectionName); 6043 commandForm.setContentCatalogName(contentCatalogName); 6044 commandForm.setParentContentCategoryName(parentContentCategoryName); 6045 commandForm.setAssociateProgramName(associateProgramName); 6046 commandForm.setAssociateName(associateName); 6047 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 6048 6049 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6050 if(totalEntities == null) { 6051 data = Connections.emptyConnection(); 6052 } else { 6053 try(var objectLimiter = new ObjectLimiter(env, ContentCategoryConstants.COMPONENT_VENDOR_NAME, ContentCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 6054 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6055 6056 var contentCategories = entities.stream() 6057 .map(ContentCategoryObject::new) 6058 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6059 6060 data = new CountedObjects<>(objectLimiter, contentCategories); 6061 } 6062 } 6063 } catch (NamingException ex) { 6064 throw new RuntimeException(ex); 6065 } 6066 6067 return data; 6068 } 6069 6070 @GraphQLField 6071 @GraphQLName("contentCategoryItem") 6072 static ContentCategoryItemObject contentCategoryItem(final DataFetchingEnvironment env, 6073 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 6074 @GraphQLName("contentCollectionName") final String contentCollectionName, 6075 @GraphQLName("contentCatalogName") final String contentCatalogName, 6076 @GraphQLName("contentCategoryName") final String contentCategoryName, 6077 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 6078 @GraphQLName("inventoryConditionName") final String inventoryConditionName, 6079 @GraphQLName("unitOfMeasureTypeName") final String unitOfMeasureTypeName, 6080 @GraphQLName("currencyIsoName") final String currencyIsoName, 6081 @GraphQLName("associateProgramName") final String associateProgramName, 6082 @GraphQLName("associateName") final String associateName, 6083 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 6084 ContentCategoryItem contentCategoryItem; 6085 6086 try { 6087 var commandForm = ContentUtil.getHome().getGetContentCategoryItemForm(); 6088 6089 commandForm.setContentWebAddressName(contentWebAddressName); 6090 commandForm.setContentCollectionName(contentCollectionName); 6091 commandForm.setContentCatalogName(contentCatalogName); 6092 commandForm.setContentCategoryName(contentCategoryName); 6093 commandForm.setItemName(itemName); 6094 commandForm.setInventoryConditionName(inventoryConditionName); 6095 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 6096 commandForm.setCurrencyIsoName(currencyIsoName); 6097 commandForm.setAssociateProgramName(associateProgramName); 6098 commandForm.setAssociateName(associateName); 6099 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 6100 6101 contentCategoryItem = CDI.current().select(GetContentCategoryItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6102 } catch (NamingException ex) { 6103 throw new RuntimeException(ex); 6104 } 6105 6106 return contentCategoryItem == null ? null : new ContentCategoryItemObject(contentCategoryItem); 6107 } 6108 6109 @GraphQLField 6110 @GraphQLName("contentCategoryItems") 6111 @GraphQLNonNull 6112 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6113 static CountingPaginatedData<ContentCategoryItemObject> contentCategoryItems(final DataFetchingEnvironment env, 6114 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 6115 @GraphQLName("contentCollectionName") final String contentCollectionName, 6116 @GraphQLName("contentCatalogName") final String contentCatalogName, 6117 @GraphQLName("contentCategoryName") final String contentCategoryName, 6118 @GraphQLName("associateProgramName") final String associateProgramName, 6119 @GraphQLName("associateName") final String associateName, 6120 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 6121 CountingPaginatedData<ContentCategoryItemObject> data; 6122 6123 try { 6124 var commandForm = ContentUtil.getHome().getGetContentCategoryItemsForm(); 6125 var command = CDI.current().select(GetContentCategoryItemsCommand.class).get(); 6126 6127 commandForm.setContentWebAddressName(contentWebAddressName); 6128 commandForm.setContentCollectionName(contentCollectionName); 6129 commandForm.setContentCatalogName(contentCatalogName); 6130 commandForm.setContentCategoryName(contentCategoryName); 6131 commandForm.setAssociateProgramName(associateProgramName); 6132 commandForm.setAssociateName(associateName); 6133 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 6134 6135 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6136 if(totalEntities == null) { 6137 data = Connections.emptyConnection(); 6138 } else { 6139 try(var objectLimiter = new ObjectLimiter(env, ContentCategoryItemConstants.COMPONENT_VENDOR_NAME, ContentCategoryItemConstants.ENTITY_TYPE_NAME, totalEntities)) { 6140 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6141 6142 var contentCategoryItems = entities.stream() 6143 .map(ContentCategoryItemObject::new) 6144 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6145 6146 data = new CountedObjects<>(objectLimiter, contentCategoryItems); 6147 } 6148 } 6149 } catch (NamingException ex) { 6150 throw new RuntimeException(ex); 6151 } 6152 6153 return data; 6154 } 6155 6156 @GraphQLField 6157 @GraphQLName("mimeTypeFileExtension") 6158 static MimeTypeFileExtensionObject mimeTypeFileExtension(final DataFetchingEnvironment env, 6159 @GraphQLName("fileExtension") @GraphQLNonNull final String fileExtension) { 6160 MimeTypeFileExtension mimeTypeFileExtension; 6161 6162 try { 6163 var commandForm = CoreUtil.getHome().getGetMimeTypeFileExtensionForm(); 6164 6165 commandForm.setFileExtension(fileExtension); 6166 6167 mimeTypeFileExtension = CDI.current().select(GetMimeTypeFileExtensionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6168 } catch (NamingException ex) { 6169 throw new RuntimeException(ex); 6170 } 6171 6172 return mimeTypeFileExtension == null ? null : new MimeTypeFileExtensionObject(mimeTypeFileExtension); 6173 } 6174 6175 @GraphQLField 6176 @GraphQLName("mimeTypeFileExtensions") 6177 static Collection<MimeTypeFileExtensionObject> mimeTypeFileExtensions(final DataFetchingEnvironment env) { 6178 Collection<MimeTypeFileExtension> mimeTypeFileExtensions; 6179 Collection<MimeTypeFileExtensionObject> mimeTypeFileExtensionObjects; 6180 6181 try { 6182 var commandForm = CoreUtil.getHome().getGetMimeTypeFileExtensionsForm(); 6183 6184 mimeTypeFileExtensions = CDI.current().select(GetMimeTypeFileExtensionsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6185 } catch (NamingException ex) { 6186 throw new RuntimeException(ex); 6187 } 6188 6189 if(mimeTypeFileExtensions == null) { 6190 mimeTypeFileExtensionObjects = emptyList(); 6191 } else { 6192 mimeTypeFileExtensionObjects = new ArrayList<>(mimeTypeFileExtensions.size()); 6193 6194 mimeTypeFileExtensions.stream() 6195 .map(MimeTypeFileExtensionObject::new) 6196 .forEachOrdered(mimeTypeFileExtensionObjects::add); 6197 } 6198 6199 return mimeTypeFileExtensionObjects; 6200 } 6201 6202 @GraphQLField 6203 @GraphQLName("mimeTypeUsageType") 6204 static MimeTypeUsageTypeObject mimeTypeUsageType(final DataFetchingEnvironment env, 6205 @GraphQLName("mimeTypeUsageTypeName") @GraphQLNonNull final String mimeTypeUsageTypeName) { 6206 MimeTypeUsageType mimeTypeUsageType; 6207 6208 try { 6209 var commandForm = CoreUtil.getHome().getGetMimeTypeUsageTypeForm(); 6210 6211 commandForm.setMimeTypeUsageTypeName(mimeTypeUsageTypeName); 6212 6213 mimeTypeUsageType = CDI.current().select(GetMimeTypeUsageTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6214 } catch (NamingException ex) { 6215 throw new RuntimeException(ex); 6216 } 6217 6218 return mimeTypeUsageType == null ? null : new MimeTypeUsageTypeObject(mimeTypeUsageType); 6219 } 6220 6221 @GraphQLField 6222 @GraphQLName("mimeTypeUsageTypes") 6223 @GraphQLNonNull 6224 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6225 static CountingPaginatedData<MimeTypeUsageTypeObject> mimeTypeUsageTypes(final DataFetchingEnvironment env) { 6226 CountingPaginatedData<MimeTypeUsageTypeObject> data; 6227 6228 try { 6229 var commandForm = CoreUtil.getHome().getGetMimeTypeUsageTypesForm(); 6230 var command = CDI.current().select(GetMimeTypeUsageTypesCommand.class).get(); 6231 6232 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6233 if(totalEntities == null) { 6234 data = Connections.emptyConnection(); 6235 } else { 6236 try(var objectLimiter = new ObjectLimiter(env, com.echothree.model.data.core.common.MimeTypeUsageTypeConstants.COMPONENT_VENDOR_NAME, com.echothree.model.data.core.common.MimeTypeUsageTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6237 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6238 6239 var mimeTypeUsageTypes = entities.stream() 6240 .map(MimeTypeUsageTypeObject::new) 6241 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6242 6243 data = new CountedObjects<>(objectLimiter, mimeTypeUsageTypes); 6244 } 6245 } 6246 } catch (NamingException ex) { 6247 throw new RuntimeException(ex); 6248 } 6249 6250 return data; 6251 } 6252 6253 @GraphQLField 6254 @GraphQLName("mimeType") 6255 static MimeTypeObject mimeType(final DataFetchingEnvironment env, 6256 @GraphQLName("mimeTypeName") @GraphQLNonNull final String mimeTypeName) { 6257 MimeType mimeType; 6258 6259 try { 6260 var commandForm = CoreUtil.getHome().getGetMimeTypeForm(); 6261 6262 commandForm.setMimeTypeName(mimeTypeName); 6263 6264 mimeType = CDI.current().select(GetMimeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6265 } catch (NamingException ex) { 6266 throw new RuntimeException(ex); 6267 } 6268 6269 return mimeType == null ? null : new MimeTypeObject(mimeType); 6270 } 6271 6272 @GraphQLField 6273 @GraphQLName("mimeTypes") 6274 @GraphQLNonNull 6275 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6276 static CountingPaginatedData<MimeTypeObject> mimeTypes(final DataFetchingEnvironment env, 6277 @GraphQLName("mimeTypeUsageTypeName") final String mimeTypeUsageTypeName) { 6278 CountingPaginatedData<MimeTypeObject> data; 6279 6280 try { 6281 var commandForm = CoreUtil.getHome().getGetMimeTypesForm(); 6282 var command = CDI.current().select(GetMimeTypesCommand.class).get(); 6283 6284 commandForm.setMimeTypeUsageTypeName(mimeTypeUsageTypeName); 6285 6286 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6287 if(totalEntities == null) { 6288 data = Connections.emptyConnection(); 6289 } else { 6290 try(var objectLimiter = new ObjectLimiter(env, MimeTypeConstants.COMPONENT_VENDOR_NAME, MimeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6291 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6292 6293 var mimeTypes = entities.stream() 6294 .map(MimeTypeObject::new) 6295 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6296 6297 data = new CountedObjects<>(objectLimiter, mimeTypes); 6298 } 6299 } 6300 } catch (NamingException ex) { 6301 throw new RuntimeException(ex); 6302 } 6303 6304 return data; 6305 } 6306 6307 @GraphQLField 6308 @GraphQLName("queueType") 6309 static QueueTypeObject queueType(final DataFetchingEnvironment env, 6310 @GraphQLName("queueTypeName") @GraphQLNonNull final String queueTypeName) { 6311 QueueType queueType; 6312 6313 try { 6314 var commandForm = QueueUtil.getHome().getGetQueueTypeForm(); 6315 6316 commandForm.setQueueTypeName(queueTypeName); 6317 6318 queueType = CDI.current().select(GetQueueTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6319 } catch (NamingException ex) { 6320 throw new RuntimeException(ex); 6321 } 6322 6323 return queueType == null ? null : new QueueTypeObject(queueType); 6324 } 6325 6326 @GraphQLField 6327 @GraphQLName("queueTypes") 6328 @GraphQLNonNull 6329 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6330 static CountingPaginatedData<QueueTypeObject> queueTypes(final DataFetchingEnvironment env) { 6331 CountingPaginatedData<QueueTypeObject> data; 6332 6333 try { 6334 var commandForm = QueueUtil.getHome().getGetQueueTypesForm(); 6335 var command = CDI.current().select(GetQueueTypesCommand.class).get(); 6336 6337 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6338 if(totalEntities == null) { 6339 data = Connections.emptyConnection(); 6340 } else { 6341 try(var objectLimiter = new ObjectLimiter(env, QueueTypeConstants.COMPONENT_VENDOR_NAME, QueueTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6342 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6343 6344 var queueTypes = entities.stream() 6345 .map(QueueTypeObject::new) 6346 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6347 6348 data = new CountedObjects<>(objectLimiter, queueTypes); 6349 } 6350 } 6351 } catch (NamingException ex) { 6352 throw new RuntimeException(ex); 6353 } 6354 6355 return data; 6356 } 6357 6358 @GraphQLField 6359 @GraphQLName("unitOfMeasureKindUse") 6360 static UnitOfMeasureKindUseObject unitOfMeasureKindUse(final DataFetchingEnvironment env, 6361 @GraphQLName("unitOfMeasureKindUseTypeName") @GraphQLNonNull final String unitOfMeasureKindUseTypeName, 6362 @GraphQLName("unitOfMeasureKindName") @GraphQLNonNull final String unitOfMeasureKindName) { 6363 UnitOfMeasureKindUse unitOfMeasureKindUse; 6364 6365 try { 6366 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindUseForm(); 6367 6368 commandForm.setUnitOfMeasureKindUseTypeName(unitOfMeasureKindUseTypeName); 6369 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 6370 6371 unitOfMeasureKindUse = CDI.current().select(GetUnitOfMeasureKindUseCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6372 } catch (NamingException ex) { 6373 throw new RuntimeException(ex); 6374 } 6375 6376 return unitOfMeasureKindUse == null ? null : new UnitOfMeasureKindUseObject(unitOfMeasureKindUse); 6377 } 6378 6379 @GraphQLField 6380 @GraphQLName("unitOfMeasureKindUses") 6381 @GraphQLNonNull 6382 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6383 static CountingPaginatedData<UnitOfMeasureKindUseObject> unitOfMeasureKindUses(final DataFetchingEnvironment env, 6384 @GraphQLName("unitOfMeasureKindUseTypeName") final String unitOfMeasureKindUseTypeName, 6385 @GraphQLName("unitOfMeasureKindName") final String unitOfMeasureKindName) { 6386 CountingPaginatedData<UnitOfMeasureKindUseObject> data; 6387 6388 try { 6389 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindUsesForm(); 6390 var command = CDI.current().select(GetUnitOfMeasureKindUsesCommand.class).get(); 6391 6392 commandForm.setUnitOfMeasureKindUseTypeName(unitOfMeasureKindUseTypeName); 6393 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 6394 6395 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6396 if(totalEntities == null) { 6397 data = Connections.emptyConnection(); 6398 } else { 6399 try(var objectLimiter = new ObjectLimiter(env, UnitOfMeasureKindUseConstants.COMPONENT_VENDOR_NAME, UnitOfMeasureKindUseConstants.ENTITY_TYPE_NAME, totalEntities)) { 6400 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6401 6402 var unitOfMeasureKindUses = entities.stream() 6403 .map(UnitOfMeasureKindUseObject::new) 6404 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6405 6406 data = new CountedObjects<>(objectLimiter, unitOfMeasureKindUses); 6407 } 6408 } 6409 } catch (NamingException ex) { 6410 throw new RuntimeException(ex); 6411 } 6412 6413 return data; 6414 } 6415 6416 @GraphQLField 6417 @GraphQLName("unitOfMeasureType") 6418 static UnitOfMeasureTypeObject unitOfMeasureType(final DataFetchingEnvironment env, 6419 @GraphQLName("unitOfMeasureKindName") @GraphQLNonNull final String unitOfMeasureKindName, 6420 @GraphQLName("unitOfMeasureTypeName") @GraphQLNonNull final String unitOfMeasureTypeName) { 6421 UnitOfMeasureType unitOfMeasureType; 6422 6423 try { 6424 var commandForm = UomUtil.getHome().getGetUnitOfMeasureTypeForm(); 6425 6426 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 6427 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 6428 6429 unitOfMeasureType = CDI.current().select(GetUnitOfMeasureTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6430 } catch (NamingException ex) { 6431 throw new RuntimeException(ex); 6432 } 6433 6434 return unitOfMeasureType == null ? null : new UnitOfMeasureTypeObject(unitOfMeasureType); 6435 } 6436 6437 @GraphQLField 6438 @GraphQLName("unitOfMeasureTypes") 6439 @GraphQLNonNull 6440 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6441 static CountingPaginatedData<UnitOfMeasureTypeObject> unitOfMeasureTypes(final DataFetchingEnvironment env, 6442 @GraphQLName("unitOfMeasureKindName") @GraphQLNonNull final String unitOfMeasureKindName) { 6443 CountingPaginatedData<UnitOfMeasureTypeObject> data; 6444 6445 try { 6446 var commandForm = UomUtil.getHome().getGetUnitOfMeasureTypesForm(); 6447 var command = CDI.current().select(GetUnitOfMeasureTypesCommand.class).get(); 6448 6449 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 6450 6451 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6452 if(totalEntities == null) { 6453 data = Connections.emptyConnection(); 6454 } else { 6455 try(var objectLimiter = new ObjectLimiter(env, UnitOfMeasureTypeConstants.COMPONENT_VENDOR_NAME, UnitOfMeasureTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6456 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6457 6458 var unitOfMeasureTypes = entities.stream() 6459 .map(UnitOfMeasureTypeObject::new) 6460 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6461 6462 data = new CountedObjects<>(objectLimiter, unitOfMeasureTypes); 6463 } 6464 } 6465 } catch (NamingException ex) { 6466 throw new RuntimeException(ex); 6467 } 6468 6469 return data; 6470 } 6471 6472 @GraphQLField 6473 @GraphQLName("unitOfMeasureKind") 6474 static UnitOfMeasureKindObject unitOfMeasureKind(final DataFetchingEnvironment env, 6475 @GraphQLName("unitOfMeasureKindName") @GraphQLNonNull final String unitOfMeasureKindName) { 6476 UnitOfMeasureKind unitOfMeasureKind; 6477 6478 try { 6479 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindForm(); 6480 6481 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 6482 6483 unitOfMeasureKind = CDI.current().select(GetUnitOfMeasureKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6484 } catch (NamingException ex) { 6485 throw new RuntimeException(ex); 6486 } 6487 6488 return unitOfMeasureKind == null ? null : new UnitOfMeasureKindObject(unitOfMeasureKind); 6489 } 6490 6491 @GraphQLField 6492 @GraphQLName("unitOfMeasureKinds") 6493 @GraphQLNonNull 6494 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6495 static CountingPaginatedData<UnitOfMeasureKindObject> unitOfMeasureKinds(final DataFetchingEnvironment env) { 6496 CountingPaginatedData<UnitOfMeasureKindObject> data; 6497 6498 try { 6499 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindsForm(); 6500 var command = CDI.current().select(GetUnitOfMeasureKindsCommand.class).get(); 6501 6502 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6503 if(totalEntities == null) { 6504 data = Connections.emptyConnection(); 6505 } else { 6506 try(var objectLimiter = new ObjectLimiter(env, UnitOfMeasureKindConstants.COMPONENT_VENDOR_NAME, UnitOfMeasureKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 6507 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6508 6509 var unitOfMeasureKinds = entities.stream() 6510 .map(UnitOfMeasureKindObject::new) 6511 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6512 6513 data = new CountedObjects<>(objectLimiter, unitOfMeasureKinds); 6514 } 6515 } 6516 } catch (NamingException ex) { 6517 throw new RuntimeException(ex); 6518 } 6519 6520 return data; 6521 } 6522 6523 @GraphQLField 6524 @GraphQLName("unitOfMeasureKindUseType") 6525 static UnitOfMeasureKindUseTypeObject unitOfMeasureKindUseType(final DataFetchingEnvironment env, 6526 @GraphQLName("unitOfMeasureKindUseTypeName") @GraphQLNonNull final String unitOfMeasureKindUseTypeName) { 6527 UnitOfMeasureKindUseType unitOfMeasureKindUseType; 6528 6529 try { 6530 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindUseTypeForm(); 6531 6532 commandForm.setUnitOfMeasureKindUseTypeName(unitOfMeasureKindUseTypeName); 6533 6534 unitOfMeasureKindUseType = CDI.current().select(GetUnitOfMeasureKindUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6535 } catch (NamingException ex) { 6536 throw new RuntimeException(ex); 6537 } 6538 6539 return unitOfMeasureKindUseType == null ? null : new UnitOfMeasureKindUseTypeObject(unitOfMeasureKindUseType); 6540 } 6541 6542 @GraphQLField 6543 @GraphQLName("unitOfMeasureKindUseTypes") 6544 @GraphQLNonNull 6545 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6546 static CountingPaginatedData<UnitOfMeasureKindUseTypeObject> unitOfMeasureKindUseTypes(final DataFetchingEnvironment env) { 6547 CountingPaginatedData<UnitOfMeasureKindUseTypeObject> data; 6548 6549 try { 6550 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindUseTypesForm(); 6551 var command = CDI.current().select(GetUnitOfMeasureKindUseTypesCommand.class).get(); 6552 6553 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6554 if(totalEntities == null) { 6555 data = Connections.emptyConnection(); 6556 } else { 6557 try(var objectLimiter = new ObjectLimiter(env, UnitOfMeasureKindUseTypeConstants.COMPONENT_VENDOR_NAME, UnitOfMeasureKindUseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6558 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6559 6560 var objects = entities.stream() 6561 .map(UnitOfMeasureKindUseTypeObject::new) 6562 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6563 6564 data = new CountedObjects<>(objectLimiter, objects); 6565 } 6566 } 6567 } catch (NamingException ex) { 6568 throw new RuntimeException(ex); 6569 } 6570 6571 return data; 6572 } 6573 6574 @GraphQLField 6575 @GraphQLName("entityAttributeType") 6576 static EntityAttributeTypeObject entityAttributeType(final DataFetchingEnvironment env, 6577 @GraphQLName("entityAttributeTypeName") @GraphQLNonNull final String entityAttributeTypeName) { 6578 EntityAttributeType entityAttributeType; 6579 6580 try { 6581 var commandForm = CoreUtil.getHome().getGetEntityAttributeTypeForm(); 6582 6583 commandForm.setEntityAttributeTypeName(entityAttributeTypeName); 6584 6585 entityAttributeType = CDI.current().select(GetEntityAttributeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6586 } catch (NamingException ex) { 6587 throw new RuntimeException(ex); 6588 } 6589 6590 return entityAttributeType == null ? null : new EntityAttributeTypeObject(entityAttributeType); 6591 } 6592 6593 @GraphQLField 6594 @GraphQLName("entityAttributeTypes") 6595 @GraphQLNonNull 6596 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6597 static CountingPaginatedData<EntityAttributeTypeObject> entityAttributeTypes(final DataFetchingEnvironment env) { 6598 CountingPaginatedData<EntityAttributeTypeObject> data; 6599 6600 try { 6601 var commandForm = CoreUtil.getHome().getGetEntityAttributeTypesForm(); 6602 var command = CDI.current().select(GetEntityAttributeTypesCommand.class).get(); 6603 6604 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6605 if(totalEntities == null) { 6606 data = Connections.emptyConnection(); 6607 } else { 6608 try(var objectLimiter = new ObjectLimiter(env, EntityAttributeTypeConstants.COMPONENT_VENDOR_NAME, EntityAttributeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6609 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6610 6611 var entityAttributeTypes = entities.stream() 6612 .map(EntityAttributeTypeObject::new) 6613 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6614 6615 data = new CountedObjects<>(objectLimiter, entityAttributeTypes); 6616 } 6617 } 6618 } catch (NamingException ex) { 6619 throw new RuntimeException(ex); 6620 } 6621 6622 return data; 6623 } 6624 6625 @GraphQLField 6626 @GraphQLName("componentVendorResults") 6627 static ComponentVendorResultsObject componentVendorResults(final DataFetchingEnvironment env, 6628 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6629 ComponentVendorResultsObject componentVendorResultsObject = null; 6630 6631 try { 6632 var commandForm = SearchUtil.getHome().getGetComponentVendorResultsForm(); 6633 6634 commandForm.setSearchTypeName(searchTypeName); 6635 6636 if(CDI.current().select(GetComponentVendorResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6637 componentVendorResultsObject = new ComponentVendorResultsObject(commandForm); 6638 } 6639 } catch (NamingException ex) { 6640 throw new RuntimeException(ex); 6641 } 6642 6643 return componentVendorResultsObject; 6644 } 6645 6646 @GraphQLField 6647 @GraphQLName("entityTypeResults") 6648 static EntityTypeResultsObject entityTypeResults(final DataFetchingEnvironment env, 6649 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6650 EntityTypeResultsObject entityTypeResultsObject = null; 6651 6652 try { 6653 var commandForm = SearchUtil.getHome().getGetEntityTypeResultsForm(); 6654 6655 commandForm.setSearchTypeName(searchTypeName); 6656 6657 if(CDI.current().select(GetEntityTypeResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6658 entityTypeResultsObject = new EntityTypeResultsObject(commandForm); 6659 } 6660 } catch (NamingException ex) { 6661 throw new RuntimeException(ex); 6662 } 6663 6664 return entityTypeResultsObject; 6665 } 6666 6667 @GraphQLField 6668 @GraphQLName("entityAliasTypeResults") 6669 static EntityAliasTypeResultsObject entityAliasTypeResults(final DataFetchingEnvironment env, 6670 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6671 EntityAliasTypeResultsObject entityAliasTypeResultsObject = null; 6672 6673 try { 6674 var commandForm = SearchUtil.getHome().getGetEntityAliasTypeResultsForm(); 6675 6676 commandForm.setSearchTypeName(searchTypeName); 6677 6678 if(CDI.current().select(GetEntityAliasTypeResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6679 entityAliasTypeResultsObject = new EntityAliasTypeResultsObject(commandForm); 6680 } 6681 } catch (NamingException ex) { 6682 throw new RuntimeException(ex); 6683 } 6684 6685 return entityAliasTypeResultsObject; 6686 } 6687 6688 @GraphQLField 6689 @GraphQLName("entityAttributeGroupResults") 6690 static EntityAttributeGroupResultsObject entityAttributeGroupResults(final DataFetchingEnvironment env, 6691 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6692 EntityAttributeGroupResultsObject entityAttributeGroupResultsObject = null; 6693 6694 try { 6695 var commandForm = SearchUtil.getHome().getGetEntityAttributeGroupResultsForm(); 6696 6697 commandForm.setSearchTypeName(searchTypeName); 6698 6699 if(CDI.current().select(GetEntityAttributeGroupResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6700 entityAttributeGroupResultsObject = new EntityAttributeGroupResultsObject(commandForm); 6701 } 6702 } catch (NamingException ex) { 6703 throw new RuntimeException(ex); 6704 } 6705 6706 return entityAttributeGroupResultsObject; 6707 } 6708 6709 @GraphQLField 6710 @GraphQLName("entityAttributeResults") 6711 static EntityAttributeResultsObject entityAttributeResults(final DataFetchingEnvironment env, 6712 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6713 EntityAttributeResultsObject entityAttributeResultsObject = null; 6714 6715 try { 6716 var commandForm = SearchUtil.getHome().getGetEntityAttributeResultsForm(); 6717 6718 commandForm.setSearchTypeName(searchTypeName); 6719 6720 if(CDI.current().select(GetEntityAttributeResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6721 entityAttributeResultsObject = new EntityAttributeResultsObject(commandForm); 6722 } 6723 } catch (NamingException ex) { 6724 throw new RuntimeException(ex); 6725 } 6726 6727 return entityAttributeResultsObject; 6728 } 6729 6730 @GraphQLField 6731 @GraphQLName("entityListItemResults") 6732 static EntityListItemResultsObject entityListItemResults(final DataFetchingEnvironment env, 6733 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6734 EntityListItemResultsObject entityListItemResultsObject = null; 6735 6736 try { 6737 var commandForm = SearchUtil.getHome().getGetEntityListItemResultsForm(); 6738 6739 commandForm.setSearchTypeName(searchTypeName); 6740 6741 if(CDI.current().select(GetEntityListItemResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6742 entityListItemResultsObject = new EntityListItemResultsObject(commandForm); 6743 } 6744 } catch (NamingException ex) { 6745 throw new RuntimeException(ex); 6746 } 6747 6748 return entityListItemResultsObject; 6749 } 6750 6751 @GraphQLField 6752 @GraphQLName("customerResults") 6753 static CustomerResultsObject customerResults(final DataFetchingEnvironment env, 6754 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6755 CustomerResultsObject customerResultsObject = null; 6756 6757 try { 6758 var commandForm = SearchUtil.getHome().getGetCustomerResultsForm(); 6759 6760 commandForm.setSearchTypeName(searchTypeName); 6761 6762 if(CDI.current().select(GetCustomerResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6763 customerResultsObject = new CustomerResultsObject(commandForm); 6764 } 6765 } catch (NamingException ex) { 6766 throw new RuntimeException(ex); 6767 } 6768 6769 return customerResultsObject; 6770 } 6771 6772 @GraphQLField 6773 @GraphQLName("employeeResults") 6774 static EmployeeResultsObject employeeResults(final DataFetchingEnvironment env, 6775 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6776 EmployeeResultsObject employeeResultsObject = null; 6777 6778 try { 6779 var commandForm = SearchUtil.getHome().getGetEmployeeResultsForm(); 6780 6781 commandForm.setSearchTypeName(searchTypeName); 6782 6783 if(CDI.current().select(GetEmployeeResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6784 employeeResultsObject = new EmployeeResultsObject(commandForm); 6785 } 6786 } catch (NamingException ex) { 6787 throw new RuntimeException(ex); 6788 } 6789 6790 return employeeResultsObject; 6791 } 6792 6793 @GraphQLField 6794 @GraphQLName("itemResults") 6795 static ItemResultsObject itemResults(final DataFetchingEnvironment env, 6796 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6797 ItemResultsObject itemResultsObject = null; 6798 6799 try { 6800 var commandForm = SearchUtil.getHome().getGetItemResultsForm(); 6801 6802 commandForm.setSearchTypeName(searchTypeName); 6803 6804 if(CDI.current().select(GetItemResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6805 itemResultsObject = new ItemResultsObject(commandForm); 6806 } 6807 } catch (NamingException ex) { 6808 throw new RuntimeException(ex); 6809 } 6810 6811 return itemResultsObject; 6812 } 6813 6814 @GraphQLField 6815 @GraphQLName("checkItemSpelling") 6816 static CheckItemSpellingObject checkItemSpelling(final DataFetchingEnvironment env, 6817 @GraphQLName("languageIsoName") final String languageIsoName, 6818 @GraphQLName("searchDefaultOperatorName") final String searchDefaultOperatorName, 6819 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName, 6820 @GraphQLName("q") final String q) { 6821 var checkItemSpellingObject = new CheckItemSpellingObject(); 6822 6823 try { 6824 var commandForm = SearchUtil.getHome().getCheckItemSpellingForm(); 6825 6826 commandForm.setLanguageIsoName(languageIsoName); 6827 commandForm.setSearchDefaultOperatorName(searchDefaultOperatorName); 6828 commandForm.setSearchTypeName(searchTypeName); 6829 commandForm.setQ(q); 6830 6831 var commandResult = SearchUtil.getHome().checkItemSpelling(getUserVisitPK(env), commandForm); 6832 checkItemSpellingObject.setCommandResult(commandResult); 6833 checkItemSpellingObject.setResult(commandResult.hasErrors() ? null : (CheckItemSpellingResult)commandResult.getExecutionResult().getResult()); 6834 } catch (NamingException ex) { 6835 throw new RuntimeException(ex); 6836 } 6837 6838 return checkItemSpellingObject; 6839 } 6840 6841 @GraphQLField 6842 @GraphQLName("vendorResults") 6843 static VendorResultsObject vendorResults(final DataFetchingEnvironment env, 6844 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6845 VendorResultsObject vendorResultsObject = null; 6846 6847 try { 6848 var commandForm = SearchUtil.getHome().getGetVendorResultsForm(); 6849 6850 commandForm.setSearchTypeName(searchTypeName); 6851 6852 if(CDI.current().select(GetVendorResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6853 vendorResultsObject = new VendorResultsObject(commandForm); 6854 } 6855 } catch (NamingException ex) { 6856 throw new RuntimeException(ex); 6857 } 6858 6859 return vendorResultsObject; 6860 } 6861 6862 @GraphQLField 6863 @GraphQLName("shippingMethodResults") 6864 static ShippingMethodResultsObject shippingMethodResults(final DataFetchingEnvironment env, 6865 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6866 ShippingMethodResultsObject shippingMethodResultsObject = null; 6867 6868 try { 6869 var commandForm = SearchUtil.getHome().getGetShippingMethodResultsForm(); 6870 6871 commandForm.setSearchTypeName(searchTypeName); 6872 6873 if(CDI.current().select(GetShippingMethodResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6874 shippingMethodResultsObject = new ShippingMethodResultsObject(commandForm); 6875 } 6876 } catch (NamingException ex) { 6877 throw new RuntimeException(ex); 6878 } 6879 6880 return shippingMethodResultsObject; 6881 } 6882 6883 @GraphQLField 6884 @GraphQLName("warehouseResults") 6885 static WarehouseResultsObject warehouseResults(final DataFetchingEnvironment env, 6886 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6887 WarehouseResultsObject warehouseResultsObject = null; 6888 6889 try { 6890 var commandForm = SearchUtil.getHome().getGetWarehouseResultsForm(); 6891 6892 commandForm.setSearchTypeName(searchTypeName); 6893 6894 if(CDI.current().select(GetWarehouseResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6895 warehouseResultsObject = new WarehouseResultsObject(commandForm); 6896 } 6897 } catch (NamingException ex) { 6898 throw new RuntimeException(ex); 6899 } 6900 6901 return warehouseResultsObject; 6902 } 6903 6904 @GraphQLField 6905 @GraphQLName("contentCatalogResults") 6906 static ContentCatalogResultsObject contentCatalogResults(final DataFetchingEnvironment env, 6907 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6908 ContentCatalogResultsObject contentCatalogResultsObject = null; 6909 6910 try { 6911 var commandForm = SearchUtil.getHome().getGetContentCatalogResultsForm(); 6912 6913 commandForm.setSearchTypeName(searchTypeName); 6914 6915 if(CDI.current().select(GetContentCatalogResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6916 contentCatalogResultsObject = new ContentCatalogResultsObject(commandForm); 6917 } 6918 } catch (NamingException ex) { 6919 throw new RuntimeException(ex); 6920 } 6921 6922 return contentCatalogResultsObject; 6923 } 6924 6925 @GraphQLField 6926 @GraphQLName("contentCatalogItemResults") 6927 static ContentCatalogItemResultsObject contentCatalogItemResults(final DataFetchingEnvironment env, 6928 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6929 ContentCatalogItemResultsObject contentCatalogItemResultsObject = null; 6930 6931 try { 6932 var commandForm = SearchUtil.getHome().getGetContentCatalogItemResultsForm(); 6933 6934 commandForm.setSearchTypeName(searchTypeName); 6935 6936 if(CDI.current().select(GetContentCatalogItemResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6937 contentCatalogItemResultsObject = new ContentCatalogItemResultsObject(commandForm); 6938 } 6939 } catch (NamingException ex) { 6940 throw new RuntimeException(ex); 6941 } 6942 6943 return contentCatalogItemResultsObject; 6944 } 6945 6946 @GraphQLField 6947 @GraphQLName("contentCategoryResults") 6948 static ContentCategoryResultsObject contentCategoryResults(final DataFetchingEnvironment env, 6949 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6950 ContentCategoryResultsObject contentCategoryResultsObject = null; 6951 6952 try { 6953 var commandForm = SearchUtil.getHome().getGetContentCategoryResultsForm(); 6954 6955 commandForm.setSearchTypeName(searchTypeName); 6956 6957 if(CDI.current().select(GetContentCategoryResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6958 contentCategoryResultsObject = new ContentCategoryResultsObject(commandForm); 6959 } 6960 } catch (NamingException ex) { 6961 throw new RuntimeException(ex); 6962 } 6963 6964 return contentCategoryResultsObject; 6965 } 6966 6967 @GraphQLField 6968 @GraphQLName("color") 6969 static ColorObject color(final DataFetchingEnvironment env, 6970 @GraphQLName("colorName") final String colorName, 6971 @GraphQLName("id") @GraphQLID final String id) { 6972 Color color; 6973 6974 try { 6975 var commandForm = CoreUtil.getHome().getGetColorForm(); 6976 6977 commandForm.setColorName(colorName); 6978 commandForm.setUuid(id); 6979 6980 color = CDI.current().select(GetColorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6981 } catch (NamingException ex) { 6982 throw new RuntimeException(ex); 6983 } 6984 6985 return color == null ? null : new ColorObject(color); 6986 } 6987 6988 @GraphQLField 6989 @GraphQLName("colors") 6990 @GraphQLNonNull 6991 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6992 static CountingPaginatedData<ColorObject> colors(final DataFetchingEnvironment env) { 6993 CountingPaginatedData<ColorObject> data; 6994 6995 try { 6996 var commandForm = CoreUtil.getHome().getGetColorsForm(); 6997 var command = CDI.current().select(GetColorsCommand.class).get(); 6998 6999 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7000 if(totalEntities == null) { 7001 data = Connections.emptyConnection(); 7002 } else { 7003 try(var objectLimiter = new ObjectLimiter(env, ColorConstants.COMPONENT_VENDOR_NAME, ColorConstants.ENTITY_TYPE_NAME, totalEntities)) { 7004 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7005 7006 var colors = entities.stream() 7007 .map(ColorObject::new) 7008 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7009 7010 data = new CountedObjects<>(objectLimiter, colors); 7011 } 7012 } 7013 } catch (NamingException ex) { 7014 throw new RuntimeException(ex); 7015 } 7016 7017 return data; 7018 } 7019 7020 @GraphQLField 7021 @GraphQLName("fontStyle") 7022 static FontStyleObject fontStyle(final DataFetchingEnvironment env, 7023 @GraphQLName("fontStyleName") final String fontStyleName, 7024 @GraphQLName("id") @GraphQLID final String id) { 7025 FontStyle fontStyle; 7026 7027 try { 7028 var commandForm = CoreUtil.getHome().getGetFontStyleForm(); 7029 7030 commandForm.setFontStyleName(fontStyleName); 7031 commandForm.setUuid(id); 7032 7033 fontStyle = CDI.current().select(GetFontStyleCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7034 } catch (NamingException ex) { 7035 throw new RuntimeException(ex); 7036 } 7037 7038 return fontStyle == null ? null : new FontStyleObject(fontStyle); 7039 } 7040 7041 @GraphQLField 7042 @GraphQLName("fontStyles") 7043 @GraphQLNonNull 7044 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7045 static CountingPaginatedData<FontStyleObject> fontStyles(final DataFetchingEnvironment env) { 7046 CountingPaginatedData<FontStyleObject> data; 7047 7048 try { 7049 var commandForm = CoreUtil.getHome().getGetFontStylesForm(); 7050 var command = CDI.current().select(GetFontStylesCommand.class).get(); 7051 7052 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7053 if(totalEntities == null) { 7054 data = Connections.emptyConnection(); 7055 } else { 7056 try(var objectLimiter = new ObjectLimiter(env, FontStyleConstants.COMPONENT_VENDOR_NAME, FontStyleConstants.ENTITY_TYPE_NAME, totalEntities)) { 7057 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7058 7059 var fontStyles = entities.stream() 7060 .map(FontStyleObject::new) 7061 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7062 7063 data = new CountedObjects<>(objectLimiter, fontStyles); 7064 } 7065 } 7066 } catch (NamingException ex) { 7067 throw new RuntimeException(ex); 7068 } 7069 7070 return data; 7071 } 7072 7073 @GraphQLField 7074 @GraphQLName("fontWeight") 7075 static FontWeightObject fontWeight(final DataFetchingEnvironment env, 7076 @GraphQLName("fontWeightName") final String fontWeightName, 7077 @GraphQLName("id") @GraphQLID final String id) { 7078 FontWeight fontWeight; 7079 7080 try { 7081 var commandForm = CoreUtil.getHome().getGetFontWeightForm(); 7082 7083 commandForm.setFontWeightName(fontWeightName); 7084 commandForm.setUuid(id); 7085 7086 fontWeight = CDI.current().select(GetFontWeightCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7087 } catch (NamingException ex) { 7088 throw new RuntimeException(ex); 7089 } 7090 7091 return fontWeight == null ? null : new FontWeightObject(fontWeight); 7092 } 7093 7094 @GraphQLField 7095 @GraphQLName("fontWeights") 7096 @GraphQLNonNull 7097 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7098 static CountingPaginatedData<FontWeightObject> fontWeights(final DataFetchingEnvironment env) { 7099 CountingPaginatedData<FontWeightObject> data; 7100 7101 try { 7102 var commandForm = CoreUtil.getHome().getGetFontWeightsForm(); 7103 var command = CDI.current().select(GetFontWeightsCommand.class).get(); 7104 7105 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7106 if(totalEntities == null) { 7107 data = Connections.emptyConnection(); 7108 } else { 7109 try(var objectLimiter = new ObjectLimiter(env, FontWeightConstants.COMPONENT_VENDOR_NAME, FontWeightConstants.ENTITY_TYPE_NAME, totalEntities)) { 7110 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7111 7112 var fontWeights = entities.stream() 7113 .map(FontWeightObject::new) 7114 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7115 7116 data = new CountedObjects<>(objectLimiter, fontWeights); 7117 } 7118 } 7119 } catch (NamingException ex) { 7120 throw new RuntimeException(ex); 7121 } 7122 7123 return data; 7124 } 7125 7126 @GraphQLField 7127 @GraphQLName("textDecoration") 7128 static TextDecorationObject textDecoration(final DataFetchingEnvironment env, 7129 @GraphQLName("textDecorationName") final String textDecorationName, 7130 @GraphQLName("id") @GraphQLID final String id) { 7131 TextDecoration textDecoration; 7132 7133 try { 7134 var commandForm = CoreUtil.getHome().getGetTextDecorationForm(); 7135 7136 commandForm.setTextDecorationName(textDecorationName); 7137 commandForm.setUuid(id); 7138 7139 textDecoration = CDI.current().select(GetTextDecorationCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7140 } catch (NamingException ex) { 7141 throw new RuntimeException(ex); 7142 } 7143 7144 return textDecoration == null ? null : new TextDecorationObject(textDecoration); 7145 } 7146 7147 @GraphQLField 7148 @GraphQLName("textDecorations") 7149 @GraphQLNonNull 7150 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7151 static CountingPaginatedData<TextDecorationObject> textDecorations(final DataFetchingEnvironment env) { 7152 CountingPaginatedData<TextDecorationObject> data; 7153 7154 try { 7155 var commandForm = CoreUtil.getHome().getGetTextDecorationsForm(); 7156 var command = CDI.current().select(GetTextDecorationsCommand.class).get(); 7157 7158 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7159 if(totalEntities == null) { 7160 data = Connections.emptyConnection(); 7161 } else { 7162 try(var objectLimiter = new ObjectLimiter(env, TextDecorationConstants.COMPONENT_VENDOR_NAME, TextDecorationConstants.ENTITY_TYPE_NAME, totalEntities)) { 7163 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7164 7165 var textDecorations = entities.stream() 7166 .map(TextDecorationObject::new) 7167 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7168 7169 data = new CountedObjects<>(objectLimiter, textDecorations); 7170 } 7171 } 7172 } catch (NamingException ex) { 7173 throw new RuntimeException(ex); 7174 } 7175 7176 return data; 7177 } 7178 7179 @GraphQLField 7180 @GraphQLName("textTransformation") 7181 static TextTransformationObject textTransformation(final DataFetchingEnvironment env, 7182 @GraphQLName("textTransformationName") final String textTransformationName, 7183 @GraphQLName("id") @GraphQLID final String id) { 7184 TextTransformation textTransformation; 7185 7186 try { 7187 var commandForm = CoreUtil.getHome().getGetTextTransformationForm(); 7188 7189 commandForm.setTextTransformationName(textTransformationName); 7190 commandForm.setUuid(id); 7191 7192 textTransformation = CDI.current().select(GetTextTransformationCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7193 } catch (NamingException ex) { 7194 throw new RuntimeException(ex); 7195 } 7196 7197 return textTransformation == null ? null : new TextTransformationObject(textTransformation); 7198 } 7199 7200 @GraphQLField 7201 @GraphQLName("textTransformations") 7202 @GraphQLNonNull 7203 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7204 static CountingPaginatedData<TextTransformationObject> textTransformations(final DataFetchingEnvironment env) { 7205 CountingPaginatedData<TextTransformationObject> data; 7206 7207 try { 7208 var commandForm = CoreUtil.getHome().getGetTextTransformationsForm(); 7209 var command = CDI.current().select(GetTextTransformationsCommand.class).get(); 7210 7211 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7212 if(totalEntities == null) { 7213 data = Connections.emptyConnection(); 7214 } else { 7215 try(var objectLimiter = new ObjectLimiter(env, TextTransformationConstants.COMPONENT_VENDOR_NAME, TextTransformationConstants.ENTITY_TYPE_NAME, totalEntities)) { 7216 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7217 7218 var textTransformations = entities.stream() 7219 .map(TextTransformationObject::new) 7220 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7221 7222 data = new CountedObjects<>(objectLimiter, textTransformations); 7223 } 7224 } 7225 } catch (NamingException ex) { 7226 throw new RuntimeException(ex); 7227 } 7228 7229 return data; 7230 } 7231 7232 @GraphQLField 7233 @GraphQLName("userLogin") 7234 static UserLoginObject userLogin(final DataFetchingEnvironment env, 7235 @GraphQLName("username") final String username, 7236 @GraphQLName("id") @GraphQLID final String id) { 7237 UserLogin userLogin; 7238 7239 try { 7240 var commandForm = UserUtil.getHome().getGetUserLoginForm(); 7241 7242 commandForm.setUsername(username); 7243 commandForm.setUuid(id); 7244 7245 var getUserLoginCommand = CDI.current().select(GetUserLoginCommand.class).get(); 7246 userLogin = getUserLoginCommand.getEntityForGraphQl(getUserVisitPK(env), commandForm); 7247 } catch (NamingException ex) { 7248 throw new RuntimeException(ex); 7249 } 7250 7251 return userLogin == null ? null : new UserLoginObject(userLogin); 7252 } 7253 7254 @GraphQLField 7255 @GraphQLName("recoveryQuestion") 7256 static RecoveryQuestionObject recoveryQuestion(final DataFetchingEnvironment env, 7257 @GraphQLName("recoveryQuestionName") final String recoveryQuestionName, 7258 @GraphQLName("id") @GraphQLID final String id, 7259 @GraphQLName("username") final String username) { 7260 RecoveryQuestion recoveryQuestion; 7261 7262 try { 7263 var commandForm = UserUtil.getHome().getGetRecoveryQuestionForm(); 7264 7265 commandForm.setRecoveryQuestionName(recoveryQuestionName); 7266 commandForm.setUuid(id); 7267 commandForm.setUsername(username); 7268 7269 recoveryQuestion = CDI.current().select(GetRecoveryQuestionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7270 } catch (NamingException ex) { 7271 throw new RuntimeException(ex); 7272 } 7273 7274 return recoveryQuestion == null ? null : new RecoveryQuestionObject(recoveryQuestion); 7275 } 7276 7277 @GraphQLField 7278 @GraphQLName("recoveryQuestions") 7279 @GraphQLNonNull 7280 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7281 static CountingPaginatedData<RecoveryQuestionObject> recoveryQuestions(final DataFetchingEnvironment env) { 7282 CountingPaginatedData<RecoveryQuestionObject> data; 7283 7284 try { 7285 var commandForm = UserUtil.getHome().getGetRecoveryQuestionsForm(); 7286 var command = CDI.current().select(GetRecoveryQuestionsCommand.class).get(); 7287 7288 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7289 if(totalEntities == null) { 7290 data = Connections.emptyConnection(); 7291 } else { 7292 try(var objectLimiter = new ObjectLimiter(env, RecoveryQuestionConstants.COMPONENT_VENDOR_NAME, RecoveryQuestionConstants.ENTITY_TYPE_NAME, totalEntities)) { 7293 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7294 7295 var recoveryQuestions = entities.stream() 7296 .map(RecoveryQuestionObject::new) 7297 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7298 7299 data = new CountedObjects<>(objectLimiter, recoveryQuestions); 7300 } 7301 } 7302 } catch (NamingException ex) { 7303 throw new RuntimeException(ex); 7304 } 7305 7306 return data; 7307 } 7308 7309 @GraphQLField 7310 @GraphQLName("userSession") 7311 static UserSessionObject userSession(final DataFetchingEnvironment env) { 7312 var userSession = BaseGraphQl.getUserSession(env); 7313 7314 return userSession == null ? null : new UserSessionObject(userSession); 7315 } 7316 7317 @GraphQLField 7318 @GraphQLName("userVisitGroup") 7319 static UserVisitGroupObject userVisitGroup(final DataFetchingEnvironment env, 7320 @GraphQLName("userVisitGroupName") final String userVisitGroupName, 7321 @GraphQLName("id") @GraphQLID final String id) { 7322 UserVisitGroup userVisitGroup; 7323 7324 try { 7325 var commandForm = UserUtil.getHome().getGetUserVisitGroupForm(); 7326 7327 commandForm.setUserVisitGroupName(userVisitGroupName); 7328 commandForm.setUuid(id); 7329 7330 userVisitGroup = CDI.current().select(GetUserVisitGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7331 } catch (NamingException ex) { 7332 throw new RuntimeException(ex); 7333 } 7334 7335 return userVisitGroup == null ? null : new UserVisitGroupObject(userVisitGroup); 7336 } 7337 7338 @GraphQLField 7339 @GraphQLName("userVisitGroups") 7340 @GraphQLNonNull 7341 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7342 static CountingPaginatedData<UserVisitGroupObject> userVisitGroups(final DataFetchingEnvironment env) { 7343 CountingPaginatedData<UserVisitGroupObject> data; 7344 7345 try { 7346 var commandForm = UserUtil.getHome().getGetUserVisitGroupsForm(); 7347 var command = CDI.current().select(GetUserVisitGroupsCommand.class).get(); 7348 7349 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7350 if(totalEntities == null) { 7351 data = Connections.emptyConnection(); 7352 } else { 7353 try(var objectLimiter = new ObjectLimiter(env, UserVisitGroupConstants.COMPONENT_VENDOR_NAME, UserVisitGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 7354 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7355 7356 var userVisitGroups = entities.stream() 7357 .map(UserVisitGroupObject::new) 7358 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7359 7360 data = new CountedObjects<>(objectLimiter, userVisitGroups); 7361 } 7362 } 7363 } catch (NamingException ex) { 7364 throw new RuntimeException(ex); 7365 } 7366 7367 return data; 7368 } 7369 7370 @GraphQLField 7371 @GraphQLName("userVisit") 7372 static UserVisitObject userVisit(final DataFetchingEnvironment env) { 7373 var userVisit = BaseGraphQl.getUserVisit(env); 7374 7375 return userVisit == null ? null : new UserVisitObject(userVisit); 7376 } 7377 7378 @GraphQLField 7379 @GraphQLName("symbolPosition") 7380 static SymbolPositionObject symbolPosition(final DataFetchingEnvironment env, 7381 @GraphQLName("symbolPositionName") final String symbolPositionName, 7382 @GraphQLName("id") @GraphQLID final String id) { 7383 SymbolPosition symbolPosition; 7384 7385 try { 7386 var commandForm = AccountingUtil.getHome().getGetSymbolPositionForm(); 7387 7388 commandForm.setSymbolPositionName(symbolPositionName); 7389 commandForm.setUuid(id); 7390 7391 symbolPosition = CDI.current().select(GetSymbolPositionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7392 } catch (NamingException ex) { 7393 throw new RuntimeException(ex); 7394 } 7395 7396 return symbolPosition == null ? null : new SymbolPositionObject(symbolPosition); 7397 } 7398 7399 @GraphQLField 7400 @GraphQLName("symbolPositions") 7401 @GraphQLNonNull 7402 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7403 static CountingPaginatedData<SymbolPositionObject> symbolPositions(final DataFetchingEnvironment env) { 7404 CountingPaginatedData<SymbolPositionObject> data; 7405 7406 try { 7407 var commandForm = AccountingUtil.getHome().getGetSymbolPositionsForm(); 7408 var command = CDI.current().select(GetSymbolPositionsCommand.class).get(); 7409 7410 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7411 if(totalEntities == null) { 7412 data = Connections.emptyConnection(); 7413 } else { 7414 try(var objectLimiter = new ObjectLimiter(env, SymbolPositionConstants.COMPONENT_VENDOR_NAME, SymbolPositionConstants.ENTITY_TYPE_NAME, totalEntities)) { 7415 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7416 7417 var symbolPositions = entities.stream() 7418 .map(SymbolPositionObject::new) 7419 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7420 7421 data = new CountedObjects<>(objectLimiter, symbolPositions); 7422 } 7423 } 7424 } catch (NamingException ex) { 7425 throw new RuntimeException(ex); 7426 } 7427 7428 return data; 7429 } 7430 7431 @GraphQLField 7432 @GraphQLName("currency") 7433 static CurrencyObject currency(final DataFetchingEnvironment env, 7434 @GraphQLName("currencyIsoName") final String currencyIsoName, 7435 @GraphQLName("id") @GraphQLID final String id) { 7436 Currency currency; 7437 7438 try { 7439 var commandForm = AccountingUtil.getHome().getGetCurrencyForm(); 7440 7441 commandForm.setCurrencyIsoName(currencyIsoName); 7442 commandForm.setUuid(id); 7443 7444 currency = CDI.current().select(GetCurrencyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7445 } catch (NamingException ex) { 7446 throw new RuntimeException(ex); 7447 } 7448 7449 return currency == null ? null : new CurrencyObject(currency); 7450 } 7451 7452 @GraphQLField 7453 @GraphQLName("currencies") 7454 @GraphQLNonNull 7455 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7456 static CountingPaginatedData<CurrencyObject> currencies(final DataFetchingEnvironment env) { 7457 CountingPaginatedData<CurrencyObject> data; 7458 7459 try { 7460 var commandForm = AccountingUtil.getHome().getGetCurrenciesForm(); 7461 var command = CDI.current().select(GetCurrenciesCommand.class).get(); 7462 7463 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7464 if(totalEntities == null) { 7465 data = Connections.emptyConnection(); 7466 } else { 7467 try(var objectLimiter = new ObjectLimiter(env, CurrencyConstants.COMPONENT_VENDOR_NAME, CurrencyConstants.ENTITY_TYPE_NAME, totalEntities)) { 7468 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7469 7470 var currencies = entities.stream() 7471 .map(CurrencyObject::new) 7472 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7473 7474 data = new CountedObjects<>(objectLimiter, currencies); 7475 } 7476 } 7477 } catch (NamingException ex) { 7478 throw new RuntimeException(ex); 7479 } 7480 7481 return data; 7482 } 7483 7484 @GraphQLField 7485 @GraphQLName("language") 7486 static LanguageObject language(final DataFetchingEnvironment env, 7487 @GraphQLName("languageIsoName") final String languageIsoName, 7488 @GraphQLName("id") @GraphQLID final String id) { 7489 Language language; 7490 7491 try { 7492 var commandForm = PartyUtil.getHome().getGetLanguageForm(); 7493 7494 commandForm.setLanguageIsoName(languageIsoName); 7495 commandForm.setUuid(id); 7496 7497 language = CDI.current().select(GetLanguageCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7498 } catch (NamingException ex) { 7499 throw new RuntimeException(ex); 7500 } 7501 7502 return language == null ? null : new LanguageObject(language); 7503 } 7504 7505 @GraphQLField 7506 @GraphQLName("languages") 7507 @GraphQLNonNull 7508 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7509 static CountingPaginatedData<LanguageObject> languages(final DataFetchingEnvironment env) { 7510 CountingPaginatedData<LanguageObject> data; 7511 7512 try { 7513 var commandForm = PartyUtil.getHome().getGetLanguagesForm(); 7514 var command = CDI.current().select(GetLanguagesCommand.class).get(); 7515 7516 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7517 if(totalEntities == null) { 7518 data = Connections.emptyConnection(); 7519 } else { 7520 try(var objectLimiter = new ObjectLimiter(env, LanguageConstants.COMPONENT_VENDOR_NAME, LanguageConstants.ENTITY_TYPE_NAME, totalEntities)) { 7521 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7522 7523 var languages = entities.stream() 7524 .map(LanguageObject::new) 7525 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7526 7527 data = new CountedObjects<>(objectLimiter, languages); 7528 } 7529 } 7530 } catch (NamingException ex) { 7531 throw new RuntimeException(ex); 7532 } 7533 7534 return data; 7535 } 7536 7537 @GraphQLField 7538 @GraphQLName("dateTimeFormat") 7539 static DateTimeFormatObject dateTimeFormat(final DataFetchingEnvironment env, 7540 @GraphQLName("dateTimeFormatName") final String dateTimeFormatName, 7541 @GraphQLName("id") @GraphQLID final String id) { 7542 DateTimeFormat dateTimeFormat; 7543 7544 try { 7545 var commandForm = PartyUtil.getHome().getGetDateTimeFormatForm(); 7546 7547 commandForm.setDateTimeFormatName(dateTimeFormatName); 7548 commandForm.setUuid(id); 7549 7550 dateTimeFormat = CDI.current().select(GetDateTimeFormatCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7551 } catch (NamingException ex) { 7552 throw new RuntimeException(ex); 7553 } 7554 7555 return dateTimeFormat == null ? null : new DateTimeFormatObject(dateTimeFormat); 7556 } 7557 7558 @GraphQLField 7559 @GraphQLName("dateTimeFormats") 7560 @GraphQLNonNull 7561 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7562 static CountingPaginatedData<DateTimeFormatObject> dateTimeFormats(final DataFetchingEnvironment env) { 7563 CountingPaginatedData<DateTimeFormatObject> data; 7564 7565 try { 7566 var commandForm = PartyUtil.getHome().getGetDateTimeFormatsForm(); 7567 var command = CDI.current().select(GetDateTimeFormatsCommand.class).get(); 7568 7569 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7570 if(totalEntities == null) { 7571 data = Connections.emptyConnection(); 7572 } else { 7573 try(var objectLimiter = new ObjectLimiter(env, DateTimeFormatConstants.COMPONENT_VENDOR_NAME, DateTimeFormatConstants.ENTITY_TYPE_NAME, totalEntities)) { 7574 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7575 7576 var dateTimeFormats = entities.stream() 7577 .map(DateTimeFormatObject::new) 7578 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7579 7580 data = new CountedObjects<>(objectLimiter, dateTimeFormats); 7581 } 7582 } 7583 } catch (NamingException ex) { 7584 throw new RuntimeException(ex); 7585 } 7586 7587 return data; 7588 } 7589 7590 @GraphQLField 7591 @GraphQLName("timeZone") 7592 static TimeZoneObject timeZone(final DataFetchingEnvironment env, 7593 @GraphQLName("javaTimeZoneName") final String javaTimeZoneName, 7594 @GraphQLName("id") @GraphQLID final String id) { 7595 TimeZone timeZone; 7596 7597 try { 7598 var commandForm = PartyUtil.getHome().getGetTimeZoneForm(); 7599 7600 commandForm.setJavaTimeZoneName(javaTimeZoneName); 7601 commandForm.setUuid(id); 7602 7603 timeZone = CDI.current().select(GetTimeZoneCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7604 } catch (NamingException ex) { 7605 throw new RuntimeException(ex); 7606 } 7607 7608 return timeZone == null ? null : new TimeZoneObject(timeZone); 7609 } 7610 7611 @GraphQLField 7612 @GraphQLName("timeZones") 7613 @GraphQLNonNull 7614 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7615 static CountingPaginatedData<TimeZoneObject> timeZones(final DataFetchingEnvironment env) { 7616 CountingPaginatedData<TimeZoneObject> data; 7617 7618 try { 7619 var commandForm = PartyUtil.getHome().getGetTimeZonesForm(); 7620 var command = CDI.current().select(GetTimeZonesCommand.class).get(); 7621 7622 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7623 if(totalEntities == null) { 7624 data = Connections.emptyConnection(); 7625 } else { 7626 try(var objectLimiter = new ObjectLimiter(env, TimeZoneConstants.COMPONENT_VENDOR_NAME, TimeZoneConstants.ENTITY_TYPE_NAME, totalEntities)) { 7627 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7628 7629 var timeZones = entities.stream() 7630 .map(TimeZoneObject::new) 7631 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7632 7633 data = new CountedObjects<>(objectLimiter, timeZones); 7634 } 7635 } 7636 } catch (NamingException ex) { 7637 throw new RuntimeException(ex); 7638 } 7639 7640 return data; 7641 } 7642 7643 @GraphQLField 7644 @GraphQLName("customerType") 7645 static CustomerTypeObject customerType(final DataFetchingEnvironment env, 7646 @GraphQLName("customerTypeName") final String customerTypeName, 7647 @GraphQLName("id") @GraphQLID final String id) { 7648 CustomerType customerType; 7649 7650 try { 7651 var commandForm = CustomerUtil.getHome().getGetCustomerTypeForm(); 7652 7653 commandForm.setCustomerTypeName(customerTypeName); 7654 commandForm.setUuid(id); 7655 7656 customerType = CDI.current().select(GetCustomerTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7657 } catch (NamingException ex) { 7658 throw new RuntimeException(ex); 7659 } 7660 7661 return customerType == null ? null : new CustomerTypeObject(customerType); 7662 } 7663 7664 @GraphQLField 7665 @GraphQLName("customerTypes") 7666 @GraphQLNonNull 7667 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7668 static CountingPaginatedData<CustomerTypeObject> customerTypes(final DataFetchingEnvironment env) { 7669 CountingPaginatedData<CustomerTypeObject> data; 7670 7671 try { 7672 var commandForm = CustomerUtil.getHome().getGetCustomerTypesForm(); 7673 var command = CDI.current().select(GetCustomerTypesCommand.class).get(); 7674 7675 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7676 if(totalEntities == null) { 7677 data = Connections.emptyConnection(); 7678 } else { 7679 try(var objectLimiter = new ObjectLimiter(env, CustomerTypeConstants.COMPONENT_VENDOR_NAME, CustomerTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 7680 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7681 7682 var customerTypes = entities.stream() 7683 .map(CustomerTypeObject::new) 7684 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7685 7686 data = new CountedObjects<>(objectLimiter, customerTypes); 7687 } 7688 } 7689 } catch (NamingException ex) { 7690 throw new RuntimeException(ex); 7691 } 7692 7693 return data; 7694 } 7695 7696 @GraphQLField 7697 @GraphQLName("customer") 7698 static CustomerObject customer(final DataFetchingEnvironment env, 7699 @GraphQLName("customerName") final String customerName, 7700 @GraphQLName("partyName") final String partyName, 7701 @GraphQLName("id") @GraphQLID final String id) { 7702 Customer customer; 7703 7704 try { 7705 var commandForm = CustomerUtil.getHome().getGetCustomerForm(); 7706 7707 commandForm.setCustomerName(customerName); 7708 commandForm.setPartyName(partyName); 7709 commandForm.setUuid(id); 7710 7711 customer = CDI.current().select(GetCustomerCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7712 } catch (NamingException ex) { 7713 throw new RuntimeException(ex); 7714 } 7715 7716 return customer == null ? null : new CustomerObject(customer); 7717 } 7718 7719 @GraphQLField 7720 @GraphQLName("customers") 7721 @GraphQLNonNull 7722 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7723 static CountingPaginatedData<CustomerObject> customers(final DataFetchingEnvironment env) { 7724 CountingPaginatedData<CustomerObject> data; 7725 7726 try { 7727 var commandForm = CustomerUtil.getHome().getGetCustomersForm(); 7728 var command = CDI.current().select(GetCustomersCommand.class).get(); 7729 7730 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7731 if(totalEntities == null) { 7732 data = Connections.emptyConnection(); 7733 } else { 7734 try(var objectLimiter = new ObjectLimiter(env, CustomerConstants.COMPONENT_VENDOR_NAME, CustomerConstants.ENTITY_TYPE_NAME, totalEntities)) { 7735 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7736 7737 var customers = entities.stream() 7738 .map(CustomerObject::new) 7739 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7740 7741 data = new CountedObjects<>(objectLimiter, customers); 7742 } 7743 } 7744 } catch (NamingException ex) { 7745 throw new RuntimeException(ex); 7746 } 7747 7748 return data; 7749 } 7750 7751 @GraphQLField 7752 @GraphQLName("employee") 7753 static EmployeeObject employee(final DataFetchingEnvironment env, 7754 @GraphQLName("employeeName") final String employeeName, 7755 @GraphQLName("partyName") final String partyName, 7756 @GraphQLName("id") @GraphQLID final String id) { 7757 PartyEmployee partyEmployee; 7758 7759 try { 7760 var commandForm = EmployeeUtil.getHome().getGetEmployeeForm(); 7761 7762 commandForm.setEmployeeName(employeeName); 7763 commandForm.setPartyName(partyName); 7764 commandForm.setUuid(id); 7765 7766 partyEmployee = CDI.current().select(GetEmployeeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7767 } catch (NamingException ex) { 7768 throw new RuntimeException(ex); 7769 } 7770 7771 return partyEmployee == null ? null : new EmployeeObject(partyEmployee); 7772 } 7773 7774 @GraphQLField 7775 @GraphQLName("employees") 7776 @GraphQLNonNull 7777 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7778 static CountingPaginatedData<EmployeeObject> employees(final DataFetchingEnvironment env) { 7779 CountingPaginatedData<EmployeeObject> data; 7780 7781 try { 7782 var commandForm = EmployeeUtil.getHome().getGetEmployeesForm(); 7783 var command = CDI.current().select(GetEmployeesCommand.class).get(); 7784 7785 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7786 if(totalEntities == null) { 7787 data = Connections.emptyConnection(); 7788 } else { 7789 try(var objectLimiter = new ObjectLimiter(env, PartyEmployeeConstants.COMPONENT_VENDOR_NAME, PartyEmployeeConstants.ENTITY_TYPE_NAME, totalEntities)) { 7790 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7791 7792 var employees = entities.stream() 7793 .map(EmployeeObject::new) 7794 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7795 7796 data = new CountedObjects<>(objectLimiter, employees); 7797 } 7798 } 7799 } catch (NamingException ex) { 7800 throw new RuntimeException(ex); 7801 } 7802 7803 return data; 7804 } 7805 7806 @GraphQLField 7807 @GraphQLName("vendorType") 7808 static VendorTypeObject vendorType(final DataFetchingEnvironment env, 7809 @GraphQLName("vendorTypeName") final String vendorTypeName, 7810 @GraphQLName("id") @GraphQLID final String id) { 7811 VendorType vendorType; 7812 7813 try { 7814 var commandForm = VendorUtil.getHome().getGetVendorTypeForm(); 7815 7816 commandForm.setVendorTypeName(vendorTypeName); 7817 commandForm.setUuid(id); 7818 7819 vendorType = CDI.current().select(GetVendorTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7820 } catch (NamingException ex) { 7821 throw new RuntimeException(ex); 7822 } 7823 7824 return vendorType == null ? null : new VendorTypeObject(vendorType); 7825 } 7826 7827 @GraphQLField 7828 @GraphQLName("vendorTypes") 7829 @GraphQLNonNull 7830 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7831 static CountingPaginatedData<VendorTypeObject> vendorTypes(final DataFetchingEnvironment env) { 7832 CountingPaginatedData<VendorTypeObject> data; 7833 7834 try { 7835 var commandForm = VendorUtil.getHome().getGetVendorTypesForm(); 7836 var command = CDI.current().select(GetVendorTypesCommand.class).get(); 7837 7838 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7839 if(totalEntities == null) { 7840 data = Connections.emptyConnection(); 7841 } else { 7842 try(var objectLimiter = new ObjectLimiter(env, VendorTypeConstants.COMPONENT_VENDOR_NAME, VendorTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 7843 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7844 7845 var vendorTypes = entities.stream() 7846 .map(VendorTypeObject::new) 7847 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7848 7849 data = new CountedObjects<>(objectLimiter, vendorTypes); 7850 } 7851 } 7852 } catch (NamingException ex) { 7853 throw new RuntimeException(ex); 7854 } 7855 7856 return data; 7857 } 7858 7859 @GraphQLField 7860 @GraphQLName("vendor") 7861 static VendorObject vendor(final DataFetchingEnvironment env, 7862 @GraphQLName("vendorName") final String vendorName, 7863 @GraphQLName("partyName") final String partyName, 7864 @GraphQLName("id") @GraphQLID final String id) { 7865 Vendor vendor; 7866 7867 try { 7868 var commandForm = VendorUtil.getHome().getGetVendorForm(); 7869 7870 commandForm.setVendorName(vendorName); 7871 commandForm.setPartyName(partyName); 7872 commandForm.setUuid(id); 7873 7874 vendor = CDI.current().select(GetVendorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7875 } catch (NamingException ex) { 7876 throw new RuntimeException(ex); 7877 } 7878 7879 return vendor == null ? null : new VendorObject(vendor); 7880 } 7881 7882 @GraphQLField 7883 @GraphQLName("vendors") 7884 @GraphQLNonNull 7885 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7886 static CountingPaginatedData<VendorObject> vendors(final DataFetchingEnvironment env) { 7887 CountingPaginatedData<VendorObject> data; 7888 7889 try { 7890 var commandForm = VendorUtil.getHome().getGetVendorsForm(); 7891 var command = CDI.current().select(GetVendorsCommand.class).get(); 7892 7893 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7894 if(totalEntities == null) { 7895 data = Connections.emptyConnection(); 7896 } else { 7897 try(var objectLimiter = new ObjectLimiter(env, VendorConstants.COMPONENT_VENDOR_NAME, VendorConstants.ENTITY_TYPE_NAME, totalEntities)) { 7898 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7899 7900 var vendors = entities.stream() 7901 .map(VendorObject::new) 7902 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7903 7904 data = new CountedObjects<>(objectLimiter, vendors); 7905 } 7906 } 7907 } catch (NamingException ex) { 7908 throw new RuntimeException(ex); 7909 } 7910 7911 return data; 7912 } 7913 7914 @GraphQLField 7915 @GraphQLName("vendorItem") 7916 static VendorItemObject vendorItem(final DataFetchingEnvironment env, 7917 @GraphQLName("vendorName") final String vendorName, 7918 @GraphQLName("partyName") final String partyName, 7919 @GraphQLName("vendorItemName") final String vendorItemName, 7920 @GraphQLName("id") @GraphQLID final String id) { 7921 VendorItem vendorItem; 7922 7923 try { 7924 var commandForm = VendorUtil.getHome().getGetVendorItemForm(); 7925 7926 commandForm.setVendorName(vendorName); 7927 commandForm.setPartyName(partyName); 7928 commandForm.setVendorItemName(vendorItemName); 7929 commandForm.setUuid(id); 7930 7931 vendorItem = CDI.current().select(GetVendorItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7932 } catch (NamingException ex) { 7933 throw new RuntimeException(ex); 7934 } 7935 7936 return vendorItem == null ? null : new VendorItemObject(vendorItem); 7937 } 7938 7939 @GraphQLField 7940 @GraphQLName("vendorItems") 7941 @GraphQLNonNull 7942 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7943 static CountingPaginatedData<VendorItemObject> vendorItems(final DataFetchingEnvironment env, 7944 @GraphQLName("vendorName") final String vendorName, 7945 @GraphQLName("itemName") final String itemName) { 7946 CountingPaginatedData<VendorItemObject> data; 7947 7948 try { 7949 var commandForm = VendorUtil.getHome().getGetVendorItemsForm(); 7950 var command = CDI.current().select(GetVendorItemsCommand.class).get(); 7951 7952 commandForm.setVendorName(vendorName); 7953 commandForm.setItemName(itemName); 7954 7955 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7956 if(totalEntities == null) { 7957 data = Connections.emptyConnection(); 7958 } else { 7959 try(var objectLimiter = new ObjectLimiter(env, VendorItemConstants.COMPONENT_VENDOR_NAME, VendorItemConstants.ENTITY_TYPE_NAME, totalEntities)) { 7960 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7961 7962 var vendorItems = entities.stream() 7963 .map(VendorItemObject::new) 7964 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7965 7966 data = new CountedObjects<>(objectLimiter, vendorItems); 7967 } 7968 } 7969 } catch (NamingException ex) { 7970 throw new RuntimeException(ex); 7971 } 7972 7973 return data; 7974 } 7975 7976 @GraphQLField 7977 @GraphQLName("vendorItemCost") 7978 static VendorItemCostObject vendorItemCost(final DataFetchingEnvironment env, 7979 @GraphQLName("vendorName") final String vendorName, 7980 @GraphQLName("partyName") final String partyName, 7981 @GraphQLName("vendorItemName") @GraphQLNonNull final String vendorItemName, 7982 @GraphQLName("inventoryConditionName") @GraphQLNonNull final String inventoryConditionName, 7983 @GraphQLName("unitOfMeasureTypeName") @GraphQLNonNull final String unitOfMeasureTypeName) { 7984 VendorItemCost vendorItemCost; 7985 7986 try { 7987 var commandForm = VendorUtil.getHome().getGetVendorItemCostForm(); 7988 7989 commandForm.setVendorName(vendorName); 7990 commandForm.setPartyName(partyName); 7991 commandForm.setVendorItemName(vendorItemName); 7992 commandForm.setInventoryConditionName(inventoryConditionName); 7993 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 7994 7995 vendorItemCost = CDI.current().select(GetVendorItemCostCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7996 } catch (NamingException ex) { 7997 throw new RuntimeException(ex); 7998 } 7999 8000 return vendorItemCost == null ? null : new VendorItemCostObject(vendorItemCost); 8001 } 8002 8003 @GraphQLField 8004 @GraphQLName("vendorItemCosts") 8005 @GraphQLNonNull 8006 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8007 static CountingPaginatedData<VendorItemCostObject> vendorItemCosts(final DataFetchingEnvironment env, 8008 @GraphQLName("vendorName") @GraphQLNonNull final String vendorName, 8009 @GraphQLName("vendorItemName") @GraphQLNonNull final String vendorItemName) { 8010 CountingPaginatedData<VendorItemCostObject> data; 8011 8012 try { 8013 var commandForm = VendorUtil.getHome().getGetVendorItemCostsForm(); 8014 8015 commandForm.setVendorName(vendorName); 8016 commandForm.setVendorItemName(vendorItemName); 8017 8018 var command = CDI.current().select(GetVendorItemCostsCommand.class).get(); 8019 8020 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8021 if(totalEntities == null) { 8022 data = Connections.emptyConnection(); 8023 } else { 8024 try(var objectLimiter = new ObjectLimiter(env, VendorItemCostConstants.COMPONENT_VENDOR_NAME, VendorItemCostConstants.ENTITY_TYPE_NAME, totalEntities)) { 8025 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8026 8027 var vendorItemCosts = entities.stream() 8028 .map(VendorItemCostObject::new) 8029 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8030 8031 data = new CountedObjects<>(objectLimiter, vendorItemCosts); 8032 } 8033 } 8034 } catch (NamingException ex) { 8035 throw new RuntimeException(ex); 8036 } 8037 8038 return data; 8039 } 8040 8041 @GraphQLField 8042 @GraphQLName("roleType") 8043 static RoleTypeObject roleType(final DataFetchingEnvironment env, 8044 @GraphQLName("roleTypeName") final String roleTypeName, 8045 @GraphQLName("id") @GraphQLID final String id) { 8046 RoleType roleType; 8047 8048 try { 8049 var commandForm = PartyUtil.getHome().getGetRoleTypeForm(); 8050 8051 commandForm.setRoleTypeName(roleTypeName); 8052 commandForm.setUuid(id); 8053 8054 roleType = CDI.current().select(GetRoleTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8055 } catch (NamingException ex) { 8056 throw new RuntimeException(ex); 8057 } 8058 8059 return roleType == null ? null : new RoleTypeObject(roleType); 8060 } 8061 8062 @GraphQLField 8063 @GraphQLName("roleTypes") 8064 @GraphQLNonNull 8065 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8066 static CountingPaginatedData<RoleTypeObject> roleTypes(final DataFetchingEnvironment env) { 8067 CountingPaginatedData<RoleTypeObject> data; 8068 8069 try { 8070 var commandForm = PartyUtil.getHome().getGetRoleTypesForm(); 8071 var command = CDI.current().select(GetRoleTypesCommand.class).get(); 8072 8073 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8074 if(totalEntities == null) { 8075 data = Connections.emptyConnection(); 8076 } else { 8077 try(var objectLimiter = new ObjectLimiter(env, RoleTypeConstants.COMPONENT_VENDOR_NAME, RoleTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8078 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8079 8080 var roleTypes = entities.stream() 8081 .map(RoleTypeObject::new) 8082 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8083 8084 data = new CountedObjects<>(objectLimiter, roleTypes); 8085 } 8086 } 8087 } catch (NamingException ex) { 8088 throw new RuntimeException(ex); 8089 } 8090 8091 return data; 8092 } 8093 8094 @GraphQLField 8095 @GraphQLName("partyType") 8096 static PartyTypeObject partyType(final DataFetchingEnvironment env, 8097 @GraphQLName("partyTypeName") final String partyTypeName, 8098 @GraphQLName("id") @GraphQLID final String id) { 8099 PartyType partyType; 8100 8101 try { 8102 var commandForm = PartyUtil.getHome().getGetPartyTypeForm(); 8103 8104 commandForm.setPartyTypeName(partyTypeName); 8105 commandForm.setUuid(id); 8106 8107 partyType = CDI.current().select(GetPartyTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8108 } catch (NamingException ex) { 8109 throw new RuntimeException(ex); 8110 } 8111 8112 return partyType == null ? null : new PartyTypeObject(partyType); 8113 } 8114 8115 @GraphQLField 8116 @GraphQLName("partyTypes") 8117 @GraphQLNonNull 8118 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8119 static CountingPaginatedData<PartyTypeObject> partyTypes(final DataFetchingEnvironment env) { 8120 CountingPaginatedData<PartyTypeObject> data; 8121 8122 try { 8123 var commandForm = PartyUtil.getHome().getGetPartyTypesForm(); 8124 var command = CDI.current().select(GetPartyTypesCommand.class).get(); 8125 8126 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8127 if(totalEntities == null) { 8128 data = Connections.emptyConnection(); 8129 } else { 8130 try(var objectLimiter = new ObjectLimiter(env, PartyTypeConstants.COMPONENT_VENDOR_NAME, PartyTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8131 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8132 8133 var partyTypes = entities.stream() 8134 .map(PartyTypeObject::new) 8135 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8136 8137 data = new CountedObjects<>(objectLimiter, partyTypes); 8138 } 8139 } 8140 } catch (NamingException ex) { 8141 throw new RuntimeException(ex); 8142 } 8143 8144 return data; 8145 } 8146 8147 @GraphQLField 8148 @GraphQLName("partyAliasType") 8149 static PartyAliasTypeObject partyAliasType(final DataFetchingEnvironment env, 8150 @GraphQLName("partyTypeName") final String partyTypeName, 8151 @GraphQLName("partyAliasTypeName") final String partyAliasTypeName, 8152 @GraphQLName("id") @GraphQLID final String id) { 8153 PartyAliasType partyAliasType; 8154 8155 try { 8156 var commandForm = PartyUtil.getHome().getGetPartyAliasTypeForm(); 8157 8158 commandForm.setPartyTypeName(partyTypeName); 8159 commandForm.setPartyAliasTypeName(partyAliasTypeName); 8160 commandForm.setUuid(id); 8161 8162 partyAliasType = CDI.current().select(GetPartyAliasTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8163 } catch (NamingException ex) { 8164 throw new RuntimeException(ex); 8165 } 8166 8167 return partyAliasType == null ? null : new PartyAliasTypeObject(partyAliasType); 8168 } 8169 8170 @GraphQLField 8171 @GraphQLName("partyAliasTypes") 8172 @GraphQLNonNull 8173 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8174 static CountingPaginatedData<PartyAliasTypeObject> partyAliasTypes(final DataFetchingEnvironment env, 8175 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName) { 8176 CountingPaginatedData<PartyAliasTypeObject> data; 8177 8178 try { 8179 var commandForm = PartyUtil.getHome().getGetPartyAliasTypesForm(); 8180 var command = CDI.current().select(GetPartyAliasTypesCommand.class).get(); 8181 8182 commandForm.setPartyTypeName(partyTypeName); 8183 8184 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8185 if(totalEntities == null) { 8186 data = Connections.emptyConnection(); 8187 } else { 8188 try(var objectLimiter = new ObjectLimiter(env, PartyAliasTypeConstants.COMPONENT_VENDOR_NAME, PartyAliasTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8189 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8190 8191 var partyAliasTypes = entities.stream() 8192 .map(PartyAliasTypeObject::new) 8193 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8194 8195 data = new CountedObjects<>(objectLimiter, partyAliasTypes); 8196 } 8197 } 8198 } catch (NamingException ex) { 8199 throw new RuntimeException(ex); 8200 } 8201 8202 return data; 8203 } 8204 8205 @GraphQLField 8206 @GraphQLName("partyAlias") 8207 static PartyAliasObject partyAlias(final DataFetchingEnvironment env, 8208 @GraphQLName("partyName") final String partyName, 8209 @GraphQLName("partyTypeName") final String partyTypeName, 8210 @GraphQLName("partyAliasTypeName") final String partyAliasTypeName, 8211 @GraphQLName("alias") final String alias) { 8212 PartyAlias partyAlias; 8213 8214 try { 8215 var commandForm = PartyUtil.getHome().getGetPartyAliasForm(); 8216 8217 commandForm.setPartyName(partyName); 8218 commandForm.setPartyTypeName(partyTypeName); 8219 commandForm.setPartyAliasTypeName(partyAliasTypeName); 8220 commandForm.setAlias(alias); 8221 8222 partyAlias = CDI.current().select(GetPartyAliasCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8223 } catch (NamingException ex) { 8224 throw new RuntimeException(ex); 8225 } 8226 8227 return partyAlias == null ? null : new PartyAliasObject(partyAlias); 8228 } 8229 8230 @GraphQLField 8231 @GraphQLName("partyAliases") 8232 static Collection<PartyAliasObject> partyAliases(final DataFetchingEnvironment env, 8233 @GraphQLName("partyName") final String partyName, 8234 @GraphQLName("partyTypeName") final String partyTypeName, 8235 @GraphQLName("partyAliasTypeName") final String partyAliasTypeName) { 8236 Collection<PartyAlias> partyAliases; 8237 Collection<PartyAliasObject> partyAliasObjects; 8238 8239 try { 8240 var commandForm = PartyUtil.getHome().getGetPartyAliasesForm(); 8241 8242 commandForm.setPartyName(partyName); 8243 commandForm.setPartyTypeName(partyTypeName); 8244 commandForm.setPartyAliasTypeName(partyAliasTypeName); 8245 8246 partyAliases = CDI.current().select(GetPartyAliasesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8247 } catch (NamingException ex) { 8248 throw new RuntimeException(ex); 8249 } 8250 8251 if(partyAliases == null) { 8252 partyAliasObjects = emptyList(); 8253 } else { 8254 partyAliasObjects = new ArrayList<>(partyAliases.size()); 8255 8256 partyAliases.stream() 8257 .map(PartyAliasObject::new) 8258 .forEachOrdered(partyAliasObjects::add); 8259 } 8260 8261 return partyAliasObjects; 8262 } 8263 8264 @GraphQLField 8265 @GraphQLName("party") 8266 static PartyObject party(final DataFetchingEnvironment env, 8267 @GraphQLName("partyName") final String partyName, 8268 @GraphQLName("id") @GraphQLID final String id) { 8269 Party party; 8270 8271 try { 8272 var commandForm = PartyUtil.getHome().getGetPartyForm(); 8273 8274 commandForm.setPartyName(partyName); 8275 commandForm.setUuid(id); 8276 8277 party = CDI.current().select(GetPartyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8278 } catch (NamingException ex) { 8279 throw new RuntimeException(ex); 8280 } 8281 8282 return party == null ? null : new PartyObject(party); 8283 } 8284 8285 @GraphQLField 8286 @GraphQLName("parties") 8287 @GraphQLNonNull 8288 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8289 static CountingPaginatedData<PartyObject> parties(final DataFetchingEnvironment env) { 8290 CountingPaginatedData<PartyObject> data; 8291 8292 try { 8293 var commandForm = PartyUtil.getHome().getGetPartiesForm(); 8294 var command = CDI.current().select(GetPartiesCommand.class).get(); 8295 8296 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8297 if(totalEntities == null) { 8298 data = Connections.emptyConnection(); 8299 } else { 8300 try(var objectLimiter = new ObjectLimiter(env, PartyConstants.COMPONENT_VENDOR_NAME, PartyConstants.ENTITY_TYPE_NAME, totalEntities)) { 8301 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8302 8303 var parties = entities.stream() 8304 .map(PartyObject::new) 8305 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8306 8307 data = new CountedObjects<>(objectLimiter, parties); 8308 } 8309 } 8310 } catch (NamingException ex) { 8311 throw new RuntimeException(ex); 8312 } 8313 8314 return data; 8315 } 8316 8317 @GraphQLField 8318 @GraphQLName("company") 8319 static CompanyObject company(final DataFetchingEnvironment env, 8320 @GraphQLName("companyName") final String companyName, 8321 @GraphQLName("partyName") final String partyName, 8322 @GraphQLName("id") @GraphQLID final String id) { 8323 PartyCompany company; 8324 8325 try { 8326 var commandForm = PartyUtil.getHome().getGetCompanyForm(); 8327 8328 commandForm.setCompanyName(companyName); 8329 commandForm.setPartyName(partyName); 8330 commandForm.setUuid(id); 8331 8332 company = CDI.current().select(GetCompanyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8333 } catch (NamingException ex) { 8334 throw new RuntimeException(ex); 8335 } 8336 8337 return company == null ? null : new CompanyObject(company); 8338 } 8339 8340 @GraphQLField 8341 @GraphQLName("companies") 8342 @GraphQLNonNull 8343 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8344 static CountingPaginatedData<CompanyObject> companies(final DataFetchingEnvironment env) { 8345 CountingPaginatedData<CompanyObject> data; 8346 8347 try { 8348 var commandForm = PartyUtil.getHome().getGetCompaniesForm(); 8349 var command = CDI.current().select(GetCompaniesCommand.class).get(); 8350 8351 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8352 if(totalEntities == null) { 8353 data = Connections.emptyConnection(); 8354 } else { 8355 try(var objectLimiter = new ObjectLimiter(env, PartyCompanyConstants.COMPONENT_VENDOR_NAME, PartyCompanyConstants.ENTITY_TYPE_NAME, totalEntities)) { 8356 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8357 8358 var companies = entities.stream() 8359 .map(CompanyObject::new) 8360 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8361 8362 data = new CountedObjects<>(objectLimiter, companies); 8363 } 8364 } 8365 } catch (NamingException ex) { 8366 throw new RuntimeException(ex); 8367 } 8368 8369 return data; 8370 } 8371 8372 @GraphQLField 8373 @GraphQLName("division") 8374 static DivisionObject division(final DataFetchingEnvironment env, 8375 @GraphQLName("companyName") final String companyName, 8376 @GraphQLName("divisionName") final String divisionName, 8377 @GraphQLName("partyName") final String partyName, 8378 @GraphQLName("id") @GraphQLID final String id) { 8379 PartyDivision division; 8380 8381 try { 8382 var commandForm = PartyUtil.getHome().getGetDivisionForm(); 8383 8384 commandForm.setCompanyName(companyName); 8385 commandForm.setDivisionName(divisionName); 8386 commandForm.setPartyName(partyName); 8387 commandForm.setUuid(id); 8388 8389 division = CDI.current().select(GetDivisionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8390 } catch (NamingException ex) { 8391 throw new RuntimeException(ex); 8392 } 8393 8394 return division == null ? null : new DivisionObject(division); 8395 } 8396 8397 @GraphQLField 8398 @GraphQLName("divisions") 8399 @GraphQLNonNull 8400 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8401 static CountingPaginatedData<DivisionObject> divisions(final DataFetchingEnvironment env, 8402 @GraphQLName("companyName") @GraphQLNonNull final String companyName) { 8403 CountingPaginatedData<DivisionObject> data; 8404 8405 try { 8406 var commandForm = PartyUtil.getHome().getGetDivisionsForm(); 8407 var command = CDI.current().select(GetDivisionsCommand.class).get(); 8408 8409 commandForm.setCompanyName(companyName); 8410 8411 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8412 if(totalEntities == null) { 8413 data = Connections.emptyConnection(); 8414 } else { 8415 try(var objectLimiter = new ObjectLimiter(env, PartyDivisionConstants.COMPONENT_VENDOR_NAME, PartyDivisionConstants.ENTITY_TYPE_NAME, totalEntities)) { 8416 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8417 8418 var divisions = entities.stream() 8419 .map(DivisionObject::new) 8420 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8421 8422 data = new CountedObjects<>(objectLimiter, divisions); 8423 } 8424 } 8425 } catch (NamingException ex) { 8426 throw new RuntimeException(ex); 8427 } 8428 8429 return data; 8430 } 8431 8432 @GraphQLField 8433 @GraphQLName("department") 8434 static DepartmentObject department(final DataFetchingEnvironment env, 8435 @GraphQLName("companyName") final String companyName, 8436 @GraphQLName("divisionName") final String divisionName, 8437 @GraphQLName("departmentName") final String departmentName, 8438 @GraphQLName("partyName") final String partyName, 8439 @GraphQLName("id") @GraphQLID final String id) { 8440 PartyDepartment department; 8441 8442 try { 8443 var commandForm = PartyUtil.getHome().getGetDepartmentForm(); 8444 8445 commandForm.setCompanyName(companyName); 8446 commandForm.setDivisionName(divisionName); 8447 commandForm.setDepartmentName(departmentName); 8448 commandForm.setPartyName(partyName); 8449 commandForm.setUuid(id); 8450 8451 department = CDI.current().select(GetDepartmentCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8452 } catch (NamingException ex) { 8453 throw new RuntimeException(ex); 8454 } 8455 8456 return department == null ? null : new DepartmentObject(department); 8457 } 8458 8459 @GraphQLField 8460 @GraphQLName("departments") 8461 @GraphQLNonNull 8462 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8463 static CountingPaginatedData<DepartmentObject> departments(final DataFetchingEnvironment env, 8464 @GraphQLName("companyName") @GraphQLNonNull final String companyName, 8465 @GraphQLName("divisionName") final String divisionName) { 8466 CountingPaginatedData<DepartmentObject> data; 8467 8468 try { 8469 var commandForm = PartyUtil.getHome().getGetDepartmentsForm(); 8470 var command = CDI.current().select(GetDepartmentsCommand.class).get(); 8471 8472 commandForm.setCompanyName(companyName); 8473 commandForm.setDivisionName(divisionName); 8474 8475 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8476 if(totalEntities == null) { 8477 data = Connections.emptyConnection(); 8478 } else { 8479 try(var objectLimiter = new ObjectLimiter(env, PartyDepartmentConstants.COMPONENT_VENDOR_NAME, PartyDepartmentConstants.ENTITY_TYPE_NAME, totalEntities)) { 8480 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8481 8482 var departments = entities.stream() 8483 .map(DepartmentObject::new) 8484 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8485 8486 data = new CountedObjects<>(objectLimiter, departments); 8487 } 8488 } 8489 } catch (NamingException ex) { 8490 throw new RuntimeException(ex); 8491 } 8492 8493 return data; 8494 } 8495 8496 @GraphQLField 8497 @GraphQLName("warehouseType") 8498 static WarehouseTypeObject warehouseType(final DataFetchingEnvironment env, 8499 @GraphQLName("warehouseTypeName") final String warehouseTypeName, 8500 @GraphQLName("id") @GraphQLID final String id) { 8501 WarehouseType warehouseType; 8502 8503 try { 8504 var commandForm = WarehouseUtil.getHome().getGetWarehouseTypeForm(); 8505 8506 commandForm.setWarehouseTypeName(warehouseTypeName); 8507 commandForm.setUuid(id); 8508 8509 warehouseType = CDI.current().select(GetWarehouseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8510 } catch (NamingException ex) { 8511 throw new RuntimeException(ex); 8512 } 8513 8514 return warehouseType == null ? null : new WarehouseTypeObject(warehouseType); 8515 } 8516 8517 @GraphQLField 8518 @GraphQLName("warehouseTypes") 8519 @GraphQLNonNull 8520 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8521 static CountingPaginatedData<WarehouseTypeObject> warehouseTypes(final DataFetchingEnvironment env) { 8522 CountingPaginatedData<WarehouseTypeObject> data; 8523 8524 try { 8525 var commandForm = WarehouseUtil.getHome().getGetWarehouseTypesForm(); 8526 var command = CDI.current().select(GetWarehouseTypesCommand.class).get(); 8527 8528 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8529 if(totalEntities == null) { 8530 data = Connections.emptyConnection(); 8531 } else { 8532 try(var objectLimiter = new ObjectLimiter(env, WarehouseTypeConstants.COMPONENT_VENDOR_NAME, WarehouseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8533 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8534 8535 var warehouseTypes = entities.stream() 8536 .map(WarehouseTypeObject::new) 8537 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8538 8539 data = new CountedObjects<>(objectLimiter, warehouseTypes); 8540 } 8541 } 8542 } catch (NamingException ex) { 8543 throw new RuntimeException(ex); 8544 } 8545 8546 return data; 8547 } 8548 8549 @GraphQLField 8550 @GraphQLName("warehouse") 8551 static WarehouseObject warehouse(final DataFetchingEnvironment env, 8552 @GraphQLName("warehouseName") final String warehouseName, 8553 @GraphQLName("partyName") final String partyName, 8554 @GraphQLName("id") @GraphQLID final String id) { 8555 Warehouse warehouse; 8556 8557 try { 8558 var commandForm = WarehouseUtil.getHome().getGetWarehouseForm(); 8559 8560 commandForm.setWarehouseName(warehouseName); 8561 commandForm.setPartyName(partyName); 8562 commandForm.setUuid(id); 8563 8564 warehouse = CDI.current().select(GetWarehouseCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8565 } catch (NamingException ex) { 8566 throw new RuntimeException(ex); 8567 } 8568 8569 return warehouse == null ? null : new WarehouseObject(warehouse); 8570 } 8571 8572 @GraphQLField 8573 @GraphQLName("warehouses") 8574 @GraphQLNonNull 8575 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8576 static CountingPaginatedData<WarehouseObject> warehouses(final DataFetchingEnvironment env) { 8577 CountingPaginatedData<WarehouseObject> data; 8578 8579 try { 8580 var commandForm = WarehouseUtil.getHome().getGetWarehousesForm(); 8581 var command = CDI.current().select(GetWarehousesCommand.class).get(); 8582 8583 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8584 if(totalEntities == null) { 8585 data = Connections.emptyConnection(); 8586 } else { 8587 try(var objectLimiter = new ObjectLimiter(env, WarehouseConstants.COMPONENT_VENDOR_NAME, WarehouseConstants.ENTITY_TYPE_NAME, totalEntities)) { 8588 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8589 8590 var warehouses = entities.stream() 8591 .map(WarehouseObject::new) 8592 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8593 8594 data = new CountedObjects<>(objectLimiter, warehouses); 8595 } 8596 } 8597 } catch (NamingException ex) { 8598 throw new RuntimeException(ex); 8599 } 8600 8601 return data; 8602 } 8603 8604 @GraphQLField 8605 @GraphQLName("locationUseType") 8606 static LocationUseTypeObject locationUseType(final DataFetchingEnvironment env, 8607 @GraphQLName("locationUseTypeName") final String locationUseTypeName, 8608 @GraphQLName("id") @GraphQLID final String id) { 8609 LocationUseType locationUseType; 8610 8611 try { 8612 var commandForm = WarehouseUtil.getHome().getGetLocationUseTypeForm(); 8613 8614 commandForm.setLocationUseTypeName(locationUseTypeName); 8615 commandForm.setUuid(id); 8616 8617 locationUseType = CDI.current().select(GetLocationUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8618 } catch (NamingException ex) { 8619 throw new RuntimeException(ex); 8620 } 8621 8622 return locationUseType == null ? null : new LocationUseTypeObject(locationUseType); 8623 } 8624 8625 @GraphQLField 8626 @GraphQLName("locationUseTypes") 8627 @GraphQLNonNull 8628 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8629 static CountingPaginatedData<LocationUseTypeObject> locationUseTypes(final DataFetchingEnvironment env) { 8630 CountingPaginatedData<LocationUseTypeObject> data; 8631 8632 try { 8633 var commandForm = WarehouseUtil.getHome().getGetLocationUseTypesForm(); 8634 var command = CDI.current().select(GetLocationUseTypesCommand.class).get(); 8635 8636 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8637 if(totalEntities == null) { 8638 data = Connections.emptyConnection(); 8639 } else { 8640 try(var objectLimiter = new ObjectLimiter(env, LocationUseTypeConstants.COMPONENT_VENDOR_NAME, LocationUseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8641 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8642 8643 var locationUseTypes = entities.stream() 8644 .map(LocationUseTypeObject::new) 8645 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8646 8647 data = new CountedObjects<>(objectLimiter, locationUseTypes); 8648 } 8649 } 8650 } catch (NamingException ex) { 8651 throw new RuntimeException(ex); 8652 } 8653 8654 return data; 8655 } 8656 8657 @GraphQLField 8658 @GraphQLName("inventoryLocationGroup") 8659 static InventoryLocationGroupObject inventoryLocationGroup(final DataFetchingEnvironment env, 8660 @GraphQLName("warehouseName") final String warehouseName, 8661 @GraphQLName("inventoryLocationGroupName") final String inventoryLocationGroupName) { 8662 InventoryLocationGroup inventoryLocationGroup; 8663 8664 try { 8665 var commandForm = InventoryUtil.getHome().getGetInventoryLocationGroupForm(); 8666 8667 commandForm.setWarehouseName(warehouseName); 8668 commandForm.setInventoryLocationGroupName(inventoryLocationGroupName); 8669 8670 inventoryLocationGroup = CDI.current().select(GetInventoryLocationGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8671 } catch (NamingException ex) { 8672 throw new RuntimeException(ex); 8673 } 8674 8675 return inventoryLocationGroup == null ? null : new InventoryLocationGroupObject(inventoryLocationGroup); 8676 } 8677 8678 @GraphQLField 8679 @GraphQLName("inventoryLocationGroups") 8680 @GraphQLNonNull 8681 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8682 static CountingPaginatedData<InventoryLocationGroupObject> inventoryLocationGroups(final DataFetchingEnvironment env, 8683 @GraphQLName("warehouseName") final String warehouseName) { 8684 CountingPaginatedData<InventoryLocationGroupObject> data; 8685 8686 try { 8687 var commandForm = InventoryUtil.getHome().getGetInventoryLocationGroupsForm(); 8688 var command = CDI.current().select(GetInventoryLocationGroupsCommand.class).get(); 8689 8690 commandForm.setWarehouseName(warehouseName); 8691 8692 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8693 if(totalEntities == null) { 8694 data = Connections.emptyConnection(); 8695 } else { 8696 try(var objectLimiter = new ObjectLimiter(env, InventoryLocationGroupConstants.COMPONENT_VENDOR_NAME, InventoryLocationGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 8697 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8698 8699 var inventoryLocationGroups = entities.stream() 8700 .map(InventoryLocationGroupObject::new) 8701 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8702 8703 data = new CountedObjects<>(objectLimiter, inventoryLocationGroups); 8704 } 8705 } 8706 } catch (NamingException ex) { 8707 throw new RuntimeException(ex); 8708 } 8709 8710 return data; 8711 } 8712 8713 @GraphQLField 8714 @GraphQLName("locationType") 8715 static LocationTypeObject locationType(final DataFetchingEnvironment env, 8716 @GraphQLName("warehouseName") final String warehouseName, 8717 @GraphQLName("locationTypeName") final String locationTypeName) { 8718 LocationType locationType; 8719 8720 try { 8721 var commandForm = WarehouseUtil.getHome().getGetLocationTypeForm(); 8722 8723 commandForm.setWarehouseName(warehouseName); 8724 commandForm.setLocationTypeName(locationTypeName); 8725 8726 locationType = CDI.current().select(GetLocationTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8727 } catch (NamingException ex) { 8728 throw new RuntimeException(ex); 8729 } 8730 8731 return locationType == null ? null : new LocationTypeObject(locationType); 8732 } 8733 8734 @GraphQLField 8735 @GraphQLName("locationTypes") 8736 @GraphQLNonNull 8737 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8738 static CountingPaginatedData<LocationTypeObject> locationTypes(final DataFetchingEnvironment env, 8739 @GraphQLName("warehouseName") final String warehouseName) { 8740 CountingPaginatedData<LocationTypeObject> data; 8741 8742 try { 8743 var commandForm = WarehouseUtil.getHome().getGetLocationTypesForm(); 8744 var command = CDI.current().select(GetLocationTypesCommand.class).get(); 8745 8746 commandForm.setWarehouseName(warehouseName); 8747 8748 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8749 if(totalEntities == null) { 8750 data = Connections.emptyConnection(); 8751 } else { 8752 try(var objectLimiter = new ObjectLimiter(env, LocationTypeConstants.COMPONENT_VENDOR_NAME, LocationTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8753 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8754 8755 var locationTypes = entities.stream() 8756 .map(LocationTypeObject::new) 8757 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8758 8759 data = new CountedObjects<>(objectLimiter, locationTypes); 8760 } 8761 } 8762 } catch (NamingException ex) { 8763 throw new RuntimeException(ex); 8764 } 8765 8766 return data; 8767 } 8768 8769 @GraphQLField 8770 @GraphQLName("locationNameElement") 8771 static LocationNameElementObject locationNameElement(final DataFetchingEnvironment env, 8772 @GraphQLName("warehouseName") final String warehouseName, 8773 @GraphQLName("locationTypeName") final String locationTypeName, 8774 @GraphQLName("locationNameElementName") final String locationNameElementName) { 8775 LocationNameElement locationNameElement; 8776 8777 try { 8778 var commandForm = WarehouseUtil.getHome().getGetLocationNameElementForm(); 8779 8780 commandForm.setWarehouseName(warehouseName); 8781 commandForm.setLocationTypeName(locationTypeName); 8782 commandForm.setLocationNameElementName(locationNameElementName); 8783 8784 locationNameElement = CDI.current().select(GetLocationNameElementCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8785 } catch (NamingException ex) { 8786 throw new RuntimeException(ex); 8787 } 8788 8789 return locationNameElement == null ? null : new LocationNameElementObject(locationNameElement); 8790 } 8791 8792 @GraphQLField 8793 @GraphQLName("locationNameElements") 8794 @GraphQLNonNull 8795 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8796 static CountingPaginatedData<LocationNameElementObject> locationNameElements(final DataFetchingEnvironment env, 8797 @GraphQLName("warehouseName") final String warehouseName, 8798 @GraphQLName("locationTypeName") final String locationTypeName) { 8799 CountingPaginatedData<LocationNameElementObject> data; 8800 8801 try { 8802 var commandForm = WarehouseUtil.getHome().getGetLocationNameElementsForm(); 8803 var command = CDI.current().select(GetLocationNameElementsCommand.class).get(); 8804 8805 commandForm.setWarehouseName(warehouseName); 8806 commandForm.setLocationTypeName(locationTypeName); 8807 8808 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8809 if(totalEntities == null) { 8810 data = Connections.emptyConnection(); 8811 } else { 8812 try(var objectLimiter = new ObjectLimiter(env, LocationNameElementConstants.COMPONENT_VENDOR_NAME, LocationNameElementConstants.ENTITY_TYPE_NAME, totalEntities)) { 8813 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8814 8815 var locationNameElements = entities.stream() 8816 .map(LocationNameElementObject::new) 8817 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8818 8819 data = new CountedObjects<>(objectLimiter, locationNameElements); 8820 } 8821 } 8822 } catch (NamingException ex) { 8823 throw new RuntimeException(ex); 8824 } 8825 8826 return data; 8827 } 8828 8829 @GraphQLField 8830 @GraphQLName("location") 8831 static LocationObject location(final DataFetchingEnvironment env, 8832 @GraphQLName("warehouseName") final String warehouseName, 8833 @GraphQLName("locationName") final String locationName) { 8834 Location location; 8835 8836 try { 8837 var commandForm = WarehouseUtil.getHome().getGetLocationForm(); 8838 8839 commandForm.setWarehouseName(warehouseName); 8840 commandForm.setLocationName(locationName); 8841 8842 location = CDI.current().select(GetLocationCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8843 } catch (NamingException ex) { 8844 throw new RuntimeException(ex); 8845 } 8846 8847 return location == null ? null : new LocationObject(location); 8848 } 8849 8850 @GraphQLField 8851 @GraphQLName("locations") 8852 @GraphQLNonNull 8853 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8854 static CountingPaginatedData<LocationObject> locations(final DataFetchingEnvironment env, 8855 @GraphQLName("warehouseName") final String warehouseName) { 8856 CountingPaginatedData<LocationObject> data; 8857 8858 try { 8859 var commandForm = WarehouseUtil.getHome().getGetLocationsForm(); 8860 var command = CDI.current().select(GetLocationsCommand.class).get(); 8861 8862 commandForm.setWarehouseName(warehouseName); 8863 8864 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8865 if(totalEntities == null) { 8866 data = Connections.emptyConnection(); 8867 } else { 8868 try(var objectLimiter = new ObjectLimiter(env, LocationConstants.COMPONENT_VENDOR_NAME, LocationConstants.ENTITY_TYPE_NAME, totalEntities)) { 8869 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8870 8871 var locations = entities.stream() 8872 .map(LocationObject::new) 8873 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8874 8875 data = new CountedObjects<>(objectLimiter, locations); 8876 } 8877 } 8878 } catch (NamingException ex) { 8879 throw new RuntimeException(ex); 8880 } 8881 8882 return data; 8883 } 8884 8885 @GraphQLField 8886 @GraphQLName("cancellationKind") 8887 static CancellationKindObject cancellationKind(final DataFetchingEnvironment env, 8888 @GraphQLName("cancellationKindName") final String cancellationKindName, 8889 @GraphQLName("id") @GraphQLID final String id) { 8890 CancellationKind cancellationKind; 8891 8892 try { 8893 var commandForm = CancellationPolicyUtil.getHome().getGetCancellationKindForm(); 8894 8895 commandForm.setCancellationKindName(cancellationKindName); 8896 commandForm.setUuid(id); 8897 8898 cancellationKind = CDI.current().select(GetCancellationKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8899 } catch (NamingException ex) { 8900 throw new RuntimeException(ex); 8901 } 8902 8903 return cancellationKind == null ? null : new CancellationKindObject(cancellationKind); 8904 } 8905 8906 @GraphQLField 8907 @GraphQLName("cancellationKinds") 8908 @GraphQLNonNull 8909 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8910 static CountingPaginatedData<CancellationKindObject> cancellationKinds(final DataFetchingEnvironment env) { 8911 CountingPaginatedData<CancellationKindObject> data; 8912 8913 try { 8914 var commandForm = CancellationPolicyUtil.getHome().getGetCancellationKindsForm(); 8915 var command = CDI.current().select(GetCancellationKindsCommand.class).get(); 8916 8917 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8918 if(totalEntities == null) { 8919 data = Connections.emptyConnection(); 8920 } else { 8921 try(var objectLimiter = new ObjectLimiter(env, CancellationKindConstants.COMPONENT_VENDOR_NAME, CancellationKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 8922 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8923 8924 var cancellationKinds = entities.stream() 8925 .map(CancellationKindObject::new) 8926 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8927 8928 data = new CountedObjects<>(objectLimiter, cancellationKinds); 8929 } 8930 } 8931 } catch (NamingException ex) { 8932 throw new RuntimeException(ex); 8933 } 8934 8935 return data; 8936 } 8937 8938 @GraphQLField 8939 @GraphQLName("cancellationPolicy") 8940 static CancellationPolicyObject cancellationPolicy(final DataFetchingEnvironment env, 8941 @GraphQLName("cancellationKindName") final String cancellationKindName, 8942 @GraphQLName("cancellationPolicyName") final String cancellationPolicyName, 8943 @GraphQLName("id") @GraphQLID final String id) { 8944 CancellationPolicy cancellationPolicy; 8945 8946 try { 8947 var commandForm = CancellationPolicyUtil.getHome().getGetCancellationPolicyForm(); 8948 8949 commandForm.setCancellationKindName(cancellationKindName); 8950 commandForm.setCancellationPolicyName(cancellationPolicyName); 8951 commandForm.setUuid(id); 8952 8953 cancellationPolicy = CDI.current().select(GetCancellationPolicyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8954 } catch (NamingException ex) { 8955 throw new RuntimeException(ex); 8956 } 8957 8958 return cancellationPolicy == null ? null : new CancellationPolicyObject(cancellationPolicy); 8959 } 8960 8961 @GraphQLField 8962 @GraphQLName("cancellationPolicies") 8963 @GraphQLNonNull 8964 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8965 static CountingPaginatedData<CancellationPolicyObject> cancellationPolicies(final DataFetchingEnvironment env, 8966 @GraphQLName("cancellationKindName") final String cancellationKindName) { 8967 CountingPaginatedData<CancellationPolicyObject> data; 8968 8969 try { 8970 var commandForm = CancellationPolicyUtil.getHome().getGetCancellationPoliciesForm(); 8971 var command = CDI.current().select(GetCancellationPoliciesCommand.class).get(); 8972 8973 commandForm.setCancellationKindName(cancellationKindName); 8974 8975 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8976 if(totalEntities == null) { 8977 data = Connections.emptyConnection(); 8978 } else { 8979 try(var objectLimiter = new ObjectLimiter(env, CancellationPolicyConstants.COMPONENT_VENDOR_NAME, CancellationPolicyConstants.ENTITY_TYPE_NAME, totalEntities)) { 8980 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8981 8982 var cancellationPolicies = entities.stream() 8983 .map(CancellationPolicyObject::new) 8984 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8985 8986 data = new CountedObjects<>(objectLimiter, cancellationPolicies); 8987 } 8988 } 8989 } catch (NamingException ex) { 8990 throw new RuntimeException(ex); 8991 } 8992 8993 return data; 8994 } 8995 8996 @GraphQLField 8997 @GraphQLName("returnKind") 8998 static ReturnKindObject returnKind(final DataFetchingEnvironment env, 8999 @GraphQLName("returnKindName") final String returnKindName, 9000 @GraphQLName("id") @GraphQLID final String id) { 9001 ReturnKind returnKind; 9002 9003 try { 9004 var commandForm = ReturnPolicyUtil.getHome().getGetReturnKindForm(); 9005 9006 commandForm.setReturnKindName(returnKindName); 9007 commandForm.setUuid(id); 9008 9009 returnKind = CDI.current().select(GetReturnKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9010 } catch (NamingException ex) { 9011 throw new RuntimeException(ex); 9012 } 9013 9014 return returnKind == null ? null : new ReturnKindObject(returnKind); 9015 } 9016 9017 @GraphQLField 9018 @GraphQLName("returnKinds") 9019 @GraphQLNonNull 9020 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9021 static CountingPaginatedData<ReturnKindObject> returnKinds(final DataFetchingEnvironment env) { 9022 CountingPaginatedData<ReturnKindObject> data; 9023 9024 try { 9025 var commandForm = ReturnPolicyUtil.getHome().getGetReturnKindsForm(); 9026 var command = CDI.current().select(GetReturnKindsCommand.class).get(); 9027 9028 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9029 if(totalEntities == null) { 9030 data = Connections.emptyConnection(); 9031 } else { 9032 try(var objectLimiter = new ObjectLimiter(env, ReturnKindConstants.COMPONENT_VENDOR_NAME, ReturnKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 9033 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9034 9035 var returnKinds = entities.stream() 9036 .map(ReturnKindObject::new) 9037 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9038 9039 data = new CountedObjects<>(objectLimiter, returnKinds); 9040 } 9041 } 9042 } catch (NamingException ex) { 9043 throw new RuntimeException(ex); 9044 } 9045 9046 return data; 9047 } 9048 9049 @GraphQLField 9050 @GraphQLName("returnPolicy") 9051 static ReturnPolicyObject returnPolicy(final DataFetchingEnvironment env, 9052 @GraphQLName("returnKindName") final String returnKindName, 9053 @GraphQLName("returnPolicyName") final String returnPolicyName, 9054 @GraphQLName("id") @GraphQLID final String id) { 9055 ReturnPolicy returnPolicy; 9056 9057 try { 9058 var commandForm = ReturnPolicyUtil.getHome().getGetReturnPolicyForm(); 9059 9060 commandForm.setReturnKindName(returnKindName); 9061 commandForm.setReturnPolicyName(returnPolicyName); 9062 commandForm.setUuid(id); 9063 9064 returnPolicy = CDI.current().select(GetReturnPolicyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9065 } catch (NamingException ex) { 9066 throw new RuntimeException(ex); 9067 } 9068 9069 return returnPolicy == null ? null : new ReturnPolicyObject(returnPolicy); 9070 } 9071 9072 @GraphQLField 9073 @GraphQLName("returnPolicies") 9074 @GraphQLNonNull 9075 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9076 static CountingPaginatedData<ReturnPolicyObject> returnPolicies(final DataFetchingEnvironment env, 9077 @GraphQLName("returnKindName") final String returnKindName) { 9078 CountingPaginatedData<ReturnPolicyObject> data; 9079 9080 try { 9081 var commandForm = ReturnPolicyUtil.getHome().getGetReturnPoliciesForm(); 9082 var command = CDI.current().select(GetReturnPoliciesCommand.class).get(); 9083 9084 commandForm.setReturnKindName(returnKindName); 9085 9086 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9087 if(totalEntities == null) { 9088 data = Connections.emptyConnection(); 9089 } else { 9090 try(var objectLimiter = new ObjectLimiter(env, ReturnPolicyConstants.COMPONENT_VENDOR_NAME, ReturnPolicyConstants.ENTITY_TYPE_NAME, totalEntities)) { 9091 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9092 9093 var returnPolicies = entities.stream() 9094 .map(ReturnPolicyObject::new) 9095 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9096 9097 data = new CountedObjects<>(objectLimiter, returnPolicies); 9098 } 9099 } 9100 } catch(NamingException ex) { 9101 throw new RuntimeException(ex); 9102 } 9103 9104 return data; 9105 } 9106 9107 @GraphQLField 9108 @GraphQLName("item") 9109 static ItemObject item(final DataFetchingEnvironment env, 9110 @GraphQLName("itemName") final String itemName, 9111 @GraphQLName("itemNameOrAlias") final String itemNameOrAlias, 9112 @GraphQLName("id") @GraphQLID final String id) { 9113 Item item; 9114 9115 try { 9116 var commandForm = ItemUtil.getHome().getGetItemForm(); 9117 9118 commandForm.setItemName(itemName); 9119 commandForm.setItemNameOrAlias(itemNameOrAlias); 9120 commandForm.setUuid(id); 9121 9122 item = CDI.current().select(GetItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9123 } catch (NamingException ex) { 9124 throw new RuntimeException(ex); 9125 } 9126 9127 return item == null ? null : new ItemObject(item); 9128 } 9129 9130 @GraphQLField 9131 @GraphQLName("items") 9132 @GraphQLNonNull 9133 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9134 static CountingPaginatedData<ItemObject> items(final DataFetchingEnvironment env) { 9135 CountingPaginatedData<ItemObject> data; 9136 9137 try { 9138 var commandForm = ItemUtil.getHome().getGetItemsForm(); 9139 var command = CDI.current().select(GetItemsCommand.class).get(); 9140 9141 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9142 if(totalEntities == null) { 9143 data = Connections.emptyConnection(); 9144 } else { 9145 try(var objectLimiter = new ObjectLimiter(env, ItemConstants.COMPONENT_VENDOR_NAME, ItemConstants.ENTITY_TYPE_NAME, totalEntities)) { 9146 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9147 9148 var items = entities.stream() 9149 .map(ItemObject::new) 9150 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9151 9152 data = new CountedObjects<>(objectLimiter, items); 9153 } 9154 } 9155 } catch (NamingException ex) { 9156 throw new RuntimeException(ex); 9157 } 9158 9159 return data; 9160 } 9161 9162 @GraphQLField 9163 @GraphQLName("itemUnitOfMeasureType") 9164 static ItemUnitOfMeasureTypeObject itemUnitOfMeasureType(final DataFetchingEnvironment env, 9165 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 9166 @GraphQLName("unitOfMeasureTypeName") @GraphQLNonNull final String unitOfMeasureTypeName) { 9167 ItemUnitOfMeasureType itemUnitOfMeasureType; 9168 9169 try { 9170 var commandForm = ItemUtil.getHome().getGetItemUnitOfMeasureTypeForm(); 9171 9172 commandForm.setItemName(itemName); 9173 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 9174 9175 itemUnitOfMeasureType = CDI.current().select(GetItemUnitOfMeasureTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9176 } catch (NamingException ex) { 9177 throw new RuntimeException(ex); 9178 } 9179 9180 return itemUnitOfMeasureType == null ? null : new ItemUnitOfMeasureTypeObject(itemUnitOfMeasureType); 9181 } 9182 9183 @GraphQLField 9184 @GraphQLName("itemUnitOfMeasureTypes") 9185 @GraphQLNonNull 9186 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9187 static CountingPaginatedData<ItemUnitOfMeasureTypeObject> itemUnitOfMeasureTypes(final DataFetchingEnvironment env, 9188 @GraphQLName("itemName") @GraphQLNonNull final String itemName) { 9189 CountingPaginatedData<ItemUnitOfMeasureTypeObject> data; 9190 9191 try { 9192 var commandForm = ItemUtil.getHome().getGetItemUnitOfMeasureTypesForm(); 9193 var command = CDI.current().select(GetItemUnitOfMeasureTypesCommand.class).get(); 9194 9195 commandForm.setItemName(itemName); 9196 9197 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9198 if(totalEntities == null) { 9199 data = Connections.emptyConnection(); 9200 } else { 9201 try(var objectLimiter = new ObjectLimiter(env, ItemUnitOfMeasureTypeConstants.COMPONENT_VENDOR_NAME, ItemUnitOfMeasureTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9202 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9203 9204 var itemUnitOfMeasureTypeObjects = entities.stream() 9205 .map(ItemUnitOfMeasureTypeObject::new) 9206 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9207 9208 data = new CountedObjects<>(objectLimiter, itemUnitOfMeasureTypeObjects); 9209 } 9210 } 9211 } catch (NamingException ex) { 9212 throw new RuntimeException(ex); 9213 } 9214 9215 return data; 9216 } 9217 9218 9219 @GraphQLField 9220 @GraphQLName("itemDescription") 9221 static ItemDescriptionObject itemDescription(final DataFetchingEnvironment env, 9222 @GraphQLName("itemDescriptionTypeName") final String itemDescriptionTypeName, 9223 @GraphQLName("itemName") final String itemName, 9224 @GraphQLName("languageIsoName") final String languageIsoName, 9225 @GraphQLName("id") @GraphQLID final String id, 9226 @GraphQLName("referrer") final String referrer) { 9227 ItemDescription itemDescription; 9228 9229 try { 9230 var commandForm = ItemUtil.getHome().getGetItemDescriptionForm(); 9231 9232 commandForm.setItemDescriptionTypeName(itemDescriptionTypeName); 9233 commandForm.setItemName(itemName); 9234 commandForm.setLanguageIsoName(languageIsoName); 9235 commandForm.setUuid(id); 9236 commandForm.setReferrer(referrer); 9237 9238 itemDescription = CDI.current().select(GetItemDescriptionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9239 } catch (NamingException ex) { 9240 throw new RuntimeException(ex); 9241 } 9242 9243 return itemDescription == null ? null : new ItemDescriptionObject(itemDescription); 9244 } 9245 9246 @GraphQLField 9247 @GraphQLName("itemDescriptions") 9248 @GraphQLNonNull 9249 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9250 static CountingPaginatedData<ItemDescriptionObject> itemDescriptions(final DataFetchingEnvironment env, 9251 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 9252 @GraphQLName("itemDescriptionTypeUseTypeName") final String itemDescriptionTypeUseTypeName, 9253 @GraphQLName("languageIsoName") final String languageIsoName) { 9254 CountingPaginatedData<ItemDescriptionObject> data; 9255 9256 try { 9257 var commandForm = ItemUtil.getHome().getGetItemDescriptionsForm(); 9258 var command = CDI.current().select(GetItemDescriptionsCommand.class).get(); 9259 9260 commandForm.setItemName(itemName); 9261 commandForm.setItemDescriptionTypeUseTypeName(itemDescriptionTypeUseTypeName); 9262 commandForm.setLanguageIsoName(languageIsoName); 9263 9264 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9265 if(totalEntities == null) { 9266 data = Connections.emptyConnection(); 9267 } else { 9268 try(var objectLimiter = new ObjectLimiter(env, ItemDescriptionConstants.COMPONENT_VENDOR_NAME, ItemDescriptionConstants.ENTITY_TYPE_NAME, totalEntities)) { 9269 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9270 var limitOffset = objectLimiter.getLimitOffset(); 9271 var limitCount = objectLimiter.getLimitCount(); 9272 9273 Collection<ItemDescription> limitedEntities; 9274 if(itemDescriptionTypeUseTypeName != null) { 9275 // A Limit must be manually applied. 9276 limitedEntities = entities.stream() 9277 .skip(limitOffset) 9278 .limit(limitCount) 9279 .toList(); 9280 } else { 9281 // A Limit was applied in the SQL Query. 9282 limitedEntities = entities; 9283 } 9284 9285 var itemDescriptions = limitedEntities.stream() 9286 .skip(limitOffset) 9287 .limit(limitCount) 9288 .map(ItemDescriptionObject::new) 9289 .collect(Collectors.toCollection(() -> new ArrayList<>(limitedEntities.size()))); 9290 9291 data = new CountedObjects<>(objectLimiter, itemDescriptions); 9292 } 9293 } 9294 } catch (NamingException ex) { 9295 throw new RuntimeException(ex); 9296 } 9297 9298 return data; 9299 } 9300 9301 @GraphQLField 9302 @GraphQLName("itemType") 9303 static ItemTypeObject itemType(final DataFetchingEnvironment env, 9304 @GraphQLName("itemTypeName") final String itemTypeName, 9305 @GraphQLName("id") @GraphQLID final String id) { 9306 ItemType itemType; 9307 9308 try { 9309 var commandForm = ItemUtil.getHome().getGetItemTypeForm(); 9310 9311 commandForm.setItemTypeName(itemTypeName); 9312 commandForm.setUuid(id); 9313 9314 itemType = CDI.current().select(GetItemTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9315 } catch (NamingException ex) { 9316 throw new RuntimeException(ex); 9317 } 9318 9319 return itemType == null ? null : new ItemTypeObject(itemType); 9320 } 9321 9322 @GraphQLField 9323 @GraphQLName("itemTypes") 9324 @GraphQLNonNull 9325 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9326 static CountingPaginatedData<ItemTypeObject> itemTypes(final DataFetchingEnvironment env) { 9327 CountingPaginatedData<ItemTypeObject> data; 9328 9329 try { 9330 var commandForm = ItemUtil.getHome().getGetItemTypesForm(); 9331 var command = CDI.current().select(GetItemTypesCommand.class).get(); 9332 9333 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9334 if(totalEntities == null) { 9335 data = Connections.emptyConnection(); 9336 } else { 9337 try(var objectLimiter = new ObjectLimiter(env, ItemTypeConstants.COMPONENT_VENDOR_NAME, ItemTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9338 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9339 9340 var itemTypes = entities.stream() 9341 .map(ItemTypeObject::new) 9342 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9343 9344 data = new CountedObjects<>(objectLimiter, itemTypes); 9345 } 9346 } 9347 } catch (NamingException ex) { 9348 throw new RuntimeException(ex); 9349 } 9350 9351 return data; 9352 } 9353 9354 @GraphQLField 9355 @GraphQLName("itemUseType") 9356 static ItemUseTypeObject itemUseType(final DataFetchingEnvironment env, 9357 @GraphQLName("itemUseTypeName") final String itemUseTypeName, 9358 @GraphQLName("id") @GraphQLID final String id) { 9359 ItemUseType itemUseType; 9360 9361 try { 9362 var commandForm = ItemUtil.getHome().getGetItemUseTypeForm(); 9363 9364 commandForm.setItemUseTypeName(itemUseTypeName); 9365 commandForm.setUuid(id); 9366 9367 itemUseType = CDI.current().select(GetItemUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9368 } catch (NamingException ex) { 9369 throw new RuntimeException(ex); 9370 } 9371 9372 return itemUseType == null ? null : new ItemUseTypeObject(itemUseType); 9373 } 9374 9375 @GraphQLField 9376 @GraphQLName("itemUseTypes") 9377 @GraphQLNonNull 9378 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9379 static CountingPaginatedData<ItemUseTypeObject> itemUseTypes(final DataFetchingEnvironment env) { 9380 CountingPaginatedData<ItemUseTypeObject> data; 9381 9382 try { 9383 var commandForm = ItemUtil.getHome().getGetItemUseTypesForm(); 9384 var command = CDI.current().select(GetItemUseTypesCommand.class).get(); 9385 9386 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9387 if(totalEntities == null) { 9388 data = Connections.emptyConnection(); 9389 } else { 9390 try(var objectLimiter = new ObjectLimiter(env, ItemUseTypeConstants.COMPONENT_VENDOR_NAME, ItemUseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9391 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9392 9393 var itemUseTypes = entities.stream() 9394 .map(ItemUseTypeObject::new) 9395 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9396 9397 data = new CountedObjects<>(objectLimiter, itemUseTypes); 9398 } 9399 } 9400 } catch (NamingException ex) { 9401 throw new RuntimeException(ex); 9402 } 9403 9404 return data; 9405 } 9406 9407 @GraphQLField 9408 @GraphQLName("itemPriceType") 9409 static ItemPriceTypeObject itemPriceType(final DataFetchingEnvironment env, 9410 @GraphQLName("itemPriceTypeName") final String itemPriceTypeName, 9411 @GraphQLName("id") @GraphQLID final String id) { 9412 ItemPriceType itemPriceType; 9413 9414 try { 9415 var commandForm = ItemUtil.getHome().getGetItemPriceTypeForm(); 9416 9417 commandForm.setItemPriceTypeName(itemPriceTypeName); 9418 commandForm.setUuid(id); 9419 9420 itemPriceType = CDI.current().select(GetItemPriceTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9421 } catch (NamingException ex) { 9422 throw new RuntimeException(ex); 9423 } 9424 9425 return itemPriceType == null ? null : new ItemPriceTypeObject(itemPriceType); 9426 } 9427 9428 @GraphQLField 9429 @GraphQLName("itemPriceTypes") 9430 @GraphQLNonNull 9431 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9432 static CountingPaginatedData<ItemPriceTypeObject> itemPriceTypes(final DataFetchingEnvironment env) { 9433 CountingPaginatedData<ItemPriceTypeObject> data; 9434 9435 try { 9436 var commandForm = ItemUtil.getHome().getGetItemPriceTypesForm(); 9437 var command = CDI.current().select(GetItemPriceTypesCommand.class).get(); 9438 9439 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9440 if(totalEntities == null) { 9441 data = Connections.emptyConnection(); 9442 } else { 9443 try(var objectLimiter = new ObjectLimiter(env, ItemPriceTypeConstants.COMPONENT_VENDOR_NAME, ItemPriceTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9444 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9445 9446 var itemPriceTypes = entities.stream() 9447 .map(ItemPriceTypeObject::new) 9448 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9449 9450 data = new CountedObjects<>(objectLimiter, itemPriceTypes); 9451 } 9452 } 9453 } catch (NamingException ex) { 9454 throw new RuntimeException(ex); 9455 } 9456 9457 return data; 9458 } 9459 9460 @GraphQLField 9461 @GraphQLName("itemDeliveryType") 9462 static ItemDeliveryTypeObject itemDeliveryType(final DataFetchingEnvironment env, 9463 @GraphQLName("itemDeliveryTypeName") final String itemDeliveryTypeName, 9464 @GraphQLName("id") @GraphQLID final String id) { 9465 ItemDeliveryType itemDeliveryType; 9466 9467 try { 9468 var commandForm = ItemUtil.getHome().getGetItemDeliveryTypeForm(); 9469 9470 commandForm.setItemDeliveryTypeName(itemDeliveryTypeName); 9471 commandForm.setUuid(id); 9472 9473 itemDeliveryType = CDI.current().select(GetItemDeliveryTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9474 } catch (NamingException ex) { 9475 throw new RuntimeException(ex); 9476 } 9477 9478 return itemDeliveryType == null ? null : new ItemDeliveryTypeObject(itemDeliveryType); 9479 } 9480 9481 @GraphQLField 9482 @GraphQLName("itemDeliveryTypes") 9483 @GraphQLNonNull 9484 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9485 static CountingPaginatedData<ItemDeliveryTypeObject> itemDeliveryTypes(final DataFetchingEnvironment env) { 9486 CountingPaginatedData<ItemDeliveryTypeObject> data; 9487 9488 try { 9489 var commandForm = ItemUtil.getHome().getGetItemDeliveryTypesForm(); 9490 var command = CDI.current().select(GetItemDeliveryTypesCommand.class).get(); 9491 9492 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9493 if(totalEntities == null) { 9494 data = Connections.emptyConnection(); 9495 } else { 9496 try(var objectLimiter = new ObjectLimiter(env, ItemDeliveryTypeConstants.COMPONENT_VENDOR_NAME, ItemDeliveryTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9497 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9498 9499 var itemDeliveryTypes = entities.stream() 9500 .map(ItemDeliveryTypeObject::new) 9501 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9502 9503 data = new CountedObjects<>(objectLimiter, itemDeliveryTypes); 9504 } 9505 } 9506 } catch (NamingException ex) { 9507 throw new RuntimeException(ex); 9508 } 9509 9510 return data; 9511 } 9512 9513 @GraphQLField 9514 @GraphQLName("itemInventoryType") 9515 static ItemInventoryTypeObject itemInventoryType(final DataFetchingEnvironment env, 9516 @GraphQLName("itemInventoryTypeName") final String itemInventoryTypeName, 9517 @GraphQLName("id") @GraphQLID final String id) { 9518 ItemInventoryType itemInventoryType; 9519 9520 try { 9521 var commandForm = ItemUtil.getHome().getGetItemInventoryTypeForm(); 9522 9523 commandForm.setItemInventoryTypeName(itemInventoryTypeName); 9524 commandForm.setUuid(id); 9525 9526 itemInventoryType = CDI.current().select(GetItemInventoryTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9527 } catch (NamingException ex) { 9528 throw new RuntimeException(ex); 9529 } 9530 9531 return itemInventoryType == null ? null : new ItemInventoryTypeObject(itemInventoryType); 9532 } 9533 9534 @GraphQLField 9535 @GraphQLName("itemInventoryTypes") 9536 @GraphQLNonNull 9537 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9538 static CountingPaginatedData<ItemInventoryTypeObject> itemInventoryTypes(final DataFetchingEnvironment env) { 9539 CountingPaginatedData<ItemInventoryTypeObject> data; 9540 9541 try { 9542 var commandForm = ItemUtil.getHome().getGetItemInventoryTypesForm(); 9543 var command = CDI.current().select(GetItemInventoryTypesCommand.class).get(); 9544 9545 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9546 if(totalEntities == null) { 9547 data = Connections.emptyConnection(); 9548 } else { 9549 try(var objectLimiter = new ObjectLimiter(env, ItemInventoryTypeConstants.COMPONENT_VENDOR_NAME, ItemInventoryTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9550 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9551 9552 var itemInventoryTypes = entities.stream() 9553 .map(ItemInventoryTypeObject::new) 9554 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9555 9556 data = new CountedObjects<>(objectLimiter, itemInventoryTypes); 9557 } 9558 } 9559 } catch (NamingException ex) { 9560 throw new RuntimeException(ex); 9561 } 9562 9563 return data; 9564 } 9565 9566 @GraphQLField 9567 @GraphQLName("itemPrice") 9568 static ItemPriceObject itemPrice(final DataFetchingEnvironment env, 9569 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 9570 @GraphQLName("inventoryConditionName") @GraphQLNonNull final String inventoryConditionName, 9571 @GraphQLName("unitOfMeasureTypeName") @GraphQLNonNull final String unitOfMeasureTypeName, 9572 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 9573 ItemPrice itemPrice; 9574 9575 try { 9576 var commandForm = ItemUtil.getHome().getGetItemPriceForm(); 9577 9578 commandForm.setItemName(itemName); 9579 commandForm.setInventoryConditionName(inventoryConditionName); 9580 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 9581 commandForm.setCurrencyIsoName(currencyIsoName); 9582 9583 itemPrice = CDI.current().select(GetItemPriceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9584 } catch (NamingException ex) { 9585 throw new RuntimeException(ex); 9586 } 9587 9588 return itemPrice == null ? null : new ItemPriceObject(itemPrice); 9589 } 9590 9591 @GraphQLField 9592 @GraphQLName("itemPrices") 9593 @GraphQLNonNull 9594 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9595 static CountingPaginatedData<ItemPriceObject> itemPrices(final DataFetchingEnvironment env, 9596 @GraphQLName("itemName") @GraphQLNonNull final String itemName) { 9597 CountingPaginatedData<ItemPriceObject> data; 9598 9599 try { 9600 var commandForm = ItemUtil.getHome().getGetItemPricesForm(); 9601 var command = CDI.current().select(GetItemPricesCommand.class).get(); 9602 9603 commandForm.setItemName(itemName); 9604 9605 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9606 if(totalEntities == null) { 9607 data = Connections.emptyConnection(); 9608 } else { 9609 try(var objectLimiter = new ObjectLimiter(env, ItemPriceConstants.COMPONENT_VENDOR_NAME, ItemPriceConstants.ENTITY_TYPE_NAME, totalEntities)) { 9610 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9611 9612 var itemPriceObjects = entities.stream() 9613 .map(ItemPriceObject::new) 9614 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9615 9616 data = new CountedObjects<>(objectLimiter, itemPriceObjects); 9617 } 9618 } 9619 } catch (NamingException ex) { 9620 throw new RuntimeException(ex); 9621 } 9622 9623 return data; 9624 } 9625 9626 @GraphQLField 9627 @GraphQLName("itemAliasChecksumType") 9628 static ItemAliasChecksumTypeObject itemAliasChecksumType(final DataFetchingEnvironment env, 9629 @GraphQLName("itemAliasChecksumTypeName") final String itemAliasChecksumTypeName, 9630 @GraphQLName("id") @GraphQLID final String id) { 9631 ItemAliasChecksumType itemAliasChecksumType; 9632 9633 try { 9634 var commandForm = ItemUtil.getHome().getGetItemAliasChecksumTypeForm(); 9635 9636 commandForm.setItemAliasChecksumTypeName(itemAliasChecksumTypeName); 9637 commandForm.setUuid(id); 9638 9639 itemAliasChecksumType = CDI.current().select(GetItemAliasChecksumTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9640 } catch (NamingException ex) { 9641 throw new RuntimeException(ex); 9642 } 9643 9644 return itemAliasChecksumType == null ? null : new ItemAliasChecksumTypeObject(itemAliasChecksumType); 9645 } 9646 9647 @GraphQLField 9648 @GraphQLName("itemAliasChecksumTypes") 9649 @GraphQLNonNull 9650 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9651 static CountingPaginatedData<ItemAliasChecksumTypeObject> itemAliasChecksumTypes(final DataFetchingEnvironment env) { 9652 CountingPaginatedData<ItemAliasChecksumTypeObject> data; 9653 9654 try { 9655 var commandForm = ItemUtil.getHome().getGetItemAliasChecksumTypesForm(); 9656 var command = CDI.current().select(GetItemAliasChecksumTypesCommand.class).get(); 9657 9658 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9659 if(totalEntities == null) { 9660 data = Connections.emptyConnection(); 9661 } else { 9662 try(var objectLimiter = new ObjectLimiter(env, ItemAliasChecksumTypeConstants.COMPONENT_VENDOR_NAME, ItemAliasChecksumTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9663 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9664 9665 var itemAliasChecksumTypes = entities.stream() 9666 .map(ItemAliasChecksumTypeObject::new) 9667 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9668 9669 data = new CountedObjects<>(objectLimiter, itemAliasChecksumTypes); 9670 } 9671 } 9672 } catch (NamingException ex) { 9673 throw new RuntimeException(ex); 9674 } 9675 9676 return data; 9677 } 9678 9679 @GraphQLField 9680 @GraphQLName("itemAlias") 9681 static ItemAliasObject itemAlias(final DataFetchingEnvironment env, 9682 @GraphQLName("alias") @GraphQLNonNull final String alias) { 9683 ItemAlias itemAlias; 9684 9685 try { 9686 var commandForm = ItemUtil.getHome().getGetItemAliasForm(); 9687 9688 commandForm.setAlias(alias); 9689 9690 itemAlias = CDI.current().select(GetItemAliasCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9691 } catch (NamingException ex) { 9692 throw new RuntimeException(ex); 9693 } 9694 9695 return itemAlias == null ? null : new ItemAliasObject(itemAlias); 9696 } 9697 9698 @GraphQLField 9699 @GraphQLName("itemAliases") 9700 @GraphQLNonNull 9701 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9702 static CountingPaginatedData<ItemAliasObject> itemAliases(final DataFetchingEnvironment env, 9703 @GraphQLName("itemName") @GraphQLNonNull final String itemName) { 9704 CountingPaginatedData<ItemAliasObject> data; 9705 9706 try { 9707 var commandForm = ItemUtil.getHome().getGetItemAliasesForm(); 9708 var command = CDI.current().select(GetItemAliasesCommand.class).get(); 9709 9710 commandForm.setItemName(itemName); 9711 9712 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9713 if(totalEntities == null) { 9714 data = Connections.emptyConnection(); 9715 } else { 9716 try(var objectLimiter = new ObjectLimiter(env, ItemAliasConstants.COMPONENT_VENDOR_NAME, ItemAliasConstants.ENTITY_TYPE_NAME, totalEntities)) { 9717 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9718 9719 var itemAliasObjects = entities.stream() 9720 .map(ItemAliasObject::new) 9721 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9722 9723 data = new CountedObjects<>(objectLimiter, itemAliasObjects); 9724 } 9725 } 9726 } catch (NamingException ex) { 9727 throw new RuntimeException(ex); 9728 } 9729 9730 return data; 9731 } 9732 9733 @GraphQLField 9734 @GraphQLName("itemCategory") 9735 static ItemCategoryObject itemCategory(final DataFetchingEnvironment env, 9736 @GraphQLName("itemCategoryName") final String itemCategoryName, 9737 @GraphQLName("id") @GraphQLID final String id) { 9738 ItemCategory itemCategory; 9739 9740 try { 9741 var commandForm = ItemUtil.getHome().getGetItemCategoryForm(); 9742 9743 commandForm.setItemCategoryName(itemCategoryName); 9744 commandForm.setUuid(id); 9745 9746 itemCategory = CDI.current().select(GetItemCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9747 } catch (NamingException ex) { 9748 throw new RuntimeException(ex); 9749 } 9750 9751 return itemCategory == null ? null : new ItemCategoryObject(itemCategory); 9752 } 9753 9754 @GraphQLField 9755 @GraphQLName("itemCategories") 9756 @GraphQLNonNull 9757 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9758 static CountingPaginatedData<ItemCategoryObject> itemCategories(final DataFetchingEnvironment env, 9759 @GraphQLName("parentItemCategoryName") final String parentItemCategoryName) { 9760 CountingPaginatedData<ItemCategoryObject> data; 9761 9762 try { 9763 var commandForm = ItemUtil.getHome().getGetItemCategoriesForm(); 9764 var command = CDI.current().select(GetItemCategoriesCommand.class).get(); 9765 9766 commandForm.setParentItemCategoryName(parentItemCategoryName); 9767 9768 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9769 if(totalEntities == null) { 9770 data = Connections.emptyConnection(); 9771 } else { 9772 try(var objectLimiter = new ObjectLimiter(env, ItemCategoryConstants.COMPONENT_VENDOR_NAME, ItemCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 9773 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9774 9775 var itemCategories = entities.stream() 9776 .map(ItemCategoryObject::new) 9777 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9778 9779 data = new CountedObjects<>(objectLimiter, itemCategories); 9780 } 9781 } 9782 } catch (NamingException ex) { 9783 throw new RuntimeException(ex); 9784 } 9785 9786 return data; 9787 } 9788 9789 @GraphQLField 9790 @GraphQLName("itemAccountingCategory") 9791 static ItemAccountingCategoryObject itemAccountingCategory(final DataFetchingEnvironment env, 9792 @GraphQLName("itemAccountingCategoryName") final String itemAccountingCategoryName, 9793 @GraphQLName("id") @GraphQLID final String id) { 9794 ItemAccountingCategory itemAccountingCategory; 9795 9796 try { 9797 var commandForm = AccountingUtil.getHome().getGetItemAccountingCategoryForm(); 9798 9799 commandForm.setItemAccountingCategoryName(itemAccountingCategoryName); 9800 commandForm.setUuid(id); 9801 9802 itemAccountingCategory = CDI.current().select(GetItemAccountingCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9803 } catch (NamingException ex) { 9804 throw new RuntimeException(ex); 9805 } 9806 9807 return itemAccountingCategory == null ? null : new ItemAccountingCategoryObject(itemAccountingCategory); 9808 } 9809 9810 @GraphQLField 9811 @GraphQLName("itemAccountingCategories") 9812 @GraphQLNonNull 9813 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9814 static CountingPaginatedData<ItemAccountingCategoryObject> itemAccountingCategories(final DataFetchingEnvironment env) { 9815 CountingPaginatedData<ItemAccountingCategoryObject> data; 9816 9817 try { 9818 var commandForm = AccountingUtil.getHome().getGetItemAccountingCategoriesForm(); 9819 var command = CDI.current().select(GetItemAccountingCategoriesCommand.class).get(); 9820 9821 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9822 if(totalEntities == null) { 9823 data = Connections.emptyConnection(); 9824 } else { 9825 try(var objectLimiter = new ObjectLimiter(env, ItemAccountingCategoryConstants.COMPONENT_VENDOR_NAME, ItemAccountingCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 9826 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9827 9828 var itemAccountingCategories = entities.stream() 9829 .map(ItemAccountingCategoryObject::new) 9830 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9831 9832 data = new CountedObjects<>(objectLimiter, itemAccountingCategories); 9833 } 9834 } 9835 } catch (NamingException ex) { 9836 throw new RuntimeException(ex); 9837 } 9838 9839 return data; 9840 } 9841 9842 @GraphQLField 9843 @GraphQLName("glAccount") 9844 static GlAccountObject glAccount(final DataFetchingEnvironment env, 9845 @GraphQLName("glAccountName") final String glAccountName, 9846 @GraphQLName("id") @GraphQLID final String id) { 9847 GlAccount glAccount; 9848 9849 try { 9850 var commandForm = AccountingUtil.getHome().getGetGlAccountForm(); 9851 9852 commandForm.setGlAccountName(glAccountName); 9853 commandForm.setUuid(id); 9854 9855 glAccount = CDI.current().select(GetGlAccountCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9856 } catch (NamingException ex) { 9857 throw new RuntimeException(ex); 9858 } 9859 9860 return glAccount == null ? null : new GlAccountObject(glAccount); 9861 } 9862 9863 @GraphQLField 9864 @GraphQLName("glAccounts") 9865 @GraphQLNonNull 9866 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9867 static CountingPaginatedData<GlAccountObject> glAccounts(final DataFetchingEnvironment env, 9868 @GraphQLName("glAccountCategoryName") final String glAccountCategoryName) { 9869 CountingPaginatedData<GlAccountObject> data; 9870 9871 try { 9872 var commandForm = AccountingUtil.getHome().getGetGlAccountsForm(); 9873 var command = CDI.current().select(GetGlAccountsCommand.class).get(); 9874 9875 commandForm.setGlAccountCategoryName(glAccountCategoryName); 9876 9877 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9878 if(totalEntities == null) { 9879 data = Connections.emptyConnection(); 9880 } else { 9881 try(var objectLimiter = new ObjectLimiter(env, GlAccountConstants.COMPONENT_VENDOR_NAME, GlAccountConstants.ENTITY_TYPE_NAME, totalEntities)) { 9882 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9883 9884 var glAccounts = entities.stream() 9885 .map(GlAccountObject::new) 9886 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9887 9888 data = new CountedObjects<>(objectLimiter, glAccounts); 9889 } 9890 } 9891 } catch (NamingException ex) { 9892 throw new RuntimeException(ex); 9893 } 9894 9895 return data; 9896 } 9897 9898 @GraphQLField 9899 @GraphQLName("glAccountType") 9900 static GlAccountTypeObject glAccountType(final DataFetchingEnvironment env, 9901 @GraphQLName("glAccountTypeName") final String glAccountTypeName, 9902 @GraphQLName("id") @GraphQLID final String id) { 9903 GlAccountType glAccountType; 9904 9905 try { 9906 var commandForm = AccountingUtil.getHome().getGetGlAccountTypeForm(); 9907 9908 commandForm.setGlAccountTypeName(glAccountTypeName); 9909 commandForm.setUuid(id); 9910 9911 glAccountType = CDI.current().select(GetGlAccountTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9912 } catch (NamingException ex) { 9913 throw new RuntimeException(ex); 9914 } 9915 9916 return glAccountType == null ? null : new GlAccountTypeObject(glAccountType); 9917 } 9918 9919 @GraphQLField 9920 @GraphQLName("glAccountTypes") 9921 @GraphQLNonNull 9922 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9923 static CountingPaginatedData<GlAccountTypeObject> glAccountTypes(final DataFetchingEnvironment env) { 9924 CountingPaginatedData<GlAccountTypeObject> data; 9925 9926 try { 9927 var commandForm = AccountingUtil.getHome().getGetGlAccountTypesForm(); 9928 var command = CDI.current().select(GetGlAccountTypesCommand.class).get(); 9929 9930 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9931 if(totalEntities == null) { 9932 data = Connections.emptyConnection(); 9933 } else { 9934 try(var objectLimiter = new ObjectLimiter(env, GlAccountTypeConstants.COMPONENT_VENDOR_NAME, GlAccountTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9935 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9936 9937 var glAccountTypes = entities.stream() 9938 .map(GlAccountTypeObject::new) 9939 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9940 9941 data = new CountedObjects<>(objectLimiter, glAccountTypes); 9942 } 9943 } 9944 } catch (NamingException ex) { 9945 throw new RuntimeException(ex); 9946 } 9947 9948 return data; 9949 } 9950 9951 @GraphQLField 9952 @GraphQLName("glAccountClass") 9953 static GlAccountClassObject glAccountClass(final DataFetchingEnvironment env, 9954 @GraphQLName("glAccountClassName") final String glAccountClassName, 9955 @GraphQLName("id") @GraphQLID final String id) { 9956 GlAccountClass glAccountClass; 9957 9958 try { 9959 var commandForm = AccountingUtil.getHome().getGetGlAccountClassForm(); 9960 9961 commandForm.setGlAccountClassName(glAccountClassName); 9962 commandForm.setUuid(id); 9963 9964 glAccountClass = CDI.current().select(GetGlAccountClassCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9965 } catch (NamingException ex) { 9966 throw new RuntimeException(ex); 9967 } 9968 9969 return glAccountClass == null ? null : new GlAccountClassObject(glAccountClass); 9970 } 9971 9972 @GraphQLField 9973 @GraphQLName("glAccountClasses") 9974 @GraphQLNonNull 9975 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9976 static CountingPaginatedData<GlAccountClassObject> glAccountClasses(final DataFetchingEnvironment env) { 9977 CountingPaginatedData<GlAccountClassObject> data; 9978 9979 try { 9980 var commandForm = AccountingUtil.getHome().getGetGlAccountClassesForm(); 9981 var command = CDI.current().select(GetGlAccountClassesCommand.class).get(); 9982 9983 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9984 if(totalEntities == null) { 9985 data = Connections.emptyConnection(); 9986 } else { 9987 try(var objectLimiter = new ObjectLimiter(env, GlAccountClassConstants.COMPONENT_VENDOR_NAME, GlAccountClassConstants.ENTITY_TYPE_NAME, totalEntities)) { 9988 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9989 9990 var glAccountClasses = entities.stream() 9991 .map(GlAccountClassObject::new) 9992 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9993 9994 data = new CountedObjects<>(objectLimiter, glAccountClasses); 9995 } 9996 } 9997 } catch (NamingException ex) { 9998 throw new RuntimeException(ex); 9999 } 10000 10001 return data; 10002 } 10003 10004 @GraphQLField 10005 @GraphQLName("glAccountCategory") 10006 static GlAccountCategoryObject glAccountCategory(final DataFetchingEnvironment env, 10007 @GraphQLName("glAccountCategoryName") final String glAccountCategoryName, 10008 @GraphQLName("id") @GraphQLID final String id) { 10009 GlAccountCategory glAccountCategory; 10010 10011 try { 10012 var commandForm = AccountingUtil.getHome().getGetGlAccountCategoryForm(); 10013 10014 commandForm.setGlAccountCategoryName(glAccountCategoryName); 10015 commandForm.setUuid(id); 10016 10017 glAccountCategory = CDI.current().select(GetGlAccountCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10018 } catch (NamingException ex) { 10019 throw new RuntimeException(ex); 10020 } 10021 10022 return glAccountCategory == null ? null : new GlAccountCategoryObject(glAccountCategory); 10023 } 10024 10025 @GraphQLField 10026 @GraphQLName("glAccountCategories") 10027 @GraphQLNonNull 10028 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10029 static CountingPaginatedData<GlAccountCategoryObject> glAccountCategories(final DataFetchingEnvironment env) { 10030 CountingPaginatedData<GlAccountCategoryObject> data; 10031 10032 try { 10033 var commandForm = AccountingUtil.getHome().getGetGlAccountCategoriesForm(); 10034 var command = CDI.current().select(GetGlAccountCategoriesCommand.class).get(); 10035 10036 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10037 if(totalEntities == null) { 10038 data = Connections.emptyConnection(); 10039 } else { 10040 try(var objectLimiter = new ObjectLimiter(env, GlAccountCategoryConstants.COMPONENT_VENDOR_NAME, GlAccountCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 10041 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10042 10043 var glAccountCategories = entities.stream() 10044 .map(GlAccountCategoryObject::new) 10045 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10046 10047 data = new CountedObjects<>(objectLimiter, glAccountCategories); 10048 } 10049 } 10050 } catch (NamingException ex) { 10051 throw new RuntimeException(ex); 10052 } 10053 10054 return data; 10055 } 10056 10057 @GraphQLField 10058 @GraphQLName("glResourceType") 10059 static GlResourceTypeObject glResourceType(final DataFetchingEnvironment env, 10060 @GraphQLName("glResourceTypeName") final String glResourceTypeName, 10061 @GraphQLName("id") @GraphQLID final String id) { 10062 GlResourceType glResourceType; 10063 10064 try { 10065 var commandForm = AccountingUtil.getHome().getGetGlResourceTypeForm(); 10066 10067 commandForm.setGlResourceTypeName(glResourceTypeName); 10068 commandForm.setUuid(id); 10069 10070 glResourceType = CDI.current().select(GetGlResourceTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10071 } catch (NamingException ex) { 10072 throw new RuntimeException(ex); 10073 } 10074 10075 return glResourceType == null ? null : new GlResourceTypeObject(glResourceType); 10076 } 10077 10078 @GraphQLField 10079 @GraphQLName("glResourceTypes") 10080 @GraphQLNonNull 10081 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10082 static CountingPaginatedData<GlResourceTypeObject> glResourceTypes(final DataFetchingEnvironment env) { 10083 CountingPaginatedData<GlResourceTypeObject> data; 10084 10085 try { 10086 var commandForm = AccountingUtil.getHome().getGetGlResourceTypesForm(); 10087 var command = CDI.current().select(GetGlResourceTypesCommand.class).get(); 10088 10089 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10090 if(totalEntities == null) { 10091 data = Connections.emptyConnection(); 10092 } else { 10093 try(var objectLimiter = new ObjectLimiter(env, GlResourceTypeConstants.COMPONENT_VENDOR_NAME, GlResourceTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10094 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10095 10096 var glResourceTypes = entities.stream() 10097 .map(GlResourceTypeObject::new) 10098 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10099 10100 data = new CountedObjects<>(objectLimiter, glResourceTypes); 10101 } 10102 } 10103 } catch (NamingException ex) { 10104 throw new RuntimeException(ex); 10105 } 10106 10107 return data; 10108 } 10109 10110 @GraphQLField 10111 @GraphQLName("itemPurchasingCategory") 10112 static ItemPurchasingCategoryObject itemPurchasingCategory(final DataFetchingEnvironment env, 10113 @GraphQLName("itemPurchasingCategoryName") final String itemPurchasingCategoryName, 10114 @GraphQLName("id") @GraphQLID final String id) { 10115 ItemPurchasingCategory itemPurchasingCategory; 10116 10117 try { 10118 var commandForm = VendorUtil.getHome().getGetItemPurchasingCategoryForm(); 10119 10120 commandForm.setItemPurchasingCategoryName(itemPurchasingCategoryName); 10121 commandForm.setUuid(id); 10122 10123 itemPurchasingCategory = CDI.current().select(GetItemPurchasingCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10124 } catch (NamingException ex) { 10125 throw new RuntimeException(ex); 10126 } 10127 10128 return itemPurchasingCategory == null ? null : new ItemPurchasingCategoryObject(itemPurchasingCategory); 10129 } 10130 10131 @GraphQLField 10132 @GraphQLName("itemPurchasingCategories") 10133 @GraphQLNonNull 10134 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10135 static CountingPaginatedData<ItemPurchasingCategoryObject> itemPurchasingCategories(final DataFetchingEnvironment env) { 10136 CountingPaginatedData<ItemPurchasingCategoryObject> data; 10137 10138 try { 10139 var commandForm = VendorUtil.getHome().getGetItemPurchasingCategoriesForm(); 10140 var command = CDI.current().select(GetItemPurchasingCategoriesCommand.class).get(); 10141 10142 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10143 if(totalEntities == null) { 10144 data = Connections.emptyConnection(); 10145 } else { 10146 try(var objectLimiter = new ObjectLimiter(env, ItemPurchasingCategoryConstants.COMPONENT_VENDOR_NAME, ItemPurchasingCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 10147 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10148 10149 var itemPurchasingCategories = entities.stream() 10150 .map(ItemPurchasingCategoryObject::new) 10151 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10152 10153 data = new CountedObjects<>(objectLimiter, itemPurchasingCategories); 10154 } 10155 } 10156 } catch (NamingException ex) { 10157 throw new RuntimeException(ex); 10158 } 10159 10160 return data; 10161 } 10162 10163 @GraphQLField 10164 @GraphQLName("itemDescriptionType") 10165 static ItemDescriptionTypeObject itemDescriptionType(final DataFetchingEnvironment env, 10166 @GraphQLName("itemDescriptionTypeName") final String itemDescriptionTypeName, 10167 @GraphQLName("id") @GraphQLID final String id) { 10168 ItemDescriptionType itemDescriptionType; 10169 10170 try { 10171 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypeForm(); 10172 10173 commandForm.setItemDescriptionTypeName(itemDescriptionTypeName); 10174 commandForm.setUuid(id); 10175 10176 itemDescriptionType = CDI.current().select(GetItemDescriptionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10177 } catch (NamingException ex) { 10178 throw new RuntimeException(ex); 10179 } 10180 10181 return itemDescriptionType == null ? null : new ItemDescriptionTypeObject(itemDescriptionType); 10182 } 10183 10184 @GraphQLField 10185 @GraphQLName("itemDescriptionTypes") 10186 @GraphQLNonNull 10187 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10188 static CountingPaginatedData<ItemDescriptionTypeObject> itemDescriptionTypes(final DataFetchingEnvironment env, 10189 @GraphQLName("parentItemDescriptionTypeName") final String parentItemDescriptionTypeName) { 10190 CountingPaginatedData<ItemDescriptionTypeObject> data; 10191 10192 try { 10193 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypesForm(); 10194 var command = CDI.current().select(GetItemDescriptionTypesCommand.class).get(); 10195 10196 commandForm.setParentItemDescriptionTypeName(parentItemDescriptionTypeName); 10197 10198 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10199 if(totalEntities == null) { 10200 data = Connections.emptyConnection(); 10201 } else { 10202 try(var objectLimiter = new ObjectLimiter(env, ItemDescriptionTypeConstants.COMPONENT_VENDOR_NAME, ItemDescriptionTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10203 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10204 10205 var itemDescriptionTypes = entities.stream() 10206 .map(ItemDescriptionTypeObject::new) 10207 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10208 10209 data = new CountedObjects<>(objectLimiter, itemDescriptionTypes); 10210 } 10211 } 10212 } catch (NamingException ex) { 10213 throw new RuntimeException(ex); 10214 } 10215 10216 return data; 10217 } 10218 10219 @GraphQLField 10220 @GraphQLName("itemImageType") 10221 static ItemImageTypeObject itemImageType(final DataFetchingEnvironment env, 10222 @GraphQLName("itemImageTypeName") final String itemImageTypeName, 10223 @GraphQLName("id") @GraphQLID final String id) { 10224 ItemImageType itemImageType; 10225 10226 try { 10227 var commandForm = ItemUtil.getHome().getGetItemImageTypeForm(); 10228 10229 commandForm.setItemImageTypeName(itemImageTypeName); 10230 commandForm.setUuid(id); 10231 10232 itemImageType = CDI.current().select(GetItemImageTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10233 } catch (NamingException ex) { 10234 throw new RuntimeException(ex); 10235 } 10236 10237 return itemImageType == null ? null : new ItemImageTypeObject(itemImageType); 10238 } 10239 10240 @GraphQLField 10241 @GraphQLName("itemImageTypes") 10242 @GraphQLNonNull 10243 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10244 static CountingPaginatedData<ItemImageTypeObject> itemImageTypes(final DataFetchingEnvironment env) { 10245 CountingPaginatedData<ItemImageTypeObject> data; 10246 10247 try { 10248 var commandForm = ItemUtil.getHome().getGetItemImageTypesForm(); 10249 var command = CDI.current().select(GetItemImageTypesCommand.class).get(); 10250 10251 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10252 if(totalEntities == null) { 10253 data = Connections.emptyConnection(); 10254 } else { 10255 try(var objectLimiter = new ObjectLimiter(env, ItemImageTypeConstants.COMPONENT_VENDOR_NAME, ItemImageTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10256 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10257 10258 var itemImageTypes = entities.stream() 10259 .map(ItemImageTypeObject::new) 10260 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10261 10262 data = new CountedObjects<>(objectLimiter, itemImageTypes); 10263 } 10264 } 10265 } catch (NamingException ex) { 10266 throw new RuntimeException(ex); 10267 } 10268 10269 return data; 10270 } 10271 10272 @GraphQLField 10273 @GraphQLName("itemDescriptionTypeUseType") 10274 static ItemDescriptionTypeUseTypeObject itemDescriptionTypeUseType(final DataFetchingEnvironment env, 10275 @GraphQLName("itemDescriptionTypeUseTypeName") final String itemDescriptionTypeUseTypeName, 10276 @GraphQLName("id") @GraphQLID final String id) { 10277 ItemDescriptionTypeUseType itemDescriptionTypeUseType; 10278 10279 try { 10280 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypeUseTypeForm(); 10281 10282 commandForm.setItemDescriptionTypeUseTypeName(itemDescriptionTypeUseTypeName); 10283 commandForm.setUuid(id); 10284 10285 itemDescriptionTypeUseType = CDI.current().select(GetItemDescriptionTypeUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10286 } catch (NamingException ex) { 10287 throw new RuntimeException(ex); 10288 } 10289 10290 return itemDescriptionTypeUseType == null ? null : new ItemDescriptionTypeUseTypeObject(itemDescriptionTypeUseType); 10291 } 10292 10293 @GraphQLField 10294 @GraphQLName("itemDescriptionTypeUseTypes") 10295 @GraphQLNonNull 10296 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10297 static CountingPaginatedData<ItemDescriptionTypeUseTypeObject> itemDescriptionTypeUseTypes(final DataFetchingEnvironment env) { 10298 CountingPaginatedData<ItemDescriptionTypeUseTypeObject> data; 10299 10300 try { 10301 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypeUseTypesForm(); 10302 var command = CDI.current().select(GetItemDescriptionTypeUseTypesCommand.class).get(); 10303 10304 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10305 if(totalEntities == null) { 10306 data = Connections.emptyConnection(); 10307 } else { 10308 try(var objectLimiter = new ObjectLimiter(env, ItemDescriptionTypeUseTypeConstants.COMPONENT_VENDOR_NAME, ItemDescriptionTypeUseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10309 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10310 10311 var itemDescriptionTypeUseTypes = entities.stream() 10312 .map(ItemDescriptionTypeUseTypeObject::new) 10313 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10314 10315 data = new CountedObjects<>(objectLimiter, itemDescriptionTypeUseTypes); 10316 } 10317 } 10318 } catch (NamingException ex) { 10319 throw new RuntimeException(ex); 10320 } 10321 10322 return data; 10323 } 10324 10325 @GraphQLField 10326 @GraphQLName("itemDescriptionTypeUse") 10327 static ItemDescriptionTypeUseObject itemDescriptionTypeUse(final DataFetchingEnvironment env, 10328 @GraphQLName("itemDescriptionTypeUseTypeName") @GraphQLNonNull final String itemDescriptionTypeUseTypeName, 10329 @GraphQLName("itemDescriptionTypeName") @GraphQLNonNull final String itemDescriptionTypeName) { 10330 ItemDescriptionTypeUse itemDescriptionTypeUse; 10331 10332 try { 10333 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypeUseForm(); 10334 10335 commandForm.setItemDescriptionTypeUseTypeName(itemDescriptionTypeUseTypeName); 10336 commandForm.setItemDescriptionTypeName(itemDescriptionTypeName); 10337 10338 itemDescriptionTypeUse = CDI.current().select(GetItemDescriptionTypeUseCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10339 } catch (NamingException ex) { 10340 throw new RuntimeException(ex); 10341 } 10342 10343 return itemDescriptionTypeUse == null ? null : new ItemDescriptionTypeUseObject(itemDescriptionTypeUse); 10344 } 10345 10346 @GraphQLField 10347 @GraphQLName("itemDescriptionTypeUses") 10348 @GraphQLNonNull 10349 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10350 static CountingPaginatedData<ItemDescriptionTypeUseObject> itemDescriptionTypeUses(final DataFetchingEnvironment env, 10351 @GraphQLName("itemDescriptionTypeUseTypeName") final String itemDescriptionTypeUseTypeName, 10352 @GraphQLName("itemDescriptionTypeName") final String itemDescriptionTypeName) { 10353 CountingPaginatedData<ItemDescriptionTypeUseObject> data; 10354 10355 try { 10356 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypeUsesForm(); 10357 var command = CDI.current().select(GetItemDescriptionTypeUsesCommand.class).get(); 10358 10359 commandForm.setItemDescriptionTypeUseTypeName(itemDescriptionTypeUseTypeName); 10360 commandForm.setItemDescriptionTypeName(itemDescriptionTypeName); 10361 10362 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10363 if(totalEntities == null) { 10364 data = Connections.emptyConnection(); 10365 } else { 10366 try(var objectLimiter = new ObjectLimiter(env, com.echothree.model.data.item.common.ItemDescriptionTypeUseConstants.COMPONENT_VENDOR_NAME, com.echothree.model.data.item.common.ItemDescriptionTypeUseConstants.ENTITY_TYPE_NAME, totalEntities)) { 10367 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10368 10369 var objects = entities.stream() 10370 .map(ItemDescriptionTypeUseObject::new) 10371 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10372 10373 data = new CountedObjects<>(objectLimiter, objects); 10374 } 10375 } 10376 } catch (NamingException ex) { 10377 throw new RuntimeException(ex); 10378 } 10379 10380 return data; 10381 } 10382 10383 @GraphQLField 10384 @GraphQLName("itemAliasType") 10385 static ItemAliasTypeObject itemAliasType(final DataFetchingEnvironment env, 10386 @GraphQLName("itemAliasTypeName") final String itemAliasTypeName, 10387 @GraphQLName("id") @GraphQLID final String id) { 10388 ItemAliasType itemAliasType; 10389 10390 try { 10391 var commandForm = ItemUtil.getHome().getGetItemAliasTypeForm(); 10392 10393 commandForm.setItemAliasTypeName(itemAliasTypeName); 10394 commandForm.setUuid(id); 10395 10396 itemAliasType = CDI.current().select(GetItemAliasTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10397 } catch (NamingException ex) { 10398 throw new RuntimeException(ex); 10399 } 10400 10401 return itemAliasType == null ? null : new ItemAliasTypeObject(itemAliasType); 10402 } 10403 10404 @GraphQLField 10405 @GraphQLName("itemAliasTypes") 10406 @GraphQLNonNull 10407 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10408 static CountingPaginatedData<ItemAliasTypeObject> itemAliasTypes(final DataFetchingEnvironment env) { 10409 CountingPaginatedData<ItemAliasTypeObject> data; 10410 10411 try { 10412 var commandForm = ItemUtil.getHome().getGetItemAliasTypesForm(); 10413 var command = CDI.current().select(GetItemAliasTypesCommand.class).get(); 10414 10415 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10416 if(totalEntities == null) { 10417 data = Connections.emptyConnection(); 10418 } else { 10419 try(var objectLimiter = new ObjectLimiter(env, ItemAliasTypeConstants.COMPONENT_VENDOR_NAME, ItemAliasTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10420 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10421 10422 var itemAliasTypes = entities.stream() 10423 .map(ItemAliasTypeObject::new) 10424 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10425 10426 data = new CountedObjects<>(objectLimiter, itemAliasTypes); 10427 } 10428 } 10429 } catch (NamingException ex) { 10430 throw new RuntimeException(ex); 10431 } 10432 10433 return data; 10434 } 10435 10436 @GraphQLField 10437 @GraphQLName("itemWeightType") 10438 static ItemWeightTypeObject itemWeightType(final DataFetchingEnvironment env, 10439 @GraphQLName("itemWeightTypeName") final String itemWeightTypeName, 10440 @GraphQLName("id") @GraphQLID final String id) { 10441 ItemWeightType itemWeightType; 10442 10443 try { 10444 var commandForm = ItemUtil.getHome().getGetItemWeightTypeForm(); 10445 10446 commandForm.setItemWeightTypeName(itemWeightTypeName); 10447 commandForm.setUuid(id); 10448 10449 itemWeightType = CDI.current().select(GetItemWeightTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10450 } catch (NamingException ex) { 10451 throw new RuntimeException(ex); 10452 } 10453 10454 return itemWeightType == null ? null : new ItemWeightTypeObject(itemWeightType); 10455 } 10456 10457 @GraphQLField 10458 @GraphQLName("itemWeightTypes") 10459 @GraphQLNonNull 10460 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10461 static CountingPaginatedData<ItemWeightTypeObject> itemWeightTypes(final DataFetchingEnvironment env) { 10462 CountingPaginatedData<ItemWeightTypeObject> data; 10463 10464 try { 10465 var commandForm = ItemUtil.getHome().getGetItemWeightTypesForm(); 10466 var command = CDI.current().select(GetItemWeightTypesCommand.class).get(); 10467 10468 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10469 if(totalEntities == null) { 10470 data = Connections.emptyConnection(); 10471 } else { 10472 try(var objectLimiter = new ObjectLimiter(env, ItemWeightTypeConstants.COMPONENT_VENDOR_NAME, ItemWeightTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10473 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10474 10475 var itemWeightTypes = entities.stream() 10476 .map(ItemWeightTypeObject::new) 10477 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10478 10479 data = new CountedObjects<>(objectLimiter, itemWeightTypes); 10480 } 10481 } 10482 } catch (NamingException ex) { 10483 throw new RuntimeException(ex); 10484 } 10485 10486 return data; 10487 } 10488 10489 @GraphQLField 10490 @GraphQLName("itemVolumeType") 10491 static ItemVolumeTypeObject itemVolumeType(final DataFetchingEnvironment env, 10492 @GraphQLName("itemVolumeTypeName") final String itemVolumeTypeName, 10493 @GraphQLName("id") @GraphQLID final String id) { 10494 ItemVolumeType itemVolumeType; 10495 10496 try { 10497 var commandForm = ItemUtil.getHome().getGetItemVolumeTypeForm(); 10498 10499 commandForm.setItemVolumeTypeName(itemVolumeTypeName); 10500 commandForm.setUuid(id); 10501 10502 itemVolumeType = CDI.current().select(GetItemVolumeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10503 } catch (NamingException ex) { 10504 throw new RuntimeException(ex); 10505 } 10506 10507 return itemVolumeType == null ? null : new ItemVolumeTypeObject(itemVolumeType); 10508 } 10509 10510 @GraphQLField 10511 @GraphQLName("itemVolumeTypes") 10512 @GraphQLNonNull 10513 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10514 static CountingPaginatedData<ItemVolumeTypeObject> itemVolumeTypes(final DataFetchingEnvironment env) { 10515 CountingPaginatedData<ItemVolumeTypeObject> data; 10516 10517 try { 10518 var commandForm = ItemUtil.getHome().getGetItemVolumeTypesForm(); 10519 var command = CDI.current().select(GetItemVolumeTypesCommand.class).get(); 10520 10521 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10522 if(totalEntities == null) { 10523 data = Connections.emptyConnection(); 10524 } else { 10525 try(var objectLimiter = new ObjectLimiter(env, ItemVolumeTypeConstants.COMPONENT_VENDOR_NAME, ItemVolumeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10526 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10527 10528 var itemVolumeTypes = entities.stream() 10529 .map(ItemVolumeTypeObject::new) 10530 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10531 10532 data = new CountedObjects<>(objectLimiter, itemVolumeTypes); 10533 } 10534 } 10535 } catch (NamingException ex) { 10536 throw new RuntimeException(ex); 10537 } 10538 10539 return data; 10540 } 10541 10542 @GraphQLField 10543 @GraphQLName("relatedItemType") 10544 static RelatedItemTypeObject relatedItemType(final DataFetchingEnvironment env, 10545 @GraphQLName("relatedItemTypeName") final String relatedItemTypeName, 10546 @GraphQLName("id") @GraphQLID final String id) { 10547 RelatedItemType relatedItemType; 10548 10549 try { 10550 var commandForm = ItemUtil.getHome().getGetRelatedItemTypeForm(); 10551 10552 commandForm.setRelatedItemTypeName(relatedItemTypeName); 10553 commandForm.setUuid(id); 10554 10555 relatedItemType = CDI.current().select(GetRelatedItemTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10556 } catch (NamingException ex) { 10557 throw new RuntimeException(ex); 10558 } 10559 10560 return relatedItemType == null ? null : new RelatedItemTypeObject(relatedItemType, null); 10561 } 10562 10563 @GraphQLField 10564 @GraphQLName("relatedItemTypes") 10565 @GraphQLNonNull 10566 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10567 static CountingPaginatedData<RelatedItemTypeObject> relatedItemTypes(final DataFetchingEnvironment env) { 10568 CountingPaginatedData<RelatedItemTypeObject> data; 10569 10570 try { 10571 var commandForm = ItemUtil.getHome().getGetRelatedItemTypesForm(); 10572 var command = CDI.current().select(GetRelatedItemTypesCommand.class).get(); 10573 10574 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10575 if(totalEntities == null) { 10576 data = Connections.emptyConnection(); 10577 } else { 10578 try(var objectLimiter = new ObjectLimiter(env, RelatedItemTypeConstants.COMPONENT_VENDOR_NAME, RelatedItemTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10579 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10580 10581 var relatedItemTypes = entities.stream() 10582 .map((RelatedItemType relatedItemType) -> new RelatedItemTypeObject(relatedItemType, null)) 10583 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10584 10585 data = new CountedObjects<>(objectLimiter, relatedItemTypes); 10586 } 10587 } 10588 } catch (NamingException ex) { 10589 throw new RuntimeException(ex); 10590 } 10591 10592 return data; 10593 } 10594 10595 @GraphQLField 10596 @GraphQLName("relatedItem") 10597 static RelatedItemObject relatedItem(final DataFetchingEnvironment env, 10598 @GraphQLName("relatedItemTypeName") @GraphQLNonNull final String relatedItemTypeName, 10599 @GraphQLName("fromItemName") @GraphQLNonNull final String fromItemName, 10600 @GraphQLName("toItemName") @GraphQLNonNull final String toItemName) { 10601 RelatedItem relatedItem; 10602 10603 try { 10604 var commandForm = ItemUtil.getHome().getGetRelatedItemForm(); 10605 10606 commandForm.setRelatedItemTypeName(relatedItemTypeName); 10607 commandForm.setFromItemName(fromItemName); 10608 commandForm.setToItemName(toItemName); 10609 10610 relatedItem = CDI.current().select(GetRelatedItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10611 } catch (NamingException ex) { 10612 throw new RuntimeException(ex); 10613 } 10614 10615 return relatedItem == null ? null : new RelatedItemObject(relatedItem); 10616 } 10617 10618 @GraphQLField 10619 @GraphQLName("relatedItems") 10620 @GraphQLNonNull 10621 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10622 static CountingPaginatedData<RelatedItemObject> relatedItems(final DataFetchingEnvironment env, 10623 @GraphQLName("relatedItemTypeName") final String relatedItemTypeName, 10624 @GraphQLName("fromItemName") final String fromItemName, 10625 @GraphQLName("toItemName") final String toItemName) { 10626 CountingPaginatedData<RelatedItemObject> data; 10627 10628 try { 10629 var commandForm = ItemUtil.getHome().getGetRelatedItemsForm(); 10630 var command = CDI.current().select(GetRelatedItemsCommand.class).get(); 10631 10632 commandForm.setRelatedItemTypeName(relatedItemTypeName); 10633 commandForm.setFromItemName(fromItemName); 10634 commandForm.setToItemName(toItemName); 10635 10636 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10637 if(totalEntities == null) { 10638 data = Connections.emptyConnection(); 10639 } else { 10640 try(var objectLimiter = new ObjectLimiter(env, RelatedItemConstants.COMPONENT_VENDOR_NAME, RelatedItemConstants.ENTITY_TYPE_NAME, totalEntities)) { 10641 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10642 10643 var relatedItemObjects = entities.stream() 10644 .map(RelatedItemObject::new) 10645 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10646 10647 data = new CountedObjects<>(objectLimiter, relatedItemObjects); 10648 } 10649 } 10650 } catch (NamingException ex) { 10651 throw new RuntimeException(ex); 10652 } 10653 10654 return data; 10655 } 10656 10657 @GraphQLField 10658 @GraphQLName("orderType") 10659 static OrderTypeObject orderType(final DataFetchingEnvironment env, 10660 @GraphQLName("orderTypeName") final String orderTypeName, 10661 @GraphQLName("id") @GraphQLID final String id) { 10662 OrderType orderType; 10663 10664 try { 10665 var commandForm = OrderUtil.getHome().getGetOrderTypeForm(); 10666 10667 commandForm.setOrderTypeName(orderTypeName); 10668 commandForm.setUuid(id); 10669 10670 orderType = CDI.current().select(GetOrderTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10671 } catch (NamingException ex) { 10672 throw new RuntimeException(ex); 10673 } 10674 10675 return orderType == null ? null : new OrderTypeObject(orderType); 10676 } 10677 10678 @GraphQLField 10679 @GraphQLName("orderTypes") 10680 @GraphQLNonNull 10681 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10682 static CountingPaginatedData<OrderTypeObject> orderTypes(final DataFetchingEnvironment env) { 10683 CountingPaginatedData<OrderTypeObject> data; 10684 10685 try { 10686 var commandForm = OrderUtil.getHome().getGetOrderTypesForm(); 10687 var command = CDI.current().select(GetOrderTypesCommand.class).get(); 10688 10689 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10690 if(totalEntities == null) { 10691 data = Connections.emptyConnection(); 10692 } else { 10693 try(var objectLimiter = new ObjectLimiter(env, OrderTypeConstants.COMPONENT_VENDOR_NAME, OrderTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10694 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10695 10696 var orderTypes = entities.stream() 10697 .map(OrderTypeObject::new) 10698 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10699 10700 data = new CountedObjects<>(objectLimiter, orderTypes); 10701 } 10702 } 10703 } catch (NamingException ex) { 10704 throw new RuntimeException(ex); 10705 } 10706 10707 return data; 10708 } 10709 10710 @GraphQLField 10711 @GraphQLName("orderPriority") 10712 static OrderPriorityObject orderPriority(final DataFetchingEnvironment env, 10713 @GraphQLName("orderTypeName") final String orderTypeName, 10714 @GraphQLName("orderPriorityName") final String orderPriorityName, 10715 @GraphQLName("id") @GraphQLID final String id) { 10716 OrderPriority orderPriority; 10717 10718 try { 10719 var commandForm = OrderUtil.getHome().getGetOrderPriorityForm(); 10720 10721 commandForm.setOrderTypeName(orderTypeName); 10722 commandForm.setOrderPriorityName(orderPriorityName); 10723 commandForm.setUuid(id); 10724 10725 orderPriority = CDI.current().select(GetOrderPriorityCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10726 } catch (NamingException ex) { 10727 throw new RuntimeException(ex); 10728 } 10729 10730 return orderPriority == null ? null : new OrderPriorityObject(orderPriority); 10731 } 10732 10733 @GraphQLField 10734 @GraphQLName("orderPriorities") 10735 @GraphQLNonNull 10736 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10737 static CountingPaginatedData<OrderPriorityObject> orderPriorities(final DataFetchingEnvironment env, 10738 @GraphQLName("orderTypeName") final String orderTypeName) { 10739 CountingPaginatedData<OrderPriorityObject> data; 10740 10741 try { 10742 var commandForm = OrderUtil.getHome().getGetOrderPrioritiesForm(); 10743 var command = CDI.current().select(GetOrderPrioritiesCommand.class).get(); 10744 10745 commandForm.setOrderTypeName(orderTypeName); 10746 10747 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10748 if(totalEntities == null) { 10749 data = Connections.emptyConnection(); 10750 } else { 10751 try(var objectLimiter = new ObjectLimiter(env, OrderPriorityConstants.COMPONENT_VENDOR_NAME, OrderPriorityConstants.ENTITY_TYPE_NAME, totalEntities)) { 10752 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10753 10754 var orderPriorities = entities.stream() 10755 .map(OrderPriorityObject::new) 10756 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10757 10758 data = new CountedObjects<>(objectLimiter, orderPriorities); 10759 } 10760 } 10761 } catch (NamingException ex) { 10762 throw new RuntimeException(ex); 10763 } 10764 10765 return data; 10766 } 10767 10768 @GraphQLField 10769 @GraphQLName("orderTimeType") 10770 static OrderTimeTypeObject orderTimeType(final DataFetchingEnvironment env, 10771 @GraphQLName("orderTypeName") final String orderTypeName, 10772 @GraphQLName("orderTimeTypeName") final String orderTimeTypeName, 10773 @GraphQLName("id") @GraphQLID final String id) { 10774 OrderTimeType orderTimeType; 10775 10776 try { 10777 var commandForm = OrderUtil.getHome().getGetOrderTimeTypeForm(); 10778 10779 commandForm.setOrderTypeName(orderTypeName); 10780 commandForm.setOrderTimeTypeName(orderTimeTypeName); 10781 commandForm.setUuid(id); 10782 10783 orderTimeType = CDI.current().select(GetOrderTimeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10784 } catch (NamingException ex) { 10785 throw new RuntimeException(ex); 10786 } 10787 10788 return orderTimeType == null ? null : new OrderTimeTypeObject(orderTimeType); 10789 } 10790 10791 @GraphQLField 10792 @GraphQLName("orderTimeTypes") 10793 @GraphQLNonNull 10794 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10795 static CountingPaginatedData<OrderTimeTypeObject> orderTimeTypes(final DataFetchingEnvironment env, 10796 @GraphQLName("orderTypeName") final String orderTypeName) { 10797 CountingPaginatedData<OrderTimeTypeObject> data; 10798 10799 try { 10800 var commandForm = OrderUtil.getHome().getGetOrderTimeTypesForm(); 10801 var command = CDI.current().select(GetOrderTimeTypesCommand.class).get(); 10802 10803 commandForm.setOrderTypeName(orderTypeName); 10804 10805 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10806 if(totalEntities == null) { 10807 data = Connections.emptyConnection(); 10808 } else { 10809 try(var objectLimiter = new ObjectLimiter(env, OrderTimeTypeConstants.COMPONENT_VENDOR_NAME, OrderTimeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10810 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10811 10812 var orderTimeTypes = entities.stream() 10813 .map(OrderTimeTypeObject::new) 10814 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10815 10816 data = new CountedObjects<>(objectLimiter, orderTimeTypes); 10817 } 10818 } 10819 } catch (NamingException ex) { 10820 throw new RuntimeException(ex); 10821 } 10822 10823 return data; 10824 } 10825 10826 @GraphQLField 10827 @GraphQLName("wishlistType") 10828 static WishlistTypeObject wishlistType(final DataFetchingEnvironment env, 10829 @GraphQLName("wishlistTypeName") final String wishlistTypeName, 10830 @GraphQLName("id") @GraphQLID final String id) { 10831 WishlistType wishlistType; 10832 10833 try { 10834 var commandForm = WishlistUtil.getHome().getGetWishlistTypeForm(); 10835 10836 commandForm.setWishlistTypeName(wishlistTypeName); 10837 commandForm.setUuid(id); 10838 10839 wishlistType = CDI.current().select(GetWishlistTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10840 } catch (NamingException ex) { 10841 throw new RuntimeException(ex); 10842 } 10843 10844 return wishlistType == null ? null : new WishlistTypeObject(wishlistType); 10845 } 10846 10847 @GraphQLField 10848 @GraphQLName("wishlistTypes") 10849 @GraphQLNonNull 10850 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10851 static CountingPaginatedData<WishlistTypeObject> wishlistTypes(final DataFetchingEnvironment env) { 10852 CountingPaginatedData<WishlistTypeObject> data; 10853 10854 try { 10855 var commandForm = WishlistUtil.getHome().getGetWishlistTypesForm(); 10856 var command = CDI.current().select(GetWishlistTypesCommand.class).get(); 10857 10858 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10859 if(totalEntities == null) { 10860 data = Connections.emptyConnection(); 10861 } else { 10862 try(var objectLimiter = new ObjectLimiter(env, WishlistTypeConstants.COMPONENT_VENDOR_NAME, WishlistTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10863 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10864 10865 var wishlistTypes = entities.stream() 10866 .map(WishlistTypeObject::new) 10867 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10868 10869 data = new CountedObjects<>(objectLimiter, wishlistTypes); 10870 } 10871 } 10872 } catch (NamingException ex) { 10873 throw new RuntimeException(ex); 10874 } 10875 10876 return data; 10877 } 10878 10879 @GraphQLField 10880 @GraphQLName("wishlistPriority") 10881 static WishlistPriorityObject wishlistPriority(final DataFetchingEnvironment env, 10882 @GraphQLName("wishlistTypeName") final String wishlistTypeName, 10883 @GraphQLName("wishlistPriorityName") final String wishlistPriorityName, 10884 @GraphQLName("id") @GraphQLID final String id) { 10885 WishlistPriority wishlistPriority; 10886 10887 try { 10888 var commandForm = WishlistUtil.getHome().getGetWishlistPriorityForm(); 10889 10890 commandForm.setWishlistTypeName(wishlistTypeName); 10891 commandForm.setWishlistPriorityName(wishlistPriorityName); 10892 commandForm.setUuid(id); 10893 10894 wishlistPriority = CDI.current().select(GetWishlistPriorityCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10895 } catch (NamingException ex) { 10896 throw new RuntimeException(ex); 10897 } 10898 10899 return wishlistPriority == null ? null : new WishlistPriorityObject(wishlistPriority); 10900 } 10901 10902 @GraphQLField 10903 @GraphQLName("wishlistPriorities") 10904 @GraphQLNonNull 10905 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10906 static CountingPaginatedData<WishlistPriorityObject> wishlistPriorities(final DataFetchingEnvironment env, 10907 @GraphQLName("wishlistTypeName") @GraphQLNonNull final String wishlistTypeName) { 10908 CountingPaginatedData<WishlistPriorityObject> data; 10909 10910 try { 10911 var commandForm = WishlistUtil.getHome().getGetWishlistPrioritiesForm(); 10912 var command = CDI.current().select(GetWishlistPrioritiesCommand.class).get(); 10913 10914 commandForm.setWishlistTypeName(wishlistTypeName); 10915 10916 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10917 if(totalEntities == null) { 10918 data = Connections.emptyConnection(); 10919 } else { 10920 try(var objectLimiter = new ObjectLimiter(env, WishlistPriorityConstants.COMPONENT_VENDOR_NAME, WishlistPriorityConstants.ENTITY_TYPE_NAME, totalEntities)) { 10921 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10922 10923 var wishlistPriorities = entities.stream() 10924 .map(WishlistPriorityObject::new) 10925 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10926 10927 data = new CountedObjects<>(objectLimiter, wishlistPriorities); 10928 } 10929 } 10930 } catch (NamingException ex) { 10931 throw new RuntimeException(ex); 10932 } 10933 10934 return data; 10935 } 10936 10937 @GraphQLField 10938 @GraphQLName("termType") 10939 static TermTypeObject termType(final DataFetchingEnvironment env, 10940 @GraphQLName("termTypeName") final String termTypeName, 10941 @GraphQLName("id") @GraphQLID final String id) { 10942 TermType termType; 10943 10944 try { 10945 var commandForm = TermUtil.getHome().getGetTermTypeForm(); 10946 10947 commandForm.setTermTypeName(termTypeName); 10948 commandForm.setUuid(id); 10949 10950 termType = CDI.current().select(GetTermTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10951 } catch (NamingException ex) { 10952 throw new RuntimeException(ex); 10953 } 10954 10955 return termType == null ? null : new TermTypeObject(termType); 10956 } 10957 10958 @GraphQLField 10959 @GraphQLName("termTypes") 10960 @GraphQLNonNull 10961 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10962 static CountingPaginatedData<TermTypeObject> termTypes(final DataFetchingEnvironment env) { 10963 CountingPaginatedData<TermTypeObject> data; 10964 10965 try { 10966 var commandForm = TermUtil.getHome().getGetTermTypesForm(); 10967 var command = CDI.current().select(GetTermTypesCommand.class).get(); 10968 10969 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10970 if(totalEntities == null) { 10971 data = Connections.emptyConnection(); 10972 } else { 10973 try(var objectLimiter = new ObjectLimiter(env, TermTypeConstants.COMPONENT_VENDOR_NAME, TermTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10974 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10975 10976 var termTypes = entities.stream() 10977 .map(TermTypeObject::new) 10978 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10979 10980 data = new CountedObjects<>(objectLimiter, termTypes); 10981 } 10982 } 10983 } catch (NamingException ex) { 10984 throw new RuntimeException(ex); 10985 } 10986 10987 return data; 10988 } 10989 10990 @GraphQLField 10991 @GraphQLName("term") 10992 static TermObject term(final DataFetchingEnvironment env, 10993 @GraphQLName("termName") final String termName, 10994 @GraphQLName("id") @GraphQLID final String id) { 10995 Term term; 10996 10997 try { 10998 var commandForm = TermUtil.getHome().getGetTermForm(); 10999 11000 commandForm.setTermName(termName); 11001 commandForm.setUuid(id); 11002 11003 term = CDI.current().select(GetTermCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11004 } catch (NamingException ex) { 11005 throw new RuntimeException(ex); 11006 } 11007 11008 return term == null ? null : new TermObject(term); 11009 } 11010 11011 @GraphQLField 11012 @GraphQLName("terms") 11013 @GraphQLNonNull 11014 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11015 static CountingPaginatedData<TermObject> terms(final DataFetchingEnvironment env) { 11016 CountingPaginatedData<TermObject> data; 11017 11018 try { 11019 var commandForm = TermUtil.getHome().getGetTermsForm(); 11020 var command = CDI.current().select(GetTermsCommand.class).get(); 11021 11022 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11023 if(totalEntities == null) { 11024 data = Connections.emptyConnection(); 11025 } else { 11026 try(var objectLimiter = new ObjectLimiter(env, TermConstants.COMPONENT_VENDOR_NAME, TermConstants.ENTITY_TYPE_NAME, totalEntities)) { 11027 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11028 11029 var terms = entities.stream() 11030 .map(TermObject::new) 11031 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11032 11033 data = new CountedObjects<>(objectLimiter, terms); 11034 } 11035 } 11036 } catch (NamingException ex) { 11037 throw new RuntimeException(ex); 11038 } 11039 11040 return data; 11041 } 11042 11043 @GraphQLField 11044 @GraphQLName("securityRoleGroup") 11045 static SecurityRoleGroupObject securityRoleGroup(final DataFetchingEnvironment env, 11046 @GraphQLName("securityRoleGroupName") final String securityRoleGroupName, 11047 @GraphQLName("id") @GraphQLID final String id) { 11048 SecurityRoleGroup securityRoleGroup; 11049 11050 try { 11051 var commandForm = SecurityUtil.getHome().getGetSecurityRoleGroupForm(); 11052 11053 commandForm.setSecurityRoleGroupName(securityRoleGroupName); 11054 commandForm.setUuid(id); 11055 11056 securityRoleGroup = CDI.current().select(GetSecurityRoleGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11057 } catch (NamingException ex) { 11058 throw new RuntimeException(ex); 11059 } 11060 11061 return securityRoleGroup == null ? null : new SecurityRoleGroupObject(securityRoleGroup); 11062 } 11063 11064 @GraphQLField 11065 @GraphQLName("securityRoleGroups") 11066 @GraphQLNonNull 11067 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11068 static CountingPaginatedData<SecurityRoleGroupObject> securityRoleGroups(final DataFetchingEnvironment env, 11069 @GraphQLName("parentSecurityRoleGroupName") final String parentSecurityRoleGroupName) { 11070 CountingPaginatedData<SecurityRoleGroupObject> data; 11071 11072 try { 11073 var commandForm = SecurityUtil.getHome().getGetSecurityRoleGroupsForm(); 11074 var command = CDI.current().select(GetSecurityRoleGroupsCommand.class).get(); 11075 11076 commandForm.setParentSecurityRoleGroupName(parentSecurityRoleGroupName); 11077 11078 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11079 if(totalEntities == null) { 11080 data = Connections.emptyConnection(); 11081 } else { 11082 try(var objectLimiter = new ObjectLimiter(env, SecurityRoleGroupConstants.COMPONENT_VENDOR_NAME, SecurityRoleGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 11083 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11084 11085 var securityRoleGroups = entities.stream() 11086 .map(SecurityRoleGroupObject::new) 11087 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11088 11089 data = new CountedObjects<>(objectLimiter, securityRoleGroups); 11090 } 11091 } 11092 } catch (NamingException ex) { 11093 throw new RuntimeException(ex); 11094 } 11095 11096 return data; 11097 } 11098 11099 @GraphQLField 11100 @GraphQLName("securityRole") 11101 static SecurityRoleObject securityRole(final DataFetchingEnvironment env, 11102 @GraphQLName("securityRoleGroupName") final String securityRoleGroupName, 11103 @GraphQLName("securityRoleName") final String securityRoleName, 11104 @GraphQLName("id") @GraphQLID final String id) { 11105 SecurityRole securityRole; 11106 11107 try { 11108 var commandForm = SecurityUtil.getHome().getGetSecurityRoleForm(); 11109 11110 commandForm.setSecurityRoleGroupName(securityRoleGroupName); 11111 commandForm.setSecurityRoleName(securityRoleName); 11112 commandForm.setUuid(id); 11113 11114 securityRole = CDI.current().select(GetSecurityRoleCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11115 } catch (NamingException ex) { 11116 throw new RuntimeException(ex); 11117 } 11118 11119 return securityRole == null ? null : new SecurityRoleObject(securityRole); 11120 } 11121 11122 @GraphQLField 11123 @GraphQLName("securityRoles") 11124 @GraphQLNonNull 11125 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11126 static CountingPaginatedData<SecurityRoleObject> securityRoles(final DataFetchingEnvironment env, 11127 @GraphQLName("securityRoleGroupName") @GraphQLNonNull final String securityRoleGroupName) { 11128 CountingPaginatedData<SecurityRoleObject> data; 11129 11130 try { 11131 var commandForm = SecurityUtil.getHome().getGetSecurityRolesForm(); 11132 var command = CDI.current().select(GetSecurityRolesCommand.class).get(); 11133 11134 commandForm.setSecurityRoleGroupName(securityRoleGroupName); 11135 11136 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11137 if(totalEntities == null) { 11138 data = Connections.emptyConnection(); 11139 } else { 11140 try(var objectLimiter = new ObjectLimiter(env, SecurityRoleConstants.COMPONENT_VENDOR_NAME, SecurityRoleConstants.ENTITY_TYPE_NAME, totalEntities)) { 11141 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11142 11143 var securityRoles = entities.stream() 11144 .map(SecurityRoleObject::new) 11145 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11146 11147 data = new CountedObjects<>(objectLimiter, securityRoles); 11148 } 11149 } 11150 } catch (NamingException ex) { 11151 throw new RuntimeException(ex); 11152 } 11153 11154 return data; 11155 } 11156 11157 @GraphQLField 11158 @GraphQLName("personalTitles") 11159 @GraphQLNonNull 11160 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11161 static CountingPaginatedData<PersonalTitleObject> personalTitles(final DataFetchingEnvironment env) { 11162 CountingPaginatedData<PersonalTitleObject> data; 11163 11164 try { 11165 var commandForm = PartyUtil.getHome().getGetPersonalTitlesForm(); 11166 var command = CDI.current().select(GetPersonalTitlesCommand.class).get(); 11167 11168 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11169 if(totalEntities == null) { 11170 data = Connections.emptyConnection(); 11171 } else { 11172 try(var objectLimiter = new ObjectLimiter(env, PersonalTitleConstants.COMPONENT_VENDOR_NAME, PersonalTitleConstants.ENTITY_TYPE_NAME, totalEntities)) { 11173 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11174 11175 var personalTitles = entities.stream() 11176 .map(PersonalTitleObject::new) 11177 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11178 11179 data = new CountedObjects<>(objectLimiter, personalTitles); 11180 } 11181 } 11182 } catch (NamingException ex) { 11183 throw new RuntimeException(ex); 11184 } 11185 11186 return data; 11187 } 11188 11189 @GraphQLField 11190 @GraphQLName("nameSuffixes") 11191 @GraphQLNonNull 11192 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11193 static CountingPaginatedData<NameSuffixObject> nameSuffixes(final DataFetchingEnvironment env) { 11194 CountingPaginatedData<NameSuffixObject> data; 11195 11196 try { 11197 var commandForm = PartyUtil.getHome().getGetNameSuffixesForm(); 11198 var command = CDI.current().select(GetNameSuffixesCommand.class).get(); 11199 11200 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11201 if(totalEntities == null) { 11202 data = Connections.emptyConnection(); 11203 } else { 11204 try(var objectLimiter = new ObjectLimiter(env, NameSuffixConstants.COMPONENT_VENDOR_NAME, NameSuffixConstants.ENTITY_TYPE_NAME, totalEntities)) { 11205 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11206 11207 var nameSuffixes = entities.stream() 11208 .map(NameSuffixObject::new) 11209 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11210 11211 data = new CountedObjects<>(objectLimiter, nameSuffixes); 11212 } 11213 } 11214 } catch (NamingException ex) { 11215 throw new RuntimeException(ex); 11216 } 11217 11218 return data; 11219 } 11220 11221 @GraphQLField 11222 @GraphQLName("tagScope") 11223 static TagScopeObject tagScope(final DataFetchingEnvironment env, 11224 @GraphQLName("tagScopeName") final String tagScopeName, 11225 @GraphQLName("id") @GraphQLID final String id) { 11226 TagScope tagScope; 11227 11228 try { 11229 var commandForm = TagUtil.getHome().getGetTagScopeForm(); 11230 11231 commandForm.setTagScopeName(tagScopeName); 11232 commandForm.setUuid(id); 11233 11234 tagScope = CDI.current().select(GetTagScopeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11235 } catch (NamingException ex) { 11236 throw new RuntimeException(ex); 11237 } 11238 11239 return tagScope == null ? null : new TagScopeObject(tagScope, null); 11240 } 11241 11242 @GraphQLField 11243 @GraphQLName("tagScopes") 11244 @GraphQLNonNull 11245 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11246 static CountingPaginatedData<TagScopeObject> tagScopes(final DataFetchingEnvironment env) { 11247 CountingPaginatedData<TagScopeObject> data; 11248 11249 try { 11250 var commandForm = TagUtil.getHome().getGetTagScopesForm(); 11251 var command = CDI.current().select(GetTagScopesCommand.class).get(); 11252 11253 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11254 if(totalEntities == null) { 11255 data = Connections.emptyConnection(); 11256 } else { 11257 try(var objectLimiter = new ObjectLimiter(env, TagScopeConstants.COMPONENT_VENDOR_NAME, TagScopeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11258 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11259 11260 var tagScopes = entities.stream() 11261 .map(TagScopeObject::new) 11262 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11263 11264 data = new CountedObjects<>(objectLimiter, tagScopes); 11265 } 11266 } 11267 } catch (NamingException ex) { 11268 throw new RuntimeException(ex); 11269 } 11270 11271 return data; 11272 } 11273 11274 @GraphQLField 11275 @GraphQLName("tagScopeEntityType") 11276 static TagScopeEntityTypeObject tagScopeEntityType(final DataFetchingEnvironment env, 11277 @GraphQLName("tagScopeName") @GraphQLNonNull final String tagScopeName, 11278 @GraphQLName("componentVendorName") @GraphQLNonNull final String componentVendorName, 11279 @GraphQLName("entityTypeName") @GraphQLNonNull final String entityTypeName) { 11280 TagScopeEntityType tagScopeEntityType; 11281 11282 try { 11283 var commandForm = TagUtil.getHome().getGetTagScopeEntityTypeForm(); 11284 11285 commandForm.setTagScopeName(tagScopeName); 11286 commandForm.setComponentVendorName(componentVendorName); 11287 commandForm.setEntityTypeName(entityTypeName); 11288 11289 tagScopeEntityType = CDI.current().select(GetTagScopeEntityTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11290 } catch (NamingException ex) { 11291 throw new RuntimeException(ex); 11292 } 11293 11294 return tagScopeEntityType == null ? null : new TagScopeEntityTypeObject(tagScopeEntityType); 11295 } 11296 11297 @GraphQLField 11298 @GraphQLName("tagScopeEntityTypes") 11299 @GraphQLNonNull 11300 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11301 static CountingPaginatedData<TagScopeEntityTypeObject> tagScopeEntityTypes(final DataFetchingEnvironment env, 11302 @GraphQLName("tagScopeName") final String tagScopeName, 11303 @GraphQLName("componentVendorName") final String componentVendorName, 11304 @GraphQLName("entityTypeName") final String entityTypeName) { 11305 try { 11306 var commandForm = TagUtil.getHome().getGetTagScopeEntityTypesForm(); 11307 var command = CDI.current().select(GetTagScopeEntityTypesCommand.class).get(); 11308 11309 commandForm.setTagScopeName(tagScopeName); 11310 commandForm.setComponentVendorName(componentVendorName); 11311 commandForm.setEntityTypeName(entityTypeName); 11312 11313 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11314 if(totalEntities == null) { 11315 return Connections.emptyConnection(); 11316 } else { 11317 try(var objectLimiter = new ObjectLimiter(env, TagScopeEntityTypeConstants.COMPONENT_VENDOR_NAME, TagScopeEntityTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11318 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11319 11320 return new CountedObjects<>(objectLimiter, entities.stream().map(TagScopeEntityTypeObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size())))); 11321 } 11322 } 11323 } catch (NamingException ex) { 11324 throw new RuntimeException(ex); 11325 } 11326 } 11327 11328 @GraphQLField 11329 @GraphQLName("tag") 11330 static TagObject tag(final DataFetchingEnvironment env, 11331 @GraphQLName("tagScopeName") final String tagScopeName, 11332 @GraphQLName("tagName") final String tagName, 11333 @GraphQLName("id") @GraphQLID final String id) { 11334 Tag tag; 11335 11336 try { 11337 var commandForm = TagUtil.getHome().getGetTagForm(); 11338 11339 commandForm.setTagScopeName(tagScopeName); 11340 commandForm.setTagName(tagName); 11341 commandForm.setUuid(id); 11342 11343 tag = CDI.current().select(GetTagCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11344 } catch (NamingException ex) { 11345 throw new RuntimeException(ex); 11346 } 11347 11348 return tag == null ? null : new TagObject(tag); 11349 } 11350 11351 @GraphQLField 11352 @GraphQLName("tags") 11353 @GraphQLNonNull 11354 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11355 static CountingPaginatedData<TagObject> tags(final DataFetchingEnvironment env, 11356 @GraphQLName("tagScopeName") @GraphQLNonNull final String tagScopeName) { 11357 CountingPaginatedData<TagObject> data; 11358 11359 try { 11360 var commandForm = TagUtil.getHome().getGetTagsForm(); 11361 var command = CDI.current().select(GetTagsCommand.class).get(); 11362 11363 commandForm.setTagScopeName(tagScopeName); 11364 11365 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11366 if(totalEntities == null) { 11367 data = Connections.emptyConnection(); 11368 } else { 11369 try(var objectLimiter = new ObjectLimiter(env, TagConstants.COMPONENT_VENDOR_NAME, TagConstants.ENTITY_TYPE_NAME, totalEntities)) { 11370 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11371 11372 var tagObjects = entities.stream() 11373 .map(TagObject::new) 11374 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11375 11376 data = new CountedObjects<>(objectLimiter, tagObjects); 11377 } 11378 } 11379 } catch (NamingException ex) { 11380 throw new RuntimeException(ex); 11381 } 11382 11383 return data; 11384 } 11385 11386 @GraphQLField 11387 @GraphQLName("entityTag") 11388 static EntityTagObject entityTag(final DataFetchingEnvironment env, 11389 @GraphQLName("id") @GraphQLNonNull final String id, 11390 @GraphQLName("tagScopeName") @GraphQLNonNull final String tagScopeName, 11391 @GraphQLName("tagName") @GraphQLNonNull final String tagName) { 11392 EntityTag entityTag; 11393 11394 try { 11395 var commandForm = TagUtil.getHome().getGetEntityTagForm(); 11396 11397 commandForm.setUuid(id); 11398 commandForm.setTagScopeName(tagScopeName); 11399 commandForm.setTagName(tagName); 11400 11401 entityTag = CDI.current().select(GetEntityTagCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11402 } catch (NamingException ex) { 11403 throw new RuntimeException(ex); 11404 } 11405 11406 return entityTag == null ? null : new EntityTagObject(entityTag); 11407 } 11408 11409 @GraphQLField 11410 @GraphQLName("entityTags") 11411 @GraphQLNonNull 11412 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11413 static CountingPaginatedData<EntityTagObject> entityTags(final DataFetchingEnvironment env, 11414 @GraphQLName("id") final String id, 11415 @GraphQLName("tagScopeName") final String tagScopeName, 11416 @GraphQLName("tagName") final String tagName) { 11417 CountingPaginatedData<EntityTagObject> data; 11418 11419 try { 11420 var commandForm = TagUtil.getHome().getGetEntityTagsForm(); 11421 var command = CDI.current().select(GetEntityTagsCommand.class).get(); 11422 11423 commandForm.setUuid(id); 11424 commandForm.setTagScopeName(tagScopeName); 11425 commandForm.setTagName(tagName); 11426 11427 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11428 if(totalEntities == null) { 11429 data = Connections.emptyConnection(); 11430 } else { 11431 try(var objectLimiter = new ObjectLimiter(env, EntityTagConstants.COMPONENT_VENDOR_NAME, EntityTagConstants.ENTITY_TYPE_NAME, totalEntities)) { 11432 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11433 11434 var entityTags = entities.stream() 11435 .map(EntityTagObject::new) 11436 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11437 11438 data = new CountedObjects<>(objectLimiter, entityTags); 11439 } 11440 } 11441 } catch (NamingException ex) { 11442 throw new RuntimeException(ex); 11443 } 11444 11445 return data; 11446 } 11447 11448 @GraphQLField 11449 @GraphQLName("geoCodeType") 11450 static GeoCodeTypeObject geoCodeType(final DataFetchingEnvironment env, 11451 @GraphQLName("geoCodeTypeName") final String geoCodeTypeName, 11452 @GraphQLName("id") @GraphQLID final String id) { 11453 GeoCodeType geoCodeType; 11454 11455 try { 11456 var commandForm = GeoUtil.getHome().getGetGeoCodeTypeForm(); 11457 11458 commandForm.setGeoCodeTypeName(geoCodeTypeName); 11459 commandForm.setUuid(id); 11460 11461 geoCodeType = CDI.current().select(GetGeoCodeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11462 } catch (NamingException ex) { 11463 throw new RuntimeException(ex); 11464 } 11465 11466 return geoCodeType == null ? null : new GeoCodeTypeObject(geoCodeType); 11467 } 11468 11469 @GraphQLField 11470 @GraphQLName("geoCodeTypes") 11471 @GraphQLNonNull 11472 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11473 static CountingPaginatedData<GeoCodeTypeObject> geoCodeTypes(final DataFetchingEnvironment env) { 11474 CountingPaginatedData<GeoCodeTypeObject> data; 11475 11476 try { 11477 var commandForm = GeoUtil.getHome().getGetGeoCodeTypesForm(); 11478 var command = CDI.current().select(GetGeoCodeTypesCommand.class).get(); 11479 11480 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11481 if(totalEntities == null) { 11482 data = Connections.emptyConnection(); 11483 } else { 11484 try(var objectLimiter = new ObjectLimiter(env, GeoCodeTypeConstants.COMPONENT_VENDOR_NAME, GeoCodeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11485 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11486 11487 var geoCodeTypes = entities.stream() 11488 .map(GeoCodeTypeObject::new) 11489 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11490 11491 data = new CountedObjects<>(objectLimiter, geoCodeTypes); 11492 } 11493 } 11494 } catch (NamingException ex) { 11495 throw new RuntimeException(ex); 11496 } 11497 11498 return data; 11499 } 11500 11501 @GraphQLField 11502 @GraphQLName("geoCodeAliasType") 11503 static GeoCodeAliasTypeObject geoCodeAliasType(final DataFetchingEnvironment env, 11504 @GraphQLName("geoCodeTypeName") @GraphQLNonNull final String geoCodeTypeName, 11505 @GraphQLName("geoCodeAliasTypeName") @GraphQLNonNull final String geoCodeAliasTypeName) { 11506 GeoCodeAliasType geoCodeAliasType; 11507 11508 try { 11509 var commandForm = GeoUtil.getHome().getGetGeoCodeAliasTypeForm(); 11510 11511 commandForm.setGeoCodeTypeName(geoCodeTypeName); 11512 commandForm.setGeoCodeAliasTypeName(geoCodeAliasTypeName); 11513 11514 geoCodeAliasType = CDI.current().select(GetGeoCodeAliasTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11515 } catch (NamingException ex) { 11516 throw new RuntimeException(ex); 11517 } 11518 11519 return geoCodeAliasType == null ? null : new GeoCodeAliasTypeObject(geoCodeAliasType); 11520 } 11521 11522 @GraphQLField 11523 @GraphQLName("geoCodeAliasTypes") 11524 @GraphQLNonNull 11525 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11526 static CountingPaginatedData<GeoCodeAliasTypeObject> geoCodeAliasTypes(final DataFetchingEnvironment env, 11527 @GraphQLName("geoCodeTypeName") @GraphQLNonNull final String geoCodeTypeName) { 11528 CountingPaginatedData<GeoCodeAliasTypeObject> data; 11529 11530 try { 11531 var commandForm = GeoUtil.getHome().getGetGeoCodeAliasTypesForm(); 11532 var command = CDI.current().select(GetGeoCodeAliasTypesCommand.class).get(); 11533 11534 commandForm.setGeoCodeTypeName(geoCodeTypeName); 11535 11536 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11537 if(totalEntities == null) { 11538 data = Connections.emptyConnection(); 11539 } else { 11540 try(var objectLimiter = new ObjectLimiter(env, GeoCodeAliasTypeConstants.COMPONENT_VENDOR_NAME, GeoCodeAliasTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11541 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11542 11543 var geoCodeAliasTypes = entities.stream() 11544 .map(GeoCodeAliasTypeObject::new) 11545 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11546 11547 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 11548 } 11549 } 11550 } catch (NamingException ex) { 11551 throw new RuntimeException(ex); 11552 } 11553 11554 return data; 11555 } 11556 11557 @GraphQLField 11558 @GraphQLName("geoCodeScope") 11559 static GeoCodeScopeObject geoCodeScope(final DataFetchingEnvironment env, 11560 @GraphQLName("geoCodeScopeName") final String geoCodeScopeName, 11561 @GraphQLName("id") @GraphQLID final String id) { 11562 GeoCodeScope geoCodeScope; 11563 11564 try { 11565 var commandForm = GeoUtil.getHome().getGetGeoCodeScopeForm(); 11566 11567 commandForm.setGeoCodeScopeName(geoCodeScopeName); 11568 commandForm.setUuid(id); 11569 11570 geoCodeScope = CDI.current().select(GetGeoCodeScopeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11571 } catch (NamingException ex) { 11572 throw new RuntimeException(ex); 11573 } 11574 11575 return geoCodeScope == null ? null : new GeoCodeScopeObject(geoCodeScope); 11576 } 11577 11578 @GraphQLField 11579 @GraphQLName("geoCodeScopes") 11580 @GraphQLNonNull 11581 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11582 static CountingPaginatedData<GeoCodeScopeObject> geoCodeScopes(final DataFetchingEnvironment env) { 11583 CountingPaginatedData<GeoCodeScopeObject> data; 11584 11585 try { 11586 var commandForm = GeoUtil.getHome().getGetGeoCodeScopesForm(); 11587 var command = CDI.current().select(GetGeoCodeScopesCommand.class).get(); 11588 11589 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11590 if(totalEntities == null) { 11591 data = Connections.emptyConnection(); 11592 } else { 11593 try(var objectLimiter = new ObjectLimiter(env, GeoCodeScopeConstants.COMPONENT_VENDOR_NAME, GeoCodeScopeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11594 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11595 11596 var geoCodeScopes = entities.stream() 11597 .map(GeoCodeScopeObject::new) 11598 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11599 11600 data = new CountedObjects<>(objectLimiter, geoCodeScopes); 11601 } 11602 } 11603 } catch (NamingException ex) { 11604 throw new RuntimeException(ex); 11605 } 11606 11607 return data; 11608 } 11609 11610 @GraphQLField 11611 @GraphQLName("geoCode") 11612 static GeoCodeObject geoCode(final DataFetchingEnvironment env, 11613 @GraphQLName("geoCodeName") final String geoCodeName, 11614 @GraphQLName("id") @GraphQLID final String id) { 11615 GeoCode geoCode; 11616 11617 try { 11618 var commandForm = GeoUtil.getHome().getGetGeoCodeForm(); 11619 11620 commandForm.setGeoCodeName(geoCodeName); 11621 commandForm.setUuid(id); 11622 11623 geoCode = CDI.current().select(GetGeoCodeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11624 } catch (NamingException ex) { 11625 throw new RuntimeException(ex); 11626 } 11627 11628 return geoCode == null ? null : new GeoCodeObject(geoCode); 11629 } 11630 11631 @GraphQLField 11632 @GraphQLName("geoCodeAlias") 11633 static GeoCodeAliasObject geoCodeAlias(final DataFetchingEnvironment env, 11634 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName, 11635 @GraphQLName("geoCodeAliasTypeName") @GraphQLNonNull final String geoCodeAliasTypeName) { 11636 GeoCodeAlias geoCodeAlias; 11637 11638 try { 11639 var commandForm = GeoUtil.getHome().getGetGeoCodeAliasForm(); 11640 11641 commandForm.setGeoCodeName(geoCodeName); 11642 commandForm.setGeoCodeAliasTypeName(geoCodeAliasTypeName); 11643 11644 geoCodeAlias = CDI.current().select(GetGeoCodeAliasCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11645 } catch (NamingException ex) { 11646 throw new RuntimeException(ex); 11647 } 11648 11649 return geoCodeAlias == null ? null : new GeoCodeAliasObject(geoCodeAlias); 11650 } 11651 11652 @GraphQLField 11653 @GraphQLName("geoCodeAliases") 11654 @GraphQLNonNull 11655 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11656 static CountingPaginatedData<GeoCodeAliasObject> geoCodeAliases(final DataFetchingEnvironment env, 11657 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName) { 11658 CountingPaginatedData<GeoCodeAliasObject> data; 11659 11660 try { 11661 var commandForm = GeoUtil.getHome().getGetGeoCodeAliasesForm(); 11662 var command = CDI.current().select(GetGeoCodeAliasesCommand.class).get(); 11663 11664 commandForm.setGeoCodeName(geoCodeName); 11665 11666 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11667 if(totalEntities == null) { 11668 data = Connections.emptyConnection(); 11669 } else { 11670 try(var objectLimiter = new ObjectLimiter(env, GeoCodeAliasConstants.COMPONENT_VENDOR_NAME, GeoCodeAliasConstants.ENTITY_TYPE_NAME, totalEntities)) { 11671 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11672 11673 var geoCodeAliass = entities.stream() 11674 .map(GeoCodeAliasObject::new) 11675 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11676 11677 data = new CountedObjects<>(objectLimiter, geoCodeAliass); 11678 } 11679 } 11680 } catch (NamingException ex) { 11681 throw new RuntimeException(ex); 11682 } 11683 11684 return data; 11685 } 11686 11687 @GraphQLField 11688 @GraphQLName("geoCodeLanguage") 11689 static GeoCodeLanguageObject geoCodeLanguage(final DataFetchingEnvironment env, 11690 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName, 11691 @GraphQLName("languageIsoName") @GraphQLNonNull final String languageIsoName) { 11692 GeoCodeLanguage geoCodeLanguage; 11693 11694 try { 11695 var commandForm = GeoUtil.getHome().getGetGeoCodeLanguageForm(); 11696 11697 commandForm.setGeoCodeName(geoCodeName); 11698 commandForm.setLanguageIsoName(languageIsoName); 11699 11700 geoCodeLanguage = CDI.current().select(GetGeoCodeLanguageCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11701 } catch (NamingException ex) { 11702 throw new RuntimeException(ex); 11703 } 11704 11705 return geoCodeLanguage == null ? null : new GeoCodeLanguageObject(geoCodeLanguage); 11706 } 11707 11708 @GraphQLField 11709 @GraphQLName("geoCodeLanguages") 11710 @GraphQLNonNull 11711 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11712 static CountingPaginatedData<GeoCodeLanguageObject> geoCodeLanguages(final DataFetchingEnvironment env, 11713 @GraphQLName("geoCodeName") final String geoCodeName, 11714 @GraphQLName("languageIsoName") final String languageIsoName) { 11715 CountingPaginatedData<GeoCodeLanguageObject> data; 11716 11717 try { 11718 var commandForm = GeoUtil.getHome().getGetGeoCodeLanguagesForm(); 11719 var command = CDI.current().select(GetGeoCodeLanguagesCommand.class).get(); 11720 11721 commandForm.setGeoCodeName(geoCodeName); 11722 commandForm.setLanguageIsoName(languageIsoName); 11723 11724 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11725 if(totalEntities == null) { 11726 data = Connections.emptyConnection(); 11727 } else { 11728 try(var objectLimiter = new ObjectLimiter(env, GeoCodeLanguageConstants.COMPONENT_VENDOR_NAME, GeoCodeLanguageConstants.ENTITY_TYPE_NAME, totalEntities)) { 11729 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11730 11731 var transactionTypes = entities.stream() 11732 .map(GeoCodeLanguageObject::new) 11733 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11734 11735 data = new CountedObjects<>(objectLimiter, transactionTypes); 11736 } 11737 } 11738 } catch (NamingException ex) { 11739 throw new RuntimeException(ex); 11740 } 11741 11742 return data; 11743 } 11744 11745 @GraphQLField 11746 @GraphQLName("geoCodeCurrency") 11747 static GeoCodeCurrencyObject geoCodeCurrency(final DataFetchingEnvironment env, 11748 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName, 11749 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 11750 GeoCodeCurrency geoCodeCurrency; 11751 11752 try { 11753 var commandForm = GeoUtil.getHome().getGetGeoCodeCurrencyForm(); 11754 11755 commandForm.setGeoCodeName(geoCodeName); 11756 commandForm.setCurrencyIsoName(currencyIsoName); 11757 11758 geoCodeCurrency = CDI.current().select(GetGeoCodeCurrencyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11759 } catch (NamingException ex) { 11760 throw new RuntimeException(ex); 11761 } 11762 11763 return geoCodeCurrency == null ? null : new GeoCodeCurrencyObject(geoCodeCurrency); 11764 } 11765 11766 @GraphQLField 11767 @GraphQLName("geoCodeCurrencies") 11768 @GraphQLNonNull 11769 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11770 static CountingPaginatedData<GeoCodeCurrencyObject> geoCodeCurrencies(final DataFetchingEnvironment env, 11771 @GraphQLName("geoCodeName") final String geoCodeName, 11772 @GraphQLName("currencyIsoName") final String currencyIsoName) { 11773 CountingPaginatedData<GeoCodeCurrencyObject> data; 11774 11775 try { 11776 var commandForm = GeoUtil.getHome().getGetGeoCodeCurrenciesForm(); 11777 var command = CDI.current().select(GetGeoCodeCurrenciesCommand.class).get(); 11778 11779 commandForm.setGeoCodeName(geoCodeName); 11780 commandForm.setCurrencyIsoName(currencyIsoName); 11781 11782 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11783 if(totalEntities == null) { 11784 data = Connections.emptyConnection(); 11785 } else { 11786 try(var objectLimiter = new ObjectLimiter(env, GeoCodeCurrencyConstants.COMPONENT_VENDOR_NAME, GeoCodeCurrencyConstants.ENTITY_TYPE_NAME, totalEntities)) { 11787 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11788 11789 var transactionTypes = entities.stream() 11790 .map(GeoCodeCurrencyObject::new) 11791 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11792 11793 data = new CountedObjects<>(objectLimiter, transactionTypes); 11794 } 11795 } 11796 } catch (NamingException ex) { 11797 throw new RuntimeException(ex); 11798 } 11799 11800 return data; 11801 } 11802 11803 @GraphQLField 11804 @GraphQLName("geoCodeTimeZone") 11805 static GeoCodeTimeZoneObject geoCodeTimeZone(final DataFetchingEnvironment env, 11806 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName, 11807 @GraphQLName("javaTimeZoneName") @GraphQLNonNull final String javaTimeZoneName) { 11808 GeoCodeTimeZone geoCodeTimeZone; 11809 11810 try { 11811 var commandForm = GeoUtil.getHome().getGetGeoCodeTimeZoneForm(); 11812 11813 commandForm.setGeoCodeName(geoCodeName); 11814 commandForm.setJavaTimeZoneName(javaTimeZoneName); 11815 11816 geoCodeTimeZone = CDI.current().select(GetGeoCodeTimeZoneCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11817 } catch (NamingException ex) { 11818 throw new RuntimeException(ex); 11819 } 11820 11821 return geoCodeTimeZone == null ? null : new GeoCodeTimeZoneObject(geoCodeTimeZone); 11822 } 11823 11824 @GraphQLField 11825 @GraphQLName("geoCodeTimeZones") 11826 @GraphQLNonNull 11827 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11828 static CountingPaginatedData<GeoCodeTimeZoneObject> geoCodeTimeZones(final DataFetchingEnvironment env, 11829 @GraphQLName("geoCodeName") final String geoCodeName, 11830 @GraphQLName("javaTimeZoneName") final String javaTimeZoneName) { 11831 CountingPaginatedData<GeoCodeTimeZoneObject> data; 11832 11833 try { 11834 var commandForm = GeoUtil.getHome().getGetGeoCodeTimeZonesForm(); 11835 var command = CDI.current().select(GetGeoCodeTimeZonesCommand.class).get(); 11836 11837 commandForm.setGeoCodeName(geoCodeName); 11838 commandForm.setJavaTimeZoneName(javaTimeZoneName); 11839 11840 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11841 if(totalEntities == null) { 11842 data = Connections.emptyConnection(); 11843 } else { 11844 try(var objectLimiter = new ObjectLimiter(env, GeoCodeTimeZoneConstants.COMPONENT_VENDOR_NAME, GeoCodeTimeZoneConstants.ENTITY_TYPE_NAME, totalEntities)) { 11845 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11846 11847 var transactionTypes = entities.stream() 11848 .map(GeoCodeTimeZoneObject::new) 11849 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11850 11851 data = new CountedObjects<>(objectLimiter, transactionTypes); 11852 } 11853 } 11854 } catch (NamingException ex) { 11855 throw new RuntimeException(ex); 11856 } 11857 11858 return data; 11859 } 11860 11861 @GraphQLField 11862 @GraphQLName("geoCodeDateTimeFormat") 11863 static GeoCodeDateTimeFormatObject geoCodeDateTimeFormat(final DataFetchingEnvironment env, 11864 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName, 11865 @GraphQLName("dateTimeFormatName") @GraphQLNonNull final String dateTimeFormatName) { 11866 GeoCodeDateTimeFormat geoCodeDateTimeFormat; 11867 11868 try { 11869 var commandForm = GeoUtil.getHome().getGetGeoCodeDateTimeFormatForm(); 11870 11871 commandForm.setGeoCodeName(geoCodeName); 11872 commandForm.setDateTimeFormatName(dateTimeFormatName); 11873 11874 geoCodeDateTimeFormat = CDI.current().select(GetGeoCodeDateTimeFormatCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11875 } catch (NamingException ex) { 11876 throw new RuntimeException(ex); 11877 } 11878 11879 return geoCodeDateTimeFormat == null ? null : new GeoCodeDateTimeFormatObject(geoCodeDateTimeFormat); 11880 } 11881 11882 @GraphQLField 11883 @GraphQLName("geoCodeDateTimeFormats") 11884 @GraphQLNonNull 11885 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11886 static CountingPaginatedData<GeoCodeDateTimeFormatObject> geoCodeDateTimeFormats(final DataFetchingEnvironment env, 11887 @GraphQLName("geoCodeName") final String geoCodeName, 11888 @GraphQLName("dateTimeFormatName") final String dateTimeFormatName) { 11889 CountingPaginatedData<GeoCodeDateTimeFormatObject> data; 11890 11891 try { 11892 var commandForm = GeoUtil.getHome().getGetGeoCodeDateTimeFormatsForm(); 11893 var command = CDI.current().select(GetGeoCodeDateTimeFormatsCommand.class).get(); 11894 11895 commandForm.setGeoCodeName(geoCodeName); 11896 commandForm.setDateTimeFormatName(dateTimeFormatName); 11897 11898 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11899 if(totalEntities == null) { 11900 data = Connections.emptyConnection(); 11901 } else { 11902 try(var objectLimiter = new ObjectLimiter(env, GeoCodeDateTimeFormatConstants.COMPONENT_VENDOR_NAME, GeoCodeDateTimeFormatConstants.ENTITY_TYPE_NAME, totalEntities)) { 11903 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11904 11905 var transactionTypes = entities.stream() 11906 .map(GeoCodeDateTimeFormatObject::new) 11907 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11908 11909 data = new CountedObjects<>(objectLimiter, transactionTypes); 11910 } 11911 } 11912 } catch (NamingException ex) { 11913 throw new RuntimeException(ex); 11914 } 11915 11916 return data; 11917 } 11918 11919 @GraphQLField 11920 @GraphQLName("country") 11921 static GeoCodeObject country(final DataFetchingEnvironment env, 11922 @GraphQLName("geoCodeName") final String geoCodeName, 11923 @GraphQLName("countryName") final String countryName, 11924 @GraphQLName("iso3Number") final String iso3Number, 11925 @GraphQLName("iso3Letter") final String iso3Letter, 11926 @GraphQLName("iso2Letter") final String iso2Letter, 11927 @GraphQLName("alias") final String alias) { 11928 GeoCode geoCode; 11929 11930 try { 11931 var commandForm = GeoUtil.getHome().getGetCountryForm(); 11932 11933 commandForm.setGeoCodeName(geoCodeName); 11934 commandForm.setCountryName(countryName); 11935 commandForm.setIso3Number(iso3Number); 11936 commandForm.setIso3Letter(iso3Letter); 11937 commandForm.setIso2Letter(iso2Letter); 11938 commandForm.setAlias(alias); 11939 11940 geoCode = CDI.current().select(GetCountryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11941 } catch (NamingException ex) { 11942 throw new RuntimeException(ex); 11943 } 11944 11945 return geoCode == null ? null : new GeoCodeObject(geoCode); 11946 } 11947 11948 @GraphQLField 11949 @GraphQLName("countries") 11950 @GraphQLNonNull 11951 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11952 static CountingPaginatedData<GeoCodeObject> countries(final DataFetchingEnvironment env) { 11953 CountingPaginatedData<GeoCodeObject> data; 11954 11955 try { 11956 var commandForm = GeoUtil.getHome().getGetCountriesForm(); 11957 var command = CDI.current().select(GetCountriesCommand.class).get(); 11958 11959 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11960 if(totalEntities == null) { 11961 data = Connections.emptyConnection(); 11962 } else { 11963 try(var objectLimiter = new ObjectLimiter(env, GeoCodeConstants.COMPONENT_VENDOR_NAME, GeoCodeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11964 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11965 11966 var geoCodeAliasTypes = entities.stream() 11967 .map(GeoCodeObject::new) 11968 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11969 11970 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 11971 } 11972 } 11973 } catch (NamingException ex) { 11974 throw new RuntimeException(ex); 11975 } 11976 11977 return data; 11978 } 11979 11980 @GraphQLField 11981 @GraphQLName("zipCode") 11982 static GeoCodeObject zipCode(final DataFetchingEnvironment env, 11983 @GraphQLName("countryGeoCodeName") @GraphQLNonNull final String countryGeoCodeName, 11984 @GraphQLName("zipCodeName") @GraphQLNonNull final String zipCodeName) { 11985 GeoCode geoCode; 11986 11987 try { 11988 var commandForm = GeoUtil.getHome().getGetZipCodeForm(); 11989 11990 commandForm.setCountryGeoCodeName(countryGeoCodeName); 11991 commandForm.setZipCodeName(zipCodeName); 11992 11993 geoCode = CDI.current().select(GetZipCodeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11994 } catch (NamingException ex) { 11995 throw new RuntimeException(ex); 11996 } 11997 11998 return geoCode == null ? null : new GeoCodeObject(geoCode); 11999 } 12000 12001 @GraphQLField 12002 @GraphQLName("zipCodes") 12003 @GraphQLNonNull 12004 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12005 static CountingPaginatedData<GeoCodeObject> zipCodes(final DataFetchingEnvironment env, 12006 @GraphQLName("countryName") @GraphQLNonNull final String countryName) { 12007 CountingPaginatedData<GeoCodeObject> data; 12008 12009 try { 12010 var commandForm = GeoUtil.getHome().getGetZipCodesForm(); 12011 var command = CDI.current().select(GetZipCodesCommand.class).get(); 12012 12013 commandForm.setCountryName(countryName); 12014 12015 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12016 if(totalEntities == null) { 12017 data = Connections.emptyConnection(); 12018 } else { 12019 try(var objectLimiter = new ObjectLimiter(env, GeoCodeConstants.COMPONENT_VENDOR_NAME, GeoCodeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12020 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12021 12022 var geoCodeAliasTypes = entities.stream() 12023 .map(GeoCodeObject::new) 12024 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12025 12026 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 12027 } 12028 } 12029 } catch (NamingException ex) { 12030 throw new RuntimeException(ex); 12031 } 12032 12033 return data; 12034 } 12035 12036 @GraphQLField 12037 @GraphQLName("state") 12038 static GeoCodeObject state(final DataFetchingEnvironment env, 12039 @GraphQLName("countryGeoCodeName") @GraphQLNonNull final String countryGeoCodeName, 12040 @GraphQLName("stateName") final String stateName, 12041 @GraphQLName("postal2Letter") final String postal2Letter) { 12042 GeoCode geoCode; 12043 12044 try { 12045 var commandForm = GeoUtil.getHome().getGetStateForm(); 12046 12047 commandForm.setCountryGeoCodeName(countryGeoCodeName); 12048 commandForm.setStateName(stateName); 12049 commandForm.setPostal2Letter(postal2Letter); 12050 12051 geoCode = CDI.current().select(GetStateCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12052 } catch (NamingException ex) { 12053 throw new RuntimeException(ex); 12054 } 12055 12056 return geoCode == null ? null : new GeoCodeObject(geoCode); 12057 } 12058 12059 @GraphQLField 12060 @GraphQLName("states") 12061 @GraphQLNonNull 12062 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12063 static CountingPaginatedData<GeoCodeObject> states(final DataFetchingEnvironment env, 12064 @GraphQLName("countryName") @GraphQLNonNull final String countryName) { 12065 CountingPaginatedData<GeoCodeObject> data; 12066 12067 try { 12068 var commandForm = GeoUtil.getHome().getGetStatesForm(); 12069 var command = CDI.current().select(GetStatesCommand.class).get(); 12070 12071 commandForm.setCountryName(countryName); 12072 12073 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12074 if(totalEntities == null) { 12075 data = Connections.emptyConnection(); 12076 } else { 12077 try(var objectLimiter = new ObjectLimiter(env, GeoCodeConstants.COMPONENT_VENDOR_NAME, GeoCodeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12078 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12079 12080 var geoCodeAliasTypes = entities.stream() 12081 .map(GeoCodeObject::new) 12082 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12083 12084 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 12085 } 12086 } 12087 } catch (NamingException ex) { 12088 throw new RuntimeException(ex); 12089 } 12090 12091 return data; 12092 } 12093 12094 @GraphQLField 12095 @GraphQLName("county") 12096 static GeoCodeObject county(final DataFetchingEnvironment env, 12097 @GraphQLName("stateGeoCodeName") @GraphQLNonNull final String stateGeoCodeName, 12098 @GraphQLName("countyName") final String countyName, 12099 @GraphQLName("countyNumber") final String countyNumber) { 12100 GeoCode geoCode; 12101 12102 try { 12103 var commandForm = GeoUtil.getHome().getGetCountyForm(); 12104 12105 commandForm.setStateGeoCodeName(stateGeoCodeName); 12106 commandForm.setCountyName(countyName); 12107 commandForm.setCountyNumber(countyNumber); 12108 12109 geoCode = CDI.current().select(GetCountyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12110 } catch (NamingException ex) { 12111 throw new RuntimeException(ex); 12112 } 12113 12114 return geoCode == null ? null : new GeoCodeObject(geoCode); 12115 } 12116 12117 @GraphQLField 12118 @GraphQLName("counties") 12119 @GraphQLNonNull 12120 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12121 static CountingPaginatedData<GeoCodeObject> counties(final DataFetchingEnvironment env, 12122 @GraphQLName("countryName") @GraphQLNonNull final String countryName, 12123 @GraphQLName("stateName") @GraphQLNonNull final String stateName) { 12124 CountingPaginatedData<GeoCodeObject> data; 12125 12126 try { 12127 var commandForm = GeoUtil.getHome().getGetCountiesForm(); 12128 var command = CDI.current().select(GetCountiesCommand.class).get(); 12129 12130 commandForm.setCountryName(countryName); 12131 commandForm.setStateName(stateName); 12132 12133 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12134 if(totalEntities == null) { 12135 data = Connections.emptyConnection(); 12136 } else { 12137 try(var objectLimiter = new ObjectLimiter(env, GeoCodeConstants.COMPONENT_VENDOR_NAME, GeoCodeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12138 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12139 12140 var geoCodeAliasTypes = entities.stream() 12141 .map(GeoCodeObject::new) 12142 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12143 12144 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 12145 } 12146 } 12147 } catch (NamingException ex) { 12148 throw new RuntimeException(ex); 12149 } 12150 12151 return data; 12152 } 12153 12154 @GraphQLField 12155 @GraphQLName("city") 12156 static GeoCodeObject city(final DataFetchingEnvironment env, 12157 @GraphQLName("stateGeoCodeName") @GraphQLNonNull final String stateGeoCodeName, 12158 @GraphQLName("cityName") @GraphQLNonNull final String cityName) { 12159 GeoCode geoCode; 12160 12161 try { 12162 var commandForm = GeoUtil.getHome().getGetCityForm(); 12163 12164 commandForm.setStateGeoCodeName(stateGeoCodeName); 12165 commandForm.setCityName(cityName); 12166 12167 geoCode = CDI.current().select(GetCityCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12168 } catch (NamingException ex) { 12169 throw new RuntimeException(ex); 12170 } 12171 12172 return geoCode == null ? null : new GeoCodeObject(geoCode); 12173 } 12174 12175 @GraphQLField 12176 @GraphQLName("cities") 12177 @GraphQLNonNull 12178 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12179 static CountingPaginatedData<GeoCodeObject> cities(final DataFetchingEnvironment env, 12180 @GraphQLName("countryName") @GraphQLNonNull final String countryName, 12181 @GraphQLName("stateName") @GraphQLNonNull final String stateName) { 12182 CountingPaginatedData<GeoCodeObject> data; 12183 12184 try { 12185 var commandForm = GeoUtil.getHome().getGetCitiesForm(); 12186 var command = CDI.current().select(GetCitiesCommand.class).get(); 12187 12188 commandForm.setCountryName(countryName); 12189 commandForm.setStateName(stateName); 12190 12191 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12192 if(totalEntities == null) { 12193 data = Connections.emptyConnection(); 12194 } else { 12195 try(var objectLimiter = new ObjectLimiter(env, GeoCodeConstants.COMPONENT_VENDOR_NAME, GeoCodeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12196 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12197 12198 var geoCodeAliasTypes = entities.stream() 12199 .map(GeoCodeObject::new) 12200 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12201 12202 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 12203 } 12204 } 12205 } catch (NamingException ex) { 12206 throw new RuntimeException(ex); 12207 } 12208 12209 return data; 12210 } 12211 12212 @GraphQLField 12213 @GraphQLName("shippingMethod") 12214 static ShippingMethodObject shippingMethod(final DataFetchingEnvironment env, 12215 @GraphQLName("shippingMethodName") final String shippingMethodName, 12216 @GraphQLName("id") @GraphQLID final String id) { 12217 ShippingMethod shippingMethod; 12218 12219 try { 12220 var commandForm = ShippingUtil.getHome().getGetShippingMethodForm(); 12221 12222 commandForm.setShippingMethodName(shippingMethodName); 12223 commandForm.setUuid(id); 12224 12225 shippingMethod = CDI.current().select(GetShippingMethodCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12226 } catch (NamingException ex) { 12227 throw new RuntimeException(ex); 12228 } 12229 12230 return shippingMethod == null ? null : new ShippingMethodObject(shippingMethod); 12231 } 12232 12233 @GraphQLField 12234 @GraphQLName("shippingMethods") 12235 @GraphQLNonNull 12236 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12237 static CountingPaginatedData<ShippingMethodObject> shippingMethods(final DataFetchingEnvironment env) { 12238 CountingPaginatedData<ShippingMethodObject> data; 12239 12240 try { 12241 var shippingControl = Session.getModelController(ShippingControl.class); 12242 var totalCount = shippingControl.countShippingMethods(); 12243 12244 try(var objectLimiter = new ObjectLimiter(env, ShippingMethodConstants.COMPONENT_VENDOR_NAME, ShippingMethodConstants.ENTITY_TYPE_NAME, totalCount)) { 12245 var commandForm = ShippingUtil.getHome().getGetShippingMethodsForm(); 12246 var entities = CDI.current().select(GetShippingMethodsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12247 12248 if(entities == null) { 12249 data = Connections.emptyConnection(); 12250 } else { 12251 var shippingMethods = entities.stream().map(ShippingMethodObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12252 12253 data = new CountedObjects<>(objectLimiter, shippingMethods); 12254 } 12255 } 12256 } catch (NamingException ex) { 12257 throw new RuntimeException(ex); 12258 } 12259 12260 return data; 12261 } 12262 12263 @GraphQLField 12264 @GraphQLName("transactionTimeType") 12265 static TransactionTimeTypeObject transactionTimeType(final DataFetchingEnvironment env, 12266 @GraphQLName("transactionTimeTypeName") final String transactionTimeTypeName, 12267 @GraphQLName("id") @GraphQLID final String id) { 12268 TransactionTimeType transactionTimeType; 12269 12270 try { 12271 var commandForm = AccountingUtil.getHome().getGetTransactionTimeTypeForm(); 12272 12273 commandForm.setTransactionTimeTypeName(transactionTimeTypeName); 12274 commandForm.setUuid(id); 12275 12276 transactionTimeType = CDI.current().select(GetTransactionTimeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12277 } catch (NamingException ex) { 12278 throw new RuntimeException(ex); 12279 } 12280 12281 return transactionTimeType == null ? null : new TransactionTimeTypeObject(transactionTimeType); 12282 } 12283 12284 @GraphQLField 12285 @GraphQLName("transactionTimeTypes") 12286 @GraphQLNonNull 12287 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12288 static CountingPaginatedData<TransactionTimeTypeObject> transactionTimeTypes(final DataFetchingEnvironment env) { 12289 CountingPaginatedData<TransactionTimeTypeObject> data; 12290 12291 try { 12292 var commandForm = AccountingUtil.getHome().getGetTransactionTimeTypesForm(); 12293 var command = CDI.current().select(GetTransactionTimeTypesCommand.class).get(); 12294 12295 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12296 if(totalEntities == null) { 12297 data = Connections.emptyConnection(); 12298 } else { 12299 try(var objectLimiter = new ObjectLimiter(env, TransactionTimeTypeConstants.COMPONENT_VENDOR_NAME, TransactionTimeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12300 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12301 12302 var transactionTimeTypes = entities.stream() 12303 .map(TransactionTimeTypeObject::new) 12304 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12305 12306 data = new CountedObjects<>(objectLimiter, transactionTimeTypes); 12307 } 12308 } 12309 } catch (NamingException ex) { 12310 throw new RuntimeException(ex); 12311 } 12312 12313 return data; 12314 } 12315 12316 @GraphQLField 12317 @GraphQLName("transactionType") 12318 static TransactionTypeObject transactionType(final DataFetchingEnvironment env, 12319 @GraphQLName("transactionTypeName") final String transactionTypeName, 12320 @GraphQLName("id") @GraphQLID final String id) { 12321 TransactionType transactionType; 12322 12323 try { 12324 var commandForm = AccountingUtil.getHome().getGetTransactionTypeForm(); 12325 12326 commandForm.setTransactionTypeName(transactionTypeName); 12327 commandForm.setUuid(id); 12328 12329 transactionType = CDI.current().select(GetTransactionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12330 } catch (NamingException ex) { 12331 throw new RuntimeException(ex); 12332 } 12333 12334 return transactionType == null ? null : new TransactionTypeObject(transactionType); 12335 } 12336 12337 @GraphQLField 12338 @GraphQLName("transactionTypes") 12339 @GraphQLNonNull 12340 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12341 static CountingPaginatedData<TransactionTypeObject> transactionTypes(final DataFetchingEnvironment env) { 12342 CountingPaginatedData<TransactionTypeObject> data; 12343 12344 try { 12345 var commandForm = AccountingUtil.getHome().getGetTransactionTypesForm(); 12346 var command = CDI.current().select(GetTransactionTypesCommand.class).get(); 12347 12348 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12349 if(totalEntities == null) { 12350 data = Connections.emptyConnection(); 12351 } else { 12352 try(var objectLimiter = new ObjectLimiter(env, TransactionTypeConstants.COMPONENT_VENDOR_NAME, TransactionTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12353 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12354 12355 var transactionTypes = entities.stream() 12356 .map(TransactionTypeObject::new) 12357 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12358 12359 data = new CountedObjects<>(objectLimiter, transactionTypes); 12360 } 12361 } 12362 } catch (NamingException ex) { 12363 throw new RuntimeException(ex); 12364 } 12365 12366 return data; 12367 } 12368 12369 @GraphQLField 12370 @GraphQLName("transactionGlAccountCategory") 12371 static TransactionGlAccountCategoryObject transactionGlAccountCategory(final DataFetchingEnvironment env, 12372 @GraphQLName("transactionTypeName") final String transactionTypeName, 12373 @GraphQLName("transactionGlAccountCategoryName") final String transactionGlAccountCategoryName, 12374 @GraphQLName("id") @GraphQLID final String id) { 12375 TransactionGlAccountCategory transactionGlAccountCategory; 12376 12377 try { 12378 var commandForm = AccountingUtil.getHome().getGetTransactionGlAccountCategoryForm(); 12379 12380 commandForm.setTransactionTypeName(transactionTypeName); 12381 commandForm.setTransactionGlAccountCategoryName(transactionGlAccountCategoryName); 12382 commandForm.setUuid(id); 12383 12384 transactionGlAccountCategory = CDI.current().select(GetTransactionGlAccountCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12385 } catch (NamingException ex) { 12386 throw new RuntimeException(ex); 12387 } 12388 12389 return transactionGlAccountCategory == null ? null : new TransactionGlAccountCategoryObject(transactionGlAccountCategory); 12390 } 12391 12392 @GraphQLField 12393 @GraphQLName("transactionGlAccountCategories") 12394 @GraphQLNonNull 12395 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12396 static CountingPaginatedData<TransactionGlAccountCategoryObject> transactionGlAccountCategories(final DataFetchingEnvironment env, 12397 @GraphQLName("transactionTypeName") final String transactionTypeName) { 12398 CountingPaginatedData<TransactionGlAccountCategoryObject> data; 12399 12400 try { 12401 var commandForm = AccountingUtil.getHome().getGetTransactionGlAccountCategoriesForm(); 12402 var command = CDI.current().select(GetTransactionGlAccountCategoriesCommand.class).get(); 12403 12404 commandForm.setTransactionTypeName(transactionTypeName); 12405 12406 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12407 if(totalEntities == null) { 12408 data = Connections.emptyConnection(); 12409 } else { 12410 try(var objectLimiter = new ObjectLimiter(env, TransactionGlAccountCategoryConstants.COMPONENT_VENDOR_NAME, TransactionGlAccountCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 12411 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12412 12413 var transactionGlAccountCategories = entities.stream() 12414 .map(TransactionGlAccountCategoryObject::new) 12415 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12416 12417 data = new CountedObjects<>(objectLimiter, transactionGlAccountCategories); 12418 } 12419 } 12420 } catch (NamingException ex) { 12421 throw new RuntimeException(ex); 12422 } 12423 12424 return data; 12425 } 12426 12427 @GraphQLField 12428 @GraphQLName("transactionEntityRoleType") 12429 static TransactionEntityRoleTypeObject transactionEntityRoleType(final DataFetchingEnvironment env, 12430 @GraphQLName("transactionTypeName") final String transactionTypeName, 12431 @GraphQLName("transactionEntityRoleTypeName") final String transactionEntityRoleTypeName, 12432 @GraphQLName("id") @GraphQLID final String id) { 12433 TransactionEntityRoleType transactionEntityRoleType; 12434 12435 try { 12436 var commandForm = AccountingUtil.getHome().getGetTransactionEntityRoleTypeForm(); 12437 12438 commandForm.setTransactionTypeName(transactionTypeName); 12439 commandForm.setTransactionEntityRoleTypeName(transactionEntityRoleTypeName); 12440 commandForm.setUuid(id); 12441 12442 transactionEntityRoleType = CDI.current().select(GetTransactionEntityRoleTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12443 } catch (NamingException ex) { 12444 throw new RuntimeException(ex); 12445 } 12446 12447 return transactionEntityRoleType == null ? null : new TransactionEntityRoleTypeObject(transactionEntityRoleType); 12448 } 12449 12450 @GraphQLField 12451 @GraphQLName("transactionEntityRoleTypes") 12452 @GraphQLNonNull 12453 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12454 static CountingPaginatedData<TransactionEntityRoleTypeObject> transactionEntityRoleTypes(final DataFetchingEnvironment env, 12455 @GraphQLName("transactionTypeName") final String transactionTypeName) { 12456 CountingPaginatedData<TransactionEntityRoleTypeObject> data; 12457 12458 try { 12459 var commandForm = AccountingUtil.getHome().getGetTransactionEntityRoleTypesForm(); 12460 var command = CDI.current().select(GetTransactionEntityRoleTypesCommand.class).get(); 12461 12462 commandForm.setTransactionTypeName(transactionTypeName); 12463 12464 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12465 if(totalEntities == null) { 12466 data = Connections.emptyConnection(); 12467 } else { 12468 try(var objectLimiter = new ObjectLimiter(env, TransactionEntityRoleTypeConstants.COMPONENT_VENDOR_NAME, TransactionEntityRoleTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12469 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12470 12471 var transactionEntityRoleTypes = entities.stream() 12472 .map(TransactionEntityRoleTypeObject::new) 12473 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12474 12475 data = new CountedObjects<>(objectLimiter, transactionEntityRoleTypes); 12476 } 12477 } 12478 } catch (NamingException ex) { 12479 throw new RuntimeException(ex); 12480 } 12481 12482 return data; 12483 } 12484 12485 @GraphQLField 12486 @GraphQLName("transactionGroup") 12487 static TransactionGroupObject transactionGroup(final DataFetchingEnvironment env, 12488 @GraphQLName("transactionGroupName") final String transactionGroupName, 12489 @GraphQLName("id") @GraphQLID final String id) { 12490 TransactionGroup transactionGroup; 12491 12492 try { 12493 var commandForm = AccountingUtil.getHome().getGetTransactionGroupForm(); 12494 12495 commandForm.setTransactionGroupName(transactionGroupName); 12496 commandForm.setUuid(id); 12497 12498 transactionGroup = CDI.current().select(GetTransactionGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12499 } catch (NamingException ex) { 12500 throw new RuntimeException(ex); 12501 } 12502 12503 return transactionGroup == null ? null : new TransactionGroupObject(transactionGroup); 12504 } 12505 12506 @GraphQLField 12507 @GraphQLName("transactionGroups") 12508 @GraphQLNonNull 12509 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12510 static CountingPaginatedData<TransactionGroupObject> transactionGroups(final DataFetchingEnvironment env) { 12511 CountingPaginatedData<TransactionGroupObject> data; 12512 12513 try { 12514 var commandForm = AccountingUtil.getHome().getGetTransactionGroupsForm(); 12515 var command = CDI.current().select(GetTransactionGroupsCommand.class).get(); 12516 12517 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12518 if(totalEntities == null) { 12519 data = Connections.emptyConnection(); 12520 } else { 12521 try(var objectLimiter = new ObjectLimiter(env, TransactionGroupConstants.COMPONENT_VENDOR_NAME, TransactionGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 12522 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12523 12524 var transactionGroups = entities.stream() 12525 .map(TransactionGroupObject::new) 12526 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12527 12528 data = new CountedObjects<>(objectLimiter, transactionGroups); 12529 } 12530 } 12531 } catch (NamingException ex) { 12532 throw new RuntimeException(ex); 12533 } 12534 12535 return data; 12536 } 12537 12538 @GraphQLField 12539 @GraphQLName("transaction") 12540 static TransactionObject transaction(final DataFetchingEnvironment env, 12541 @GraphQLName("transactionName") final String transactionName, 12542 @GraphQLName("id") @GraphQLID final String id) { 12543 Transaction transaction; 12544 12545 try { 12546 var commandForm = AccountingUtil.getHome().getGetTransactionForm(); 12547 12548 commandForm.setTransactionName(transactionName); 12549 commandForm.setUuid(id); 12550 12551 transaction = CDI.current().select(GetTransactionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12552 } catch (NamingException ex) { 12553 throw new RuntimeException(ex); 12554 } 12555 12556 return transaction == null ? null : new TransactionObject(transaction); 12557 } 12558 12559 @GraphQLField 12560 @GraphQLName("transactions") 12561 @GraphQLNonNull 12562 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12563 static CountingPaginatedData<TransactionObject> transactions(final DataFetchingEnvironment env, 12564 @GraphQLName("transactionGroupName") final String transactionGroupName) { 12565 CountingPaginatedData<TransactionObject> data; 12566 12567 try { 12568 var commandForm = AccountingUtil.getHome().getGetTransactionsForm(); 12569 var command = CDI.current().select(GetTransactionsCommand.class).get(); 12570 12571 commandForm.setTransactionGroupName(transactionGroupName); 12572 12573 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12574 if(totalEntities == null) { 12575 data = Connections.emptyConnection(); 12576 } else { 12577 try(var objectLimiter = new ObjectLimiter(env, TransactionConstants.COMPONENT_VENDOR_NAME, TransactionConstants.ENTITY_TYPE_NAME, totalEntities)) { 12578 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12579 12580 var transactions = entities.stream() 12581 .map(TransactionObject::new) 12582 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12583 12584 data = new CountedObjects<>(objectLimiter, transactions); 12585 } 12586 } 12587 } catch (NamingException ex) { 12588 throw new RuntimeException(ex); 12589 } 12590 12591 return data; 12592 } 12593 12594}