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.GetFilterKindCommand; 140import com.echothree.control.user.filter.server.command.GetFilterKindsCommand; 141import com.echothree.control.user.filter.server.command.GetFilterEntranceStepCommand; 142import com.echothree.control.user.filter.server.command.GetFilterEntranceStepsCommand; 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.OfferNameElementConstants; 874import com.echothree.model.data.offer.common.UseConstants; 875import com.echothree.model.data.offer.common.UseNameElementConstants; 876import com.echothree.model.data.offer.common.UseTypeConstants; 877import com.echothree.model.data.offer.server.entity.Offer; 878import com.echothree.model.data.offer.server.entity.OfferItem; 879import com.echothree.model.data.offer.server.entity.OfferItemPrice; 880import com.echothree.model.data.offer.server.entity.OfferNameElement; 881import com.echothree.model.data.offer.server.entity.OfferUse; 882import com.echothree.model.data.offer.server.entity.Use; 883import com.echothree.model.data.offer.server.entity.UseNameElement; 884import com.echothree.model.data.offer.server.entity.UseType; 885import com.echothree.model.data.order.common.OrderPriorityConstants; 886import com.echothree.model.data.order.common.OrderTimeTypeConstants; 887import com.echothree.model.data.order.common.OrderTypeConstants; 888import com.echothree.model.data.order.server.entity.OrderPriority; 889import com.echothree.model.data.order.server.entity.OrderTimeType; 890import com.echothree.model.data.order.server.entity.OrderType; 891import com.echothree.model.data.party.common.DateTimeFormatConstants; 892import com.echothree.model.data.party.common.LanguageConstants; 893import com.echothree.model.data.party.common.NameSuffixConstants; 894import com.echothree.model.data.party.common.PartyCompanyConstants; 895import com.echothree.model.data.party.common.PartyConstants; 896import com.echothree.model.data.party.common.PartyTypeConstants; 897import com.echothree.model.data.party.common.PersonalTitleConstants; 898import com.echothree.model.data.party.common.RoleTypeConstants; 899import com.echothree.model.data.party.common.TimeZoneConstants; 900import com.echothree.model.data.party.server.entity.DateTimeFormat; 901import com.echothree.model.data.party.server.entity.Language; 902import com.echothree.model.data.party.server.entity.Party; 903import com.echothree.model.data.party.server.entity.PartyAlias; 904import com.echothree.model.data.party.server.entity.PartyAliasType; 905import com.echothree.model.data.party.server.entity.PartyCompany; 906import com.echothree.model.data.party.server.entity.PartyDepartment; 907import com.echothree.model.data.party.server.entity.PartyDivision; 908import com.echothree.model.data.party.server.entity.PartyType; 909import com.echothree.model.data.party.server.entity.RoleType; 910import com.echothree.model.data.party.server.entity.TimeZone; 911import com.echothree.model.data.payment.common.PaymentMethodTypeConstants; 912import com.echothree.model.data.payment.common.PaymentProcessorConstants; 913import com.echothree.model.data.payment.common.PaymentProcessorTypeConstants; 914import com.echothree.model.data.payment.server.entity.PaymentMethodType; 915import com.echothree.model.data.payment.server.entity.PaymentProcessor; 916import com.echothree.model.data.payment.server.entity.PaymentProcessorActionType; 917import com.echothree.model.data.payment.server.entity.PaymentProcessorResultCode; 918import com.echothree.model.data.payment.server.entity.PaymentProcessorTransaction; 919import com.echothree.model.data.payment.server.entity.PaymentProcessorType; 920import com.echothree.model.data.payment.server.entity.PaymentProcessorTypeCode; 921import com.echothree.model.data.payment.server.entity.PaymentProcessorTypeCodeType; 922import com.echothree.model.data.queue.common.QueueTypeConstants; 923import com.echothree.model.data.queue.server.entity.QueueType; 924import com.echothree.model.data.returnpolicy.common.ReturnKindConstants; 925import com.echothree.model.data.returnpolicy.common.ReturnPolicyConstants; 926import com.echothree.model.data.returnpolicy.server.entity.ReturnKind; 927import com.echothree.model.data.returnpolicy.server.entity.ReturnPolicy; 928import com.echothree.model.data.search.common.SearchCheckSpellingActionTypeConstants; 929import com.echothree.model.data.search.common.SearchDefaultOperatorConstants; 930import com.echothree.model.data.search.common.SearchKindConstants; 931import com.echothree.model.data.search.common.SearchResultActionTypeConstants; 932import com.echothree.model.data.search.common.SearchSortDirectionConstants; 933import com.echothree.model.data.search.common.SearchSortOrderConstants; 934import com.echothree.model.data.search.common.SearchTypeConstants; 935import com.echothree.model.data.search.common.SearchUseTypeConstants; 936import com.echothree.model.data.search.server.entity.SearchCheckSpellingActionType; 937import com.echothree.model.data.search.server.entity.SearchDefaultOperator; 938import com.echothree.model.data.search.server.entity.SearchKind; 939import com.echothree.model.data.search.server.entity.SearchResultActionType; 940import com.echothree.model.data.search.server.entity.SearchSortDirection; 941import com.echothree.model.data.search.server.entity.SearchSortOrder; 942import com.echothree.model.data.search.server.entity.SearchType; 943import com.echothree.model.data.search.server.entity.SearchUseType; 944import com.echothree.model.data.security.common.SecurityRoleConstants; 945import com.echothree.model.data.security.common.SecurityRoleGroupConstants; 946import com.echothree.model.data.security.server.entity.SecurityRole; 947import com.echothree.model.data.security.server.entity.SecurityRoleGroup; 948import com.echothree.model.data.selector.common.SelectorKindConstants; 949import com.echothree.model.data.selector.server.entity.Selector; 950import com.echothree.model.data.selector.server.entity.SelectorKind; 951import com.echothree.model.data.selector.server.entity.SelectorType; 952import com.echothree.model.data.sequence.common.SequenceChecksumTypeConstants; 953import com.echothree.model.data.sequence.common.SequenceEncoderTypeConstants; 954import com.echothree.model.data.sequence.common.SequenceTypeConstants; 955import com.echothree.model.data.sequence.server.entity.Sequence; 956import com.echothree.model.data.sequence.server.entity.SequenceChecksumType; 957import com.echothree.model.data.sequence.server.entity.SequenceEncoderType; 958import com.echothree.model.data.sequence.server.entity.SequenceType; 959import com.echothree.model.data.shipment.common.FreeOnBoardConstants; 960import com.echothree.model.data.shipment.server.entity.FreeOnBoard; 961import com.echothree.model.data.shipping.common.ShippingMethodConstants; 962import com.echothree.model.data.shipping.server.entity.ShippingMethod; 963import com.echothree.model.data.tag.common.TagConstants; 964import com.echothree.model.data.tag.common.TagScopeConstants; 965import com.echothree.model.data.tag.server.entity.EntityTag; 966import com.echothree.model.data.tag.server.entity.Tag; 967import com.echothree.model.data.tag.server.entity.TagScope; 968import com.echothree.model.data.tag.server.entity.TagScopeEntityType; 969import com.echothree.model.data.term.common.TermConstants; 970import com.echothree.model.data.term.common.TermTypeConstants; 971import com.echothree.model.data.term.server.entity.Term; 972import com.echothree.model.data.term.server.entity.TermType; 973import com.echothree.model.data.uom.common.UnitOfMeasureKindConstants; 974import com.echothree.model.data.uom.common.UnitOfMeasureKindUseTypeConstants; 975import com.echothree.model.data.uom.common.UnitOfMeasureTypeConstants; 976import com.echothree.model.data.uom.server.entity.UnitOfMeasureKind; 977import com.echothree.model.data.uom.server.entity.UnitOfMeasureKindUse; 978import com.echothree.model.data.uom.server.entity.UnitOfMeasureKindUseType; 979import com.echothree.model.data.uom.server.entity.UnitOfMeasureType; 980import com.echothree.model.data.user.common.RecoveryQuestionConstants; 981import com.echothree.model.data.user.common.UserVisitGroupConstants; 982import com.echothree.model.data.user.server.entity.RecoveryQuestion; 983import com.echothree.model.data.user.server.entity.UserLogin; 984import com.echothree.model.data.user.server.entity.UserVisitGroup; 985import com.echothree.model.data.vendor.common.ItemPurchasingCategoryConstants; 986import com.echothree.model.data.vendor.common.VendorConstants; 987import com.echothree.model.data.vendor.common.VendorTypeConstants; 988import com.echothree.model.data.vendor.server.entity.ItemPurchasingCategory; 989import com.echothree.model.data.vendor.server.entity.Vendor; 990import com.echothree.model.data.vendor.server.entity.VendorItem; 991import com.echothree.model.data.vendor.server.entity.VendorItemCost; 992import com.echothree.model.data.vendor.server.entity.VendorType; 993import com.echothree.model.data.warehouse.common.LocationConstants; 994import com.echothree.model.data.warehouse.common.LocationNameElementConstants; 995import com.echothree.model.data.warehouse.common.LocationTypeConstants; 996import com.echothree.model.data.warehouse.common.LocationUseTypeConstants; 997import com.echothree.model.data.warehouse.common.WarehouseConstants; 998import com.echothree.model.data.warehouse.common.WarehouseTypeConstants; 999import com.echothree.model.data.warehouse.server.entity.Location; 1000import com.echothree.model.data.warehouse.server.entity.LocationNameElement; 1001import com.echothree.model.data.warehouse.server.entity.LocationType; 1002import com.echothree.model.data.warehouse.server.entity.LocationUseType; 1003import com.echothree.model.data.warehouse.server.entity.Warehouse; 1004import com.echothree.model.data.warehouse.server.entity.WarehouseType; 1005import com.echothree.model.data.wishlist.common.WishlistPriorityConstants; 1006import com.echothree.model.data.wishlist.common.WishlistTypeConstants; 1007import com.echothree.model.data.wishlist.server.entity.WishlistPriority; 1008import com.echothree.model.data.wishlist.server.entity.WishlistType; 1009import com.echothree.model.data.workflow.common.WorkflowConstants; 1010import com.echothree.model.data.workflow.common.WorkflowDestinationConstants; 1011import com.echothree.model.data.workflow.common.WorkflowDestinationPartyTypeConstants; 1012import com.echothree.model.data.workflow.common.WorkflowDestinationSecurityRoleConstants; 1013import com.echothree.model.data.workflow.common.WorkflowDestinationSelectorConstants; 1014import com.echothree.model.data.workflow.common.WorkflowDestinationStepConstants; 1015import com.echothree.model.data.workflow.common.WorkflowEntityStatusConstants; 1016import com.echothree.model.data.workflow.common.WorkflowEntityTypeConstants; 1017import com.echothree.model.data.workflow.common.WorkflowEntranceConstants; 1018import com.echothree.model.data.workflow.common.WorkflowEntrancePartyTypeConstants; 1019import com.echothree.model.data.workflow.common.WorkflowEntranceSecurityRoleConstants; 1020import com.echothree.model.data.workflow.common.WorkflowEntranceSelectorConstants; 1021import com.echothree.model.data.workflow.common.WorkflowEntranceStepConstants; 1022import com.echothree.model.data.workflow.common.WorkflowSelectorKindConstants; 1023import com.echothree.model.data.workflow.common.WorkflowStepConstants; 1024import com.echothree.model.data.workflow.common.WorkflowStepTypeConstants; 1025import com.echothree.model.data.workflow.server.entity.Workflow; 1026import com.echothree.model.data.workflow.server.entity.WorkflowDestination; 1027import com.echothree.model.data.workflow.server.entity.WorkflowDestinationPartyType; 1028import com.echothree.model.data.workflow.server.entity.WorkflowDestinationSecurityRole; 1029import com.echothree.model.data.workflow.server.entity.WorkflowDestinationSelector; 1030import com.echothree.model.data.workflow.server.entity.WorkflowDestinationStep; 1031import com.echothree.model.data.workflow.server.entity.WorkflowEntityType; 1032import com.echothree.model.data.workflow.server.entity.WorkflowEntrance; 1033import com.echothree.model.data.workflow.server.entity.WorkflowEntrancePartyType; 1034import com.echothree.model.data.workflow.server.entity.WorkflowEntranceSecurityRole; 1035import com.echothree.model.data.workflow.server.entity.WorkflowEntranceSelector; 1036import com.echothree.model.data.workflow.server.entity.WorkflowEntranceStep; 1037import com.echothree.model.data.workflow.server.entity.WorkflowSelectorKind; 1038import com.echothree.model.data.workflow.server.entity.WorkflowStep; 1039import com.echothree.model.data.workflow.server.entity.WorkflowStepType; 1040import com.echothree.util.server.persistence.Session; 1041import graphql.annotations.annotationTypes.GraphQLField; 1042import graphql.annotations.annotationTypes.GraphQLID; 1043import graphql.annotations.annotationTypes.GraphQLName; 1044import graphql.annotations.annotationTypes.GraphQLNonNull; 1045import graphql.annotations.connection.GraphQLConnection; 1046import graphql.schema.DataFetchingEnvironment; 1047import java.util.ArrayList; 1048import java.util.Collection; 1049import static java.util.Collections.emptyList; 1050import java.util.stream.Collectors; 1051import javax.enterprise.inject.spi.CDI; 1052import javax.naming.NamingException; 1053 1054@GraphQLName("query") 1055public interface GraphQlQueries { 1056 1057 @GraphQLField 1058 @GraphQLName("searchKind") 1059 static SearchKindObject searchKind(final DataFetchingEnvironment env, 1060 @GraphQLName("searchKindName") final String searchKindName, 1061 @GraphQLName("id") @GraphQLID final String id) { 1062 SearchKind searchKind; 1063 1064 try { 1065 var commandForm = SearchUtil.getHome().getGetSearchKindForm(); 1066 1067 commandForm.setSearchKindName(searchKindName); 1068 commandForm.setUuid(id); 1069 1070 searchKind = CDI.current().select(GetSearchKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1071 } catch (NamingException ex) { 1072 throw new RuntimeException(ex); 1073 } 1074 1075 return searchKind == null ? null : new SearchKindObject(searchKind); 1076 } 1077 1078 @GraphQLField 1079 @GraphQLName("searchKinds") 1080 @GraphQLNonNull 1081 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1082 static CountingPaginatedData<SearchKindObject> searchKinds(final DataFetchingEnvironment env) { 1083 CountingPaginatedData<SearchKindObject> data; 1084 1085 try { 1086 var searchControl = Session.getModelController(SearchControl.class); 1087 var totalCount = searchControl.countSearchKinds(); 1088 1089 try(var objectLimiter = new ObjectLimiter(env, SearchKindConstants.COMPONENT_VENDOR_NAME, SearchKindConstants.ENTITY_TYPE_NAME, totalCount)) { 1090 var commandForm = SearchUtil.getHome().getGetSearchKindsForm(); 1091 var entities = CDI.current().select(GetSearchKindsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1092 1093 if(entities == null) { 1094 data = Connections.emptyConnection(); 1095 } else { 1096 var searchKinds = entities.stream().map(SearchKindObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1097 1098 data = new CountedObjects<>(objectLimiter, searchKinds); 1099 } 1100 } 1101 } catch (NamingException ex) { 1102 throw new RuntimeException(ex); 1103 } 1104 1105 return data; 1106 } 1107 1108 @GraphQLField 1109 @GraphQLName("searchType") 1110 static SearchTypeObject searchType(final DataFetchingEnvironment env, 1111 @GraphQLName("searchKindName") final String searchKindName, 1112 @GraphQLName("searchTypeName") final String searchTypeName, 1113 @GraphQLName("id") @GraphQLID final String id) { 1114 SearchType searchType; 1115 1116 try { 1117 var commandForm = SearchUtil.getHome().getGetSearchTypeForm(); 1118 1119 commandForm.setSearchKindName(searchKindName); 1120 commandForm.setSearchTypeName(searchTypeName); 1121 commandForm.setUuid(id); 1122 1123 searchType = CDI.current().select(GetSearchTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1124 } catch (NamingException ex) { 1125 throw new RuntimeException(ex); 1126 } 1127 1128 return searchType == null ? null : new SearchTypeObject(searchType); 1129 } 1130 1131 @GraphQLField 1132 @GraphQLName("searchTypes") 1133 @GraphQLNonNull 1134 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1135 static CountingPaginatedData<SearchTypeObject> searchTypes(final DataFetchingEnvironment env, 1136 @GraphQLName("searchKindName") @GraphQLNonNull final String searchKindName) { 1137 CountingPaginatedData<SearchTypeObject> data; 1138 1139 try { 1140 var commandForm = SearchUtil.getHome().getGetSearchTypesForm(); 1141 var command = CDI.current().select(GetSearchTypesCommand.class).get(); 1142 1143 commandForm.setSearchKindName(searchKindName); 1144 1145 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1146 if(totalEntities == null) { 1147 data = Connections.emptyConnection(); 1148 } else { 1149 try(var objectLimiter = new ObjectLimiter(env, SearchTypeConstants.COMPONENT_VENDOR_NAME, SearchTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 1150 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1151 1152 var searchTypes = entities.stream() 1153 .map(SearchTypeObject::new) 1154 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1155 1156 data = new CountedObjects<>(objectLimiter, searchTypes); 1157 } 1158 } 1159 } catch (NamingException ex) { 1160 throw new RuntimeException(ex); 1161 } 1162 1163 return data; 1164 } 1165 1166 @GraphQLField 1167 @GraphQLName("searchSortOrder") 1168 static SearchSortOrderObject searchSortOrder(final DataFetchingEnvironment env, 1169 @GraphQLName("searchKindName") final String searchKindName, 1170 @GraphQLName("searchSortOrderName") final String searchSortOrderName, 1171 @GraphQLName("id") @GraphQLID final String id) { 1172 SearchSortOrder searchSortOrder; 1173 1174 try { 1175 var commandForm = SearchUtil.getHome().getGetSearchSortOrderForm(); 1176 1177 commandForm.setSearchKindName(searchKindName); 1178 commandForm.setSearchSortOrderName(searchSortOrderName); 1179 commandForm.setUuid(id); 1180 1181 searchSortOrder = CDI.current().select(GetSearchSortOrderCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1182 } catch (NamingException ex) { 1183 throw new RuntimeException(ex); 1184 } 1185 1186 return searchSortOrder == null ? null : new SearchSortOrderObject(searchSortOrder); 1187 } 1188 1189 @GraphQLField 1190 @GraphQLName("searchSortOrders") 1191 @GraphQLNonNull 1192 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1193 static CountingPaginatedData<SearchSortOrderObject> searchSortOrders(final DataFetchingEnvironment env, 1194 @GraphQLName("searchKindName") @GraphQLNonNull final String searchKindName) { 1195 CountingPaginatedData<SearchSortOrderObject> data; 1196 1197 try { 1198 var commandForm = SearchUtil.getHome().getGetSearchSortOrdersForm(); 1199 var command = CDI.current().select(GetSearchSortOrdersCommand.class).get(); 1200 1201 commandForm.setSearchKindName(searchKindName); 1202 1203 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1204 if(totalEntities == null) { 1205 data = Connections.emptyConnection(); 1206 } else { 1207 try(var objectLimiter = new ObjectLimiter(env, SearchSortOrderConstants.COMPONENT_VENDOR_NAME, SearchSortOrderConstants.ENTITY_TYPE_NAME, totalEntities)) { 1208 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1209 1210 var searchSortOrders = entities.stream() 1211 .map(SearchSortOrderObject::new) 1212 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1213 1214 data = new CountedObjects<>(objectLimiter, searchSortOrders); 1215 } 1216 } 1217 } catch (NamingException ex) { 1218 throw new RuntimeException(ex); 1219 } 1220 1221 return data; 1222 } 1223 1224 @GraphQLField 1225 @GraphQLName("searchUseType") 1226 static SearchUseTypeObject searchUseType(final DataFetchingEnvironment env, 1227 @GraphQLName("searchUseTypeName") final String searchUseTypeName, 1228 @GraphQLName("id") @GraphQLID final String id) { 1229 SearchUseType searchUseType; 1230 1231 try { 1232 var commandForm = SearchUtil.getHome().getGetSearchUseTypeForm(); 1233 1234 commandForm.setSearchUseTypeName(searchUseTypeName); 1235 commandForm.setUuid(id); 1236 1237 searchUseType = CDI.current().select(GetSearchUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1238 } catch (NamingException ex) { 1239 throw new RuntimeException(ex); 1240 } 1241 1242 return searchUseType == null ? null : new SearchUseTypeObject(searchUseType); 1243 } 1244 1245 @GraphQLField 1246 @GraphQLName("searchUseTypes") 1247 @GraphQLNonNull 1248 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1249 static CountingPaginatedData<SearchUseTypeObject> searchUseTypes(final DataFetchingEnvironment env) { 1250 CountingPaginatedData<SearchUseTypeObject> data; 1251 1252 try { 1253 var searchControl = Session.getModelController(SearchControl.class); 1254 var totalCount = searchControl.countSearchUseTypes(); 1255 1256 try(var objectLimiter = new ObjectLimiter(env, SearchUseTypeConstants.COMPONENT_VENDOR_NAME, SearchUseTypeConstants.ENTITY_TYPE_NAME, totalCount)) { 1257 var commandForm = SearchUtil.getHome().getGetSearchUseTypesForm(); 1258 var entities = CDI.current().select(GetSearchUseTypesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1259 1260 if(entities == null) { 1261 data = Connections.emptyConnection(); 1262 } else { 1263 var searchUseTypes = entities.stream().map(SearchUseTypeObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1264 1265 data = new CountedObjects<>(objectLimiter, searchUseTypes); 1266 } 1267 } 1268 } catch (NamingException ex) { 1269 throw new RuntimeException(ex); 1270 } 1271 1272 return data; 1273 } 1274 1275 @GraphQLField 1276 @GraphQLName("searchDefaultOperator") 1277 static SearchDefaultOperatorObject searchDefaultOperator(final DataFetchingEnvironment env, 1278 @GraphQLName("searchDefaultOperatorName") final String searchDefaultOperatorName, 1279 @GraphQLName("id") @GraphQLID final String id) { 1280 SearchDefaultOperator searchDefaultOperator; 1281 1282 try { 1283 var commandForm = SearchUtil.getHome().getGetSearchDefaultOperatorForm(); 1284 1285 commandForm.setSearchDefaultOperatorName(searchDefaultOperatorName); 1286 commandForm.setUuid(id); 1287 1288 searchDefaultOperator = CDI.current().select(GetSearchDefaultOperatorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1289 } catch (NamingException ex) { 1290 throw new RuntimeException(ex); 1291 } 1292 1293 return searchDefaultOperator == null ? null : new SearchDefaultOperatorObject(searchDefaultOperator); 1294 } 1295 1296 @GraphQLField 1297 @GraphQLName("searchDefaultOperators") 1298 @GraphQLNonNull 1299 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1300 static CountingPaginatedData<SearchDefaultOperatorObject> searchDefaultOperators(final DataFetchingEnvironment env) { 1301 CountingPaginatedData<SearchDefaultOperatorObject> data; 1302 1303 try { 1304 var searchControl = Session.getModelController(SearchControl.class); 1305 var totalCount = searchControl.countSearchDefaultOperators(); 1306 1307 try(var objectLimiter = new ObjectLimiter(env, SearchDefaultOperatorConstants.COMPONENT_VENDOR_NAME, SearchDefaultOperatorConstants.ENTITY_TYPE_NAME, totalCount)) { 1308 var commandForm = SearchUtil.getHome().getGetSearchDefaultOperatorsForm(); 1309 var entities = CDI.current().select(GetSearchDefaultOperatorsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1310 1311 if(entities == null) { 1312 data = Connections.emptyConnection(); 1313 } else { 1314 var searchDefaultOperators = entities.stream().map(SearchDefaultOperatorObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1315 1316 data = new CountedObjects<>(objectLimiter, searchDefaultOperators); 1317 } 1318 } 1319 } catch (NamingException ex) { 1320 throw new RuntimeException(ex); 1321 } 1322 1323 return data; 1324 } 1325 1326 @GraphQLField 1327 @GraphQLName("searchSortDirection") 1328 static SearchSortDirectionObject searchSortDirection(final DataFetchingEnvironment env, 1329 @GraphQLName("searchSortDirectionName") final String searchSortDirectionName, 1330 @GraphQLName("id") @GraphQLID final String id) { 1331 SearchSortDirection searchSortDirection; 1332 1333 try { 1334 var commandForm = SearchUtil.getHome().getGetSearchSortDirectionForm(); 1335 1336 commandForm.setSearchSortDirectionName(searchSortDirectionName); 1337 commandForm.setUuid(id); 1338 1339 searchSortDirection = CDI.current().select(GetSearchSortDirectionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1340 } catch (NamingException ex) { 1341 throw new RuntimeException(ex); 1342 } 1343 1344 return searchSortDirection == null ? null : new SearchSortDirectionObject(searchSortDirection); 1345 } 1346 1347 @GraphQLField 1348 @GraphQLName("searchSortDirections") 1349 @GraphQLNonNull 1350 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1351 static CountingPaginatedData<SearchSortDirectionObject> searchSortDirections(final DataFetchingEnvironment env) { 1352 CountingPaginatedData<SearchSortDirectionObject> data; 1353 1354 try { 1355 var searchControl = Session.getModelController(SearchControl.class); 1356 var totalCount = searchControl.countSearchSortDirections(); 1357 1358 try(var objectLimiter = new ObjectLimiter(env, SearchSortDirectionConstants.COMPONENT_VENDOR_NAME, SearchSortDirectionConstants.ENTITY_TYPE_NAME, totalCount)) { 1359 var commandForm = SearchUtil.getHome().getGetSearchSortDirectionsForm(); 1360 var entities = CDI.current().select(GetSearchSortDirectionsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1361 1362 if(entities == null) { 1363 data = Connections.emptyConnection(); 1364 } else { 1365 var searchSortDirections = entities.stream().map(SearchSortDirectionObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1366 1367 data = new CountedObjects<>(objectLimiter, searchSortDirections); 1368 } 1369 } 1370 } catch (NamingException ex) { 1371 throw new RuntimeException(ex); 1372 } 1373 1374 return data; 1375 } 1376 1377 @GraphQLField 1378 @GraphQLName("searchResultActionType") 1379 static SearchResultActionTypeObject searchResultActionType(final DataFetchingEnvironment env, 1380 @GraphQLName("searchResultActionTypeName") final String searchResultActionTypeName, 1381 @GraphQLName("id") @GraphQLID final String id) { 1382 SearchResultActionType searchResultActionType; 1383 1384 try { 1385 var commandForm = SearchUtil.getHome().getGetSearchResultActionTypeForm(); 1386 1387 commandForm.setSearchResultActionTypeName(searchResultActionTypeName); 1388 commandForm.setUuid(id); 1389 1390 searchResultActionType = CDI.current().select(GetSearchResultActionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1391 } catch (NamingException ex) { 1392 throw new RuntimeException(ex); 1393 } 1394 1395 return searchResultActionType == null ? null : new SearchResultActionTypeObject(searchResultActionType); 1396 } 1397 1398 @GraphQLField 1399 @GraphQLName("searchResultActionTypes") 1400 @GraphQLNonNull 1401 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1402 static CountingPaginatedData<SearchResultActionTypeObject> searchResultActionTypes(final DataFetchingEnvironment env) { 1403 CountingPaginatedData<SearchResultActionTypeObject> data; 1404 1405 try { 1406 var commandForm = SearchUtil.getHome().getGetSearchResultActionTypesForm(); 1407 var command = CDI.current().select(GetSearchResultActionTypesCommand.class).get(); 1408 1409 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1410 if(totalEntities == null) { 1411 data = Connections.emptyConnection(); 1412 } else { 1413 try(var objectLimiter = new ObjectLimiter(env, SearchResultActionTypeConstants.COMPONENT_VENDOR_NAME, SearchResultActionTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 1414 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1415 1416 var searchResultActionTypes = entities.stream() 1417 .map(SearchResultActionTypeObject::new) 1418 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1419 1420 data = new CountedObjects<>(objectLimiter, searchResultActionTypes); 1421 } 1422 } 1423 } catch (NamingException ex) { 1424 throw new RuntimeException(ex); 1425 } 1426 1427 return data; 1428 } 1429 1430 @GraphQLField 1431 @GraphQLName("searchCheckSpellingActionType") 1432 static SearchCheckSpellingActionTypeObject searchCheckSpellingActionType(final DataFetchingEnvironment env, 1433 @GraphQLName("searchCheckSpellingActionTypeName") final String searchCheckSpellingActionTypeName, 1434 @GraphQLName("id") @GraphQLID final String id) { 1435 SearchCheckSpellingActionType searchCheckSpellingActionType; 1436 1437 try { 1438 var commandForm = SearchUtil.getHome().getGetSearchCheckSpellingActionTypeForm(); 1439 1440 commandForm.setSearchCheckSpellingActionTypeName(searchCheckSpellingActionTypeName); 1441 commandForm.setUuid(id); 1442 1443 searchCheckSpellingActionType = CDI.current().select(GetSearchCheckSpellingActionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1444 } catch (NamingException ex) { 1445 throw new RuntimeException(ex); 1446 } 1447 1448 return searchCheckSpellingActionType == null ? null : new SearchCheckSpellingActionTypeObject(searchCheckSpellingActionType); 1449 } 1450 1451 @GraphQLField 1452 @GraphQLName("searchCheckSpellingActionTypes") 1453 @GraphQLNonNull 1454 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1455 static CountingPaginatedData<SearchCheckSpellingActionTypeObject> searchCheckSpellingActionTypes(final DataFetchingEnvironment env) { 1456 CountingPaginatedData<SearchCheckSpellingActionTypeObject> data; 1457 1458 try { 1459 var commandForm = SearchUtil.getHome().getGetSearchCheckSpellingActionTypesForm(); 1460 var command = CDI.current().select(GetSearchCheckSpellingActionTypesCommand.class).get(); 1461 1462 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1463 if(totalEntities == null) { 1464 data = Connections.emptyConnection(); 1465 } else { 1466 try(var objectLimiter = new ObjectLimiter(env, SearchCheckSpellingActionTypeConstants.COMPONENT_VENDOR_NAME, SearchCheckSpellingActionTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 1467 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1468 1469 var searchCheckSpellingActionTypes = entities.stream() 1470 .map(SearchCheckSpellingActionTypeObject::new) 1471 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1472 1473 data = new CountedObjects<>(objectLimiter, searchCheckSpellingActionTypes); 1474 } 1475 } 1476 } catch (NamingException ex) { 1477 throw new RuntimeException(ex); 1478 } 1479 1480 return data; 1481 } 1482 1483 @GraphQLField 1484 @GraphQLName("workflow") 1485 static WorkflowObject workflow(final DataFetchingEnvironment env, 1486 @GraphQLName("workflowName") final String workflowName, 1487 @GraphQLName("id") @GraphQLID final String id) { 1488 Workflow workflow; 1489 1490 try { 1491 var commandForm = WorkflowUtil.getHome().getGetWorkflowForm(); 1492 1493 commandForm.setWorkflowName(workflowName); 1494 commandForm.setUuid(id); 1495 1496 workflow = CDI.current().select(GetWorkflowCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1497 } catch (NamingException ex) { 1498 throw new RuntimeException(ex); 1499 } 1500 1501 return workflow == null ? null : new WorkflowObject(workflow); 1502 } 1503 1504 @GraphQLField 1505 @GraphQLName("workflows") 1506 @GraphQLNonNull 1507 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1508 static CountingPaginatedData<WorkflowObject> workflows(final DataFetchingEnvironment env, 1509 @GraphQLName("selectorKindName") final String selectorKindName) { 1510 CountingPaginatedData<WorkflowObject> data; 1511 1512 try { 1513 var commandForm = WorkflowUtil.getHome().getGetWorkflowsForm(); 1514 var command = CDI.current().select(GetWorkflowsCommand.class).get(); 1515 1516 commandForm.setSelectorKindName(selectorKindName); 1517 1518 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1519 if(totalEntities == null) { 1520 data = Connections.emptyConnection(); 1521 } else { 1522 try(var objectLimiter = new ObjectLimiter(env, WorkflowConstants.COMPONENT_VENDOR_NAME, WorkflowConstants.ENTITY_TYPE_NAME, totalEntities)) { 1523 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1524 1525 var workflows = entities.stream() 1526 .map(WorkflowObject::new) 1527 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1528 1529 data = new CountedObjects<>(objectLimiter, workflows); 1530 } 1531 } 1532 } catch (NamingException ex) { 1533 throw new RuntimeException(ex); 1534 } 1535 1536 return data; 1537 } 1538 1539 @GraphQLField 1540 @GraphQLName("workflowEntityType") 1541 static WorkflowEntityTypeObject workflowEntityType(final DataFetchingEnvironment env, 1542 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1543 @GraphQLName("componentVendorName") @GraphQLNonNull final String componentVendorName, 1544 @GraphQLName("entityTypeName") @GraphQLNonNull final String entityTypeName) { 1545 WorkflowEntityType workflowEntityType; 1546 1547 try { 1548 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntityTypeForm(); 1549 1550 commandForm.setWorkflowName(workflowName); 1551 commandForm.setComponentVendorName(componentVendorName); 1552 commandForm.setEntityTypeName(entityTypeName); 1553 1554 workflowEntityType = CDI.current().select(GetWorkflowEntityTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1555 } catch (NamingException ex) { 1556 throw new RuntimeException(ex); 1557 } 1558 1559 return workflowEntityType == null ? null : new WorkflowEntityTypeObject(workflowEntityType); 1560 } 1561 1562 @GraphQLField 1563 @GraphQLName("workflowEntityTypes") 1564 @GraphQLNonNull 1565 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1566 static CountingPaginatedData<WorkflowEntityTypeObject> workflowEntityTypes(final DataFetchingEnvironment env, 1567 @GraphQLName("workflowName") final String workflowName, 1568 @GraphQLName("componentVendorName") final String componentVendorName, 1569 @GraphQLName("entityTypeName") final String entityTypeName) { 1570 CountingPaginatedData<WorkflowEntityTypeObject> data; 1571 1572 try { 1573 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntityTypesForm(); 1574 var command = CDI.current().select(GetWorkflowEntityTypesCommand.class).get(); 1575 1576 commandForm.setWorkflowName(workflowName); 1577 commandForm.setComponentVendorName(componentVendorName); 1578 commandForm.setEntityTypeName(entityTypeName); 1579 1580 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1581 if(totalEntities == null) { 1582 data = Connections.emptyConnection(); 1583 } else { 1584 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntityTypeConstants.COMPONENT_VENDOR_NAME, WorkflowEntityTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 1585 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1586 1587 var workflowEntityTypes = entities.stream() 1588 .map(WorkflowEntityTypeObject::new) 1589 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1590 1591 data = new CountedObjects<>(objectLimiter, workflowEntityTypes); 1592 } 1593 } 1594 } catch (NamingException ex) { 1595 throw new RuntimeException(ex); 1596 } 1597 1598 return data; 1599 } 1600 1601 @GraphQLField 1602 @GraphQLName("workflowSelectorKind") 1603 static WorkflowSelectorKindObject workflowSelectorKind(final DataFetchingEnvironment env, 1604 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1605 @GraphQLName("selectorKindName") @GraphQLNonNull final String selectorKindName) { 1606 WorkflowSelectorKind workflowSelectorKind; 1607 1608 try { 1609 var commandForm = WorkflowUtil.getHome().getGetWorkflowSelectorKindForm(); 1610 1611 commandForm.setWorkflowName(workflowName); 1612 commandForm.setSelectorKindName(selectorKindName); 1613 1614 workflowSelectorKind = CDI.current().select(GetWorkflowSelectorKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1615 } catch (NamingException ex) { 1616 throw new RuntimeException(ex); 1617 } 1618 1619 return workflowSelectorKind == null ? null : new WorkflowSelectorKindObject(workflowSelectorKind); 1620 } 1621 1622 @GraphQLField 1623 @GraphQLName("workflowSelectorKinds") 1624 @GraphQLNonNull 1625 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1626 static CountingPaginatedData<WorkflowSelectorKindObject> workflowSelectorKinds(final DataFetchingEnvironment env, 1627 @GraphQLName("workflowName") final String workflowName, 1628 @GraphQLName("selectorKindName") final String selectorKindName) { 1629 CountingPaginatedData<WorkflowSelectorKindObject> data; 1630 1631 try { 1632 var commandForm = WorkflowUtil.getHome().getGetWorkflowSelectorKindsForm(); 1633 var command = CDI.current().select(GetWorkflowSelectorKindsCommand.class).get(); 1634 1635 commandForm.setWorkflowName(workflowName); 1636 commandForm.setSelectorKindName(selectorKindName); 1637 1638 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1639 if(totalEntities == null) { 1640 data = Connections.emptyConnection(); 1641 } else { 1642 try(var objectLimiter = new ObjectLimiter(env, WorkflowSelectorKindConstants.COMPONENT_VENDOR_NAME, WorkflowSelectorKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 1643 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1644 1645 var workflowSelectorKinds = entities.stream() 1646 .map(WorkflowSelectorKindObject::new) 1647 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1648 1649 data = new CountedObjects<>(objectLimiter, workflowSelectorKinds); 1650 } 1651 } 1652 } catch (NamingException ex) { 1653 throw new RuntimeException(ex); 1654 } 1655 1656 return data; 1657 } 1658 1659 @GraphQLField 1660 @GraphQLName("workflowEntityStatuses") 1661 @GraphQLNonNull 1662 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1663 static CountingPaginatedData<WorkflowEntityStatusObject> workflowEntityStatuses(final DataFetchingEnvironment env, 1664 @GraphQLName("workflowName") final String workflowName) { 1665 CountingPaginatedData<WorkflowEntityStatusObject> data; 1666 1667 try { 1668 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntityStatusesForm(); 1669 var command = CDI.current().select(GetWorkflowEntityStatusesCommand.class).get(); 1670 1671 commandForm.setWorkflowName(workflowName); 1672 1673 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1674 if(totalEntities == null) { 1675 data = Connections.emptyConnection(); 1676 } else { 1677 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntityStatusConstants.COMPONENT_VENDOR_NAME, WorkflowEntityStatusConstants.ENTITY_TYPE_NAME, totalEntities)) { 1678 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1679 1680 var workflowEntityStatuses = entities.stream() 1681 .map(WorkflowEntityStatusObject::new) 1682 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1683 1684 data = new CountedObjects<>(objectLimiter, workflowEntityStatuses); 1685 } 1686 } 1687 } catch (NamingException ex) { 1688 throw new RuntimeException(ex); 1689 } 1690 1691 return data; 1692 } 1693 1694 @GraphQLField 1695 @GraphQLName("workflowStep") 1696 static WorkflowStepObject workflowStep(final DataFetchingEnvironment env, 1697 @GraphQLName("workflowName") final String workflowName, 1698 @GraphQLName("workflowStepName") final String workflowStepName, 1699 @GraphQLName("id") @GraphQLID final String id) { 1700 WorkflowStep workflowStep; 1701 1702 try { 1703 var commandForm = WorkflowUtil.getHome().getGetWorkflowStepForm(); 1704 1705 commandForm.setWorkflowName(workflowName); 1706 commandForm.setWorkflowStepName(workflowStepName); 1707 commandForm.setUuid(id); 1708 1709 workflowStep = CDI.current().select(GetWorkflowStepCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1710 } catch (NamingException ex) { 1711 throw new RuntimeException(ex); 1712 } 1713 1714 return workflowStep == null ? null : new WorkflowStepObject(workflowStep); 1715 } 1716 1717 @GraphQLField 1718 @GraphQLName("workflowSteps") 1719 @GraphQLNonNull 1720 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1721 static CountingPaginatedData<WorkflowStepObject> workflowSteps(final DataFetchingEnvironment env, 1722 @GraphQLName("workflowName") final String workflowName) { 1723 CountingPaginatedData<WorkflowStepObject> data; 1724 1725 try { 1726 var commandForm = WorkflowUtil.getHome().getGetWorkflowStepsForm(); 1727 var command = CDI.current().select(GetWorkflowStepsCommand.class).get(); 1728 1729 commandForm.setWorkflowName(workflowName); 1730 1731 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1732 if(totalEntities == null) { 1733 data = Connections.emptyConnection(); 1734 } else { 1735 try(var objectLimiter = new ObjectLimiter(env, WorkflowStepConstants.COMPONENT_VENDOR_NAME, WorkflowStepConstants.ENTITY_TYPE_NAME, totalEntities)) { 1736 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1737 1738 var workflowSteps = entities.stream() 1739 .map(WorkflowStepObject::new) 1740 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1741 1742 data = new CountedObjects<>(objectLimiter, workflowSteps); 1743 } 1744 } 1745 } catch (NamingException ex) { 1746 throw new RuntimeException(ex); 1747 } 1748 1749 return data; 1750 } 1751 1752 @GraphQLField 1753 @GraphQLName("workflowDestination") 1754 static WorkflowDestinationObject workflowDestination(final DataFetchingEnvironment env, 1755 @GraphQLName("workflowName") final String workflowName, 1756 @GraphQLName("workflowStepName") final String workflowStepName, 1757 @GraphQLName("workflowDestinationName") final String workflowDestinationName, 1758 @GraphQLName("id") @GraphQLID final String id) { 1759 WorkflowDestination workflowDestination; 1760 1761 try { 1762 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationForm(); 1763 1764 commandForm.setWorkflowName(workflowName); 1765 commandForm.setWorkflowStepName(workflowStepName); 1766 commandForm.setWorkflowDestinationName(workflowDestinationName); 1767 commandForm.setUuid(id); 1768 1769 workflowDestination = CDI.current().select(GetWorkflowDestinationCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1770 } catch (NamingException ex) { 1771 throw new RuntimeException(ex); 1772 } 1773 1774 return workflowDestination == null ? null : new WorkflowDestinationObject(workflowDestination); 1775 } 1776 1777 @GraphQLField 1778 @GraphQLName("workflowDestinations") 1779 @GraphQLNonNull 1780 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1781 static CountingPaginatedData<WorkflowDestinationObject> workflowDestinations(final DataFetchingEnvironment env, 1782 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1783 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName) { 1784 CountingPaginatedData<WorkflowDestinationObject> data; 1785 1786 try { 1787 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationsForm(); 1788 var command = CDI.current().select(GetWorkflowDestinationsCommand.class).get(); 1789 1790 commandForm.setWorkflowName(workflowName); 1791 commandForm.setWorkflowStepName(workflowStepName); 1792 1793 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1794 if(totalEntities == null) { 1795 data = Connections.emptyConnection(); 1796 } else { 1797 try(var objectLimiter = new ObjectLimiter(env, WorkflowDestinationConstants.COMPONENT_VENDOR_NAME, WorkflowDestinationConstants.ENTITY_TYPE_NAME, totalEntities)) { 1798 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1799 1800 var workflowDestinations = entities.stream() 1801 .map(WorkflowDestinationObject::new) 1802 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1803 1804 data = new CountedObjects<>(objectLimiter, workflowDestinations); 1805 } 1806 } 1807 } catch (NamingException ex) { 1808 throw new RuntimeException(ex); 1809 } 1810 1811 return data; 1812 } 1813 1814 @GraphQLField 1815 @GraphQLName("workflowDestinationStep") 1816 static WorkflowDestinationStepObject workflowDestinationStep(final DataFetchingEnvironment env, 1817 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1818 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1819 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName, 1820 @GraphQLName("destinationWorkflowName") @GraphQLNonNull final String destinationWorkflowName, 1821 @GraphQLName("destinationWorkflowStepName") @GraphQLNonNull final String destinationWorkflowStepName) { 1822 WorkflowDestinationStep workflowDestinationStep; 1823 1824 try { 1825 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationStepForm(); 1826 1827 commandForm.setWorkflowName(workflowName); 1828 commandForm.setWorkflowStepName(workflowStepName); 1829 commandForm.setWorkflowDestinationName(workflowDestinationName); 1830 commandForm.setDestinationWorkflowName(destinationWorkflowName); 1831 commandForm.setDestinationWorkflowStepName(destinationWorkflowStepName); 1832 1833 workflowDestinationStep = CDI.current().select(GetWorkflowDestinationStepCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1834 } catch (NamingException ex) { 1835 throw new RuntimeException(ex); 1836 } 1837 1838 return workflowDestinationStep == null ? null : new WorkflowDestinationStepObject(workflowDestinationStep); 1839 } 1840 1841 @GraphQLField 1842 @GraphQLName("workflowDestinationSteps") 1843 @GraphQLNonNull 1844 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1845 static CountingPaginatedData<WorkflowDestinationStepObject> workflowDestinationSteps(final DataFetchingEnvironment env, 1846 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1847 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1848 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName) { 1849 CountingPaginatedData<WorkflowDestinationStepObject> data; 1850 1851 try { 1852 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationStepsForm(); 1853 var command = CDI.current().select(GetWorkflowDestinationStepsCommand.class).get(); 1854 1855 commandForm.setWorkflowName(workflowName); 1856 commandForm.setWorkflowStepName(workflowStepName); 1857 commandForm.setWorkflowDestinationName(workflowDestinationName); 1858 1859 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1860 if(totalEntities == null) { 1861 data = Connections.emptyConnection(); 1862 } else { 1863 try(var objectLimiter = new ObjectLimiter(env, WorkflowDestinationStepConstants.COMPONENT_VENDOR_NAME, WorkflowDestinationStepConstants.ENTITY_TYPE_NAME, totalEntities)) { 1864 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1865 1866 var workflowDestinationSteps = entities.stream() 1867 .map(WorkflowDestinationStepObject::new) 1868 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1869 1870 data = new CountedObjects<>(objectLimiter, workflowDestinationSteps); 1871 } 1872 } 1873 } catch (NamingException ex) { 1874 throw new RuntimeException(ex); 1875 } 1876 1877 return data; 1878 } 1879 1880 @GraphQLField 1881 @GraphQLName("workflowDestinationPartyType") 1882 static WorkflowDestinationPartyTypeObject workflowDestinationPartyType(final DataFetchingEnvironment env, 1883 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1884 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1885 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName, 1886 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName) { 1887 WorkflowDestinationPartyType workflowDestinationPartyType; 1888 1889 try { 1890 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationPartyTypeForm(); 1891 1892 commandForm.setWorkflowName(workflowName); 1893 commandForm.setWorkflowStepName(workflowStepName); 1894 commandForm.setWorkflowDestinationName(workflowDestinationName); 1895 commandForm.setPartyTypeName(partyTypeName); 1896 1897 workflowDestinationPartyType = CDI.current().select(GetWorkflowDestinationPartyTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1898 } catch (NamingException ex) { 1899 throw new RuntimeException(ex); 1900 } 1901 1902 return workflowDestinationPartyType == null ? null : new WorkflowDestinationPartyTypeObject(workflowDestinationPartyType); 1903 } 1904 1905 @GraphQLField 1906 @GraphQLName("workflowDestinationPartyTypes") 1907 @GraphQLNonNull 1908 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1909 static CountingPaginatedData<WorkflowDestinationPartyTypeObject> workflowDestinationPartyTypes(final DataFetchingEnvironment env, 1910 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1911 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1912 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName) { 1913 CountingPaginatedData<WorkflowDestinationPartyTypeObject> data; 1914 1915 try { 1916 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationPartyTypesForm(); 1917 var command = CDI.current().select(GetWorkflowDestinationPartyTypesCommand.class).get(); 1918 1919 commandForm.setWorkflowName(workflowName); 1920 commandForm.setWorkflowStepName(workflowStepName); 1921 commandForm.setWorkflowDestinationName(workflowDestinationName); 1922 1923 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1924 if(totalEntities == null) { 1925 data = Connections.emptyConnection(); 1926 } else { 1927 try(var objectLimiter = new ObjectLimiter(env, WorkflowDestinationPartyTypeConstants.COMPONENT_VENDOR_NAME, WorkflowDestinationPartyTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 1928 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1929 1930 var workflowDestinationPartyTypes = entities.stream() 1931 .map(WorkflowDestinationPartyTypeObject::new) 1932 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 1933 1934 data = new CountedObjects<>(objectLimiter, workflowDestinationPartyTypes); 1935 } 1936 } 1937 } catch (NamingException ex) { 1938 throw new RuntimeException(ex); 1939 } 1940 1941 return data; 1942 } 1943 1944 @GraphQLField 1945 @GraphQLName("workflowDestinationSecurityRole") 1946 static WorkflowDestinationSecurityRoleObject workflowDestinationSecurityRole(final DataFetchingEnvironment env, 1947 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1948 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1949 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName, 1950 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName, 1951 @GraphQLName("securityRoleName") @GraphQLNonNull final String securityRoleName) { 1952 WorkflowDestinationSecurityRole workflowDestinationSecurityRole; 1953 1954 try { 1955 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationSecurityRoleForm(); 1956 1957 commandForm.setWorkflowName(workflowName); 1958 commandForm.setWorkflowStepName(workflowStepName); 1959 commandForm.setWorkflowDestinationName(workflowDestinationName); 1960 commandForm.setPartyTypeName(partyTypeName); 1961 commandForm.setSecurityRoleName(securityRoleName); 1962 1963 workflowDestinationSecurityRole = CDI.current().select(GetWorkflowDestinationSecurityRoleCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 1964 } catch (NamingException ex) { 1965 throw new RuntimeException(ex); 1966 } 1967 1968 return workflowDestinationSecurityRole == null ? null : new WorkflowDestinationSecurityRoleObject(workflowDestinationSecurityRole); 1969 } 1970 1971 @GraphQLField 1972 @GraphQLName("workflowDestinationSecurityRoles") 1973 @GraphQLNonNull 1974 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 1975 static CountingPaginatedData<WorkflowDestinationSecurityRoleObject> workflowDestinationSecurityRoles(final DataFetchingEnvironment env, 1976 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 1977 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 1978 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName, 1979 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName) { 1980 CountingPaginatedData<WorkflowDestinationSecurityRoleObject> data; 1981 1982 try { 1983 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationSecurityRolesForm(); 1984 var command = CDI.current().select(GetWorkflowDestinationSecurityRolesCommand.class).get(); 1985 1986 commandForm.setWorkflowName(workflowName); 1987 commandForm.setWorkflowStepName(workflowStepName); 1988 commandForm.setWorkflowDestinationName(workflowDestinationName); 1989 commandForm.setPartyTypeName(partyTypeName); 1990 1991 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1992 if(totalEntities == null) { 1993 data = Connections.emptyConnection(); 1994 } else { 1995 try(var objectLimiter = new ObjectLimiter(env, WorkflowDestinationSecurityRoleConstants.COMPONENT_VENDOR_NAME, WorkflowDestinationSecurityRoleConstants.ENTITY_TYPE_NAME, totalEntities)) { 1996 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 1997 1998 var workflowDestinationSecurityRoles = entities.stream() 1999 .map(WorkflowDestinationSecurityRoleObject::new) 2000 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2001 2002 data = new CountedObjects<>(objectLimiter, workflowDestinationSecurityRoles); 2003 } 2004 } 2005 } catch (NamingException ex) { 2006 throw new RuntimeException(ex); 2007 } 2008 2009 return data; 2010 } 2011 2012 @GraphQLField 2013 @GraphQLName("workflowDestinationSelector") 2014 static WorkflowDestinationSelectorObject workflowDestinationSelector(final DataFetchingEnvironment env, 2015 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2016 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 2017 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName, 2018 @GraphQLName("selectorName") @GraphQLNonNull final String selectorName) { 2019 WorkflowDestinationSelector workflowDestinationSelector; 2020 2021 try { 2022 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationSelectorForm(); 2023 2024 commandForm.setWorkflowName(workflowName); 2025 commandForm.setWorkflowStepName(workflowStepName); 2026 commandForm.setWorkflowDestinationName(workflowDestinationName); 2027 commandForm.setSelectorName(selectorName); 2028 2029 workflowDestinationSelector = CDI.current().select(GetWorkflowDestinationSelectorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2030 } catch (NamingException ex) { 2031 throw new RuntimeException(ex); 2032 } 2033 2034 return workflowDestinationSelector == null ? null : new WorkflowDestinationSelectorObject(workflowDestinationSelector); 2035 } 2036 2037 @GraphQLField 2038 @GraphQLName("workflowDestinationSelectors") 2039 @GraphQLNonNull 2040 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2041 static CountingPaginatedData<WorkflowDestinationSelectorObject> workflowDestinationSelectors(final DataFetchingEnvironment env, 2042 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2043 @GraphQLName("workflowStepName") @GraphQLNonNull final String workflowStepName, 2044 @GraphQLName("workflowDestinationName") @GraphQLNonNull final String workflowDestinationName) { 2045 CountingPaginatedData<WorkflowDestinationSelectorObject> data; 2046 2047 try { 2048 var commandForm = WorkflowUtil.getHome().getGetWorkflowDestinationSelectorsForm(); 2049 var command = CDI.current().select(GetWorkflowDestinationSelectorsCommand.class).get(); 2050 2051 commandForm.setWorkflowName(workflowName); 2052 commandForm.setWorkflowStepName(workflowStepName); 2053 commandForm.setWorkflowDestinationName(workflowDestinationName); 2054 2055 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2056 if(totalEntities == null) { 2057 data = Connections.emptyConnection(); 2058 } else { 2059 try(var objectLimiter = new ObjectLimiter(env, WorkflowDestinationSelectorConstants.COMPONENT_VENDOR_NAME, WorkflowDestinationSelectorConstants.ENTITY_TYPE_NAME, totalEntities)) { 2060 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2061 2062 var workflowDestinationSelectors = entities.stream() 2063 .map(WorkflowDestinationSelectorObject::new) 2064 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2065 2066 data = new CountedObjects<>(objectLimiter, workflowDestinationSelectors); 2067 } 2068 } 2069 } catch (NamingException ex) { 2070 throw new RuntimeException(ex); 2071 } 2072 2073 return data; 2074 } 2075 2076 @GraphQLField 2077 @GraphQLName("workflowEntrance") 2078 static WorkflowEntranceObject workflowEntrance(final DataFetchingEnvironment env, 2079 @GraphQLName("workflowName") final String workflowName, 2080 @GraphQLName("workflowEntranceName") final String workflowEntranceName, 2081 @GraphQLName("id") @GraphQLID final String id) { 2082 WorkflowEntrance workflowEntrance; 2083 2084 try { 2085 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceForm(); 2086 2087 commandForm.setWorkflowName(workflowName); 2088 commandForm.setWorkflowEntranceName(workflowEntranceName); 2089 commandForm.setUuid(id); 2090 2091 workflowEntrance = CDI.current().select(GetWorkflowEntranceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2092 } catch (NamingException ex) { 2093 throw new RuntimeException(ex); 2094 } 2095 2096 return workflowEntrance == null ? null : new WorkflowEntranceObject(workflowEntrance); 2097 } 2098 2099 @GraphQLField 2100 @GraphQLName("workflowEntrances") 2101 @GraphQLNonNull 2102 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2103 static CountingPaginatedData<WorkflowEntranceObject> workflowEntrances(final DataFetchingEnvironment env, 2104 @GraphQLName("workflowName") final String workflowName) { 2105 CountingPaginatedData<WorkflowEntranceObject> data; 2106 2107 try { 2108 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntrancesForm(); 2109 var command = CDI.current().select(GetWorkflowEntrancesCommand.class).get(); 2110 2111 commandForm.setWorkflowName(workflowName); 2112 2113 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2114 if(totalEntities == null) { 2115 data = Connections.emptyConnection(); 2116 } else { 2117 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntranceConstants.COMPONENT_VENDOR_NAME, WorkflowEntranceConstants.ENTITY_TYPE_NAME, totalEntities)) { 2118 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2119 2120 var workflowEntrances = entities.stream() 2121 .map(WorkflowEntranceObject::new) 2122 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2123 2124 data = new CountedObjects<>(objectLimiter, workflowEntrances); 2125 } 2126 } 2127 } catch (NamingException ex) { 2128 throw new RuntimeException(ex); 2129 } 2130 2131 return data; 2132 } 2133 2134 @GraphQLField 2135 @GraphQLName("workflowEntranceStep") 2136 static WorkflowEntranceStepObject workflowEntranceStep(final DataFetchingEnvironment env, 2137 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2138 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName, 2139 @GraphQLName("entranceWorkflowName") @GraphQLNonNull final String entranceWorkflowName, 2140 @GraphQLName("entranceWorkflowStepName") @GraphQLNonNull final String entranceWorkflowStepName) { 2141 WorkflowEntranceStep workflowEntranceStep; 2142 2143 try { 2144 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceStepForm(); 2145 2146 commandForm.setWorkflowName(workflowName); 2147 commandForm.setWorkflowEntranceName(workflowEntranceName); 2148 commandForm.setEntranceWorkflowName(entranceWorkflowName); 2149 commandForm.setEntranceWorkflowStepName(entranceWorkflowStepName); 2150 2151 workflowEntranceStep = CDI.current().select(GetWorkflowEntranceStepCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2152 } catch (NamingException ex) { 2153 throw new RuntimeException(ex); 2154 } 2155 2156 return workflowEntranceStep == null ? null : new WorkflowEntranceStepObject(workflowEntranceStep); 2157 } 2158 2159 @GraphQLField 2160 @GraphQLName("workflowEntranceSteps") 2161 @GraphQLNonNull 2162 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2163 static CountingPaginatedData<WorkflowEntranceStepObject> workflowEntranceSteps(final DataFetchingEnvironment env, 2164 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2165 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName) { 2166 CountingPaginatedData<WorkflowEntranceStepObject> data; 2167 2168 try { 2169 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceStepsForm(); 2170 var command = CDI.current().select(GetWorkflowEntranceStepsCommand.class).get(); 2171 2172 commandForm.setWorkflowName(workflowName); 2173 commandForm.setWorkflowEntranceName(workflowEntranceName); 2174 2175 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2176 if(totalEntities == null) { 2177 data = Connections.emptyConnection(); 2178 } else { 2179 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntranceStepConstants.COMPONENT_VENDOR_NAME, WorkflowEntranceStepConstants.ENTITY_TYPE_NAME, totalEntities)) { 2180 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2181 2182 var workflowEntranceSteps = entities.stream() 2183 .map(WorkflowEntranceStepObject::new) 2184 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2185 2186 data = new CountedObjects<>(objectLimiter, workflowEntranceSteps); 2187 } 2188 } 2189 } catch (NamingException ex) { 2190 throw new RuntimeException(ex); 2191 } 2192 2193 return data; 2194 } 2195 2196 @GraphQLField 2197 @GraphQLName("workflowEntrancePartyType") 2198 static WorkflowEntrancePartyTypeObject workflowEntrancePartyType(final DataFetchingEnvironment env, 2199 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2200 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName, 2201 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName) { 2202 WorkflowEntrancePartyType workflowEntrancePartyType; 2203 2204 try { 2205 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntrancePartyTypeForm(); 2206 2207 commandForm.setWorkflowName(workflowName); 2208 commandForm.setWorkflowEntranceName(workflowEntranceName); 2209 commandForm.setPartyTypeName(partyTypeName); 2210 2211 workflowEntrancePartyType = CDI.current().select(GetWorkflowEntrancePartyTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2212 } catch (NamingException ex) { 2213 throw new RuntimeException(ex); 2214 } 2215 2216 return workflowEntrancePartyType == null ? null : new WorkflowEntrancePartyTypeObject(workflowEntrancePartyType); 2217 } 2218 2219 @GraphQLField 2220 @GraphQLName("workflowEntrancePartyTypes") 2221 @GraphQLNonNull 2222 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2223 static CountingPaginatedData<WorkflowEntrancePartyTypeObject> workflowEntrancePartyTypes(final DataFetchingEnvironment env, 2224 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2225 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName) { 2226 CountingPaginatedData<WorkflowEntrancePartyTypeObject> data; 2227 2228 try { 2229 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntrancePartyTypesForm(); 2230 var command = CDI.current().select(GetWorkflowEntrancePartyTypesCommand.class).get(); 2231 2232 commandForm.setWorkflowName(workflowName); 2233 commandForm.setWorkflowEntranceName(workflowEntranceName); 2234 2235 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2236 if(totalEntities == null) { 2237 data = Connections.emptyConnection(); 2238 } else { 2239 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntrancePartyTypeConstants.COMPONENT_VENDOR_NAME, WorkflowEntrancePartyTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2240 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2241 2242 var workflowEntrancePartyTypes = entities.stream() 2243 .map(WorkflowEntrancePartyTypeObject::new) 2244 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2245 2246 data = new CountedObjects<>(objectLimiter, workflowEntrancePartyTypes); 2247 } 2248 } 2249 } catch (NamingException ex) { 2250 throw new RuntimeException(ex); 2251 } 2252 2253 return data; 2254 } 2255 2256 @GraphQLField 2257 @GraphQLName("workflowEntranceSecurityRole") 2258 static WorkflowEntranceSecurityRoleObject workflowEntranceSecurityRole(final DataFetchingEnvironment env, 2259 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2260 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName, 2261 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName, 2262 @GraphQLName("securityRoleName") @GraphQLNonNull final String securityRoleName) { 2263 WorkflowEntranceSecurityRole workflowEntranceSecurityRole; 2264 2265 try { 2266 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceSecurityRoleForm(); 2267 2268 commandForm.setWorkflowName(workflowName); 2269 commandForm.setWorkflowEntranceName(workflowEntranceName); 2270 commandForm.setPartyTypeName(partyTypeName); 2271 commandForm.setSecurityRoleName(securityRoleName); 2272 2273 workflowEntranceSecurityRole = CDI.current().select(GetWorkflowEntranceSecurityRoleCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2274 } catch (NamingException ex) { 2275 throw new RuntimeException(ex); 2276 } 2277 2278 return workflowEntranceSecurityRole == null ? null : new WorkflowEntranceSecurityRoleObject(workflowEntranceSecurityRole); 2279 } 2280 2281 @GraphQLField 2282 @GraphQLName("workflowEntranceSecurityRoles") 2283 @GraphQLNonNull 2284 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2285 static CountingPaginatedData<WorkflowEntranceSecurityRoleObject> workflowEntranceSecurityRoles(final DataFetchingEnvironment env, 2286 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2287 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName, 2288 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName) { 2289 CountingPaginatedData<WorkflowEntranceSecurityRoleObject> data; 2290 2291 try { 2292 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceSecurityRolesForm(); 2293 var command = CDI.current().select(GetWorkflowEntranceSecurityRolesCommand.class).get(); 2294 2295 commandForm.setWorkflowName(workflowName); 2296 commandForm.setWorkflowEntranceName(workflowEntranceName); 2297 commandForm.setPartyTypeName(partyTypeName); 2298 2299 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2300 if(totalEntities == null) { 2301 data = Connections.emptyConnection(); 2302 } else { 2303 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntranceSecurityRoleConstants.COMPONENT_VENDOR_NAME, WorkflowEntranceSecurityRoleConstants.ENTITY_TYPE_NAME, totalEntities)) { 2304 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2305 2306 var workflowEntranceSecurityRoles = entities.stream() 2307 .map(WorkflowEntranceSecurityRoleObject::new) 2308 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2309 2310 data = new CountedObjects<>(objectLimiter, workflowEntranceSecurityRoles); 2311 } 2312 } 2313 } catch (NamingException ex) { 2314 throw new RuntimeException(ex); 2315 } 2316 2317 return data; 2318 } 2319 2320 @GraphQLField 2321 @GraphQLName("workflowEntranceSelector") 2322 static WorkflowEntranceSelectorObject workflowEntranceSelector(final DataFetchingEnvironment env, 2323 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2324 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName, 2325 @GraphQLName("selectorName") @GraphQLNonNull final String selectorName) { 2326 WorkflowEntranceSelector workflowEntranceSelector; 2327 2328 try { 2329 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceSelectorForm(); 2330 2331 commandForm.setWorkflowName(workflowName); 2332 commandForm.setWorkflowEntranceName(workflowEntranceName); 2333 commandForm.setSelectorName(selectorName); 2334 2335 workflowEntranceSelector = CDI.current().select(GetWorkflowEntranceSelectorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2336 } catch (NamingException ex) { 2337 throw new RuntimeException(ex); 2338 } 2339 2340 return workflowEntranceSelector == null ? null : new WorkflowEntranceSelectorObject(workflowEntranceSelector); 2341 } 2342 2343 @GraphQLField 2344 @GraphQLName("workflowEntranceSelectors") 2345 @GraphQLNonNull 2346 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2347 static CountingPaginatedData<WorkflowEntranceSelectorObject> workflowEntranceSelectors(final DataFetchingEnvironment env, 2348 @GraphQLName("workflowName") @GraphQLNonNull final String workflowName, 2349 @GraphQLName("workflowEntranceName") @GraphQLNonNull final String workflowEntranceName) { 2350 CountingPaginatedData<WorkflowEntranceSelectorObject> data; 2351 2352 try { 2353 var commandForm = WorkflowUtil.getHome().getGetWorkflowEntranceSelectorsForm(); 2354 var command = CDI.current().select(GetWorkflowEntranceSelectorsCommand.class).get(); 2355 2356 commandForm.setWorkflowName(workflowName); 2357 commandForm.setWorkflowEntranceName(workflowEntranceName); 2358 2359 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2360 if(totalEntities == null) { 2361 data = Connections.emptyConnection(); 2362 } else { 2363 try(var objectLimiter = new ObjectLimiter(env, WorkflowEntranceSelectorConstants.COMPONENT_VENDOR_NAME, WorkflowEntranceSelectorConstants.ENTITY_TYPE_NAME, totalEntities)) { 2364 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2365 2366 var workflowEntranceSelectors = entities.stream() 2367 .map(WorkflowEntranceSelectorObject::new) 2368 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2369 2370 data = new CountedObjects<>(objectLimiter, workflowEntranceSelectors); 2371 } 2372 } 2373 } catch (NamingException ex) { 2374 throw new RuntimeException(ex); 2375 } 2376 2377 return data; 2378 } 2379 2380 @GraphQLField 2381 @GraphQLName("workflowStepType") 2382 static WorkflowStepTypeObject workflowStepType(final DataFetchingEnvironment env, 2383 @GraphQLName("workflowStepTypeName") final String workflowStepTypeName, 2384 @GraphQLName("id") @GraphQLID final String id) { 2385 WorkflowStepType workflowStepType; 2386 2387 try { 2388 var commandForm = WorkflowUtil.getHome().getGetWorkflowStepTypeForm(); 2389 2390 commandForm.setWorkflowStepTypeName(workflowStepTypeName); 2391 commandForm.setUuid(id); 2392 2393 workflowStepType = CDI.current().select(GetWorkflowStepTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2394 } catch (NamingException ex) { 2395 throw new RuntimeException(ex); 2396 } 2397 2398 return workflowStepType == null ? null : new WorkflowStepTypeObject(workflowStepType); 2399 } 2400 2401 @GraphQLField 2402 @GraphQLName("workflowStepTypes") 2403 @GraphQLNonNull 2404 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2405 static CountingPaginatedData<WorkflowStepTypeObject> workflowStepTypes(final DataFetchingEnvironment env) { 2406 CountingPaginatedData<WorkflowStepTypeObject> data; 2407 2408 try { 2409 var commandForm = WorkflowUtil.getHome().getGetWorkflowStepTypesForm(); 2410 var command = CDI.current().select(GetWorkflowStepTypesCommand.class).get(); 2411 2412 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2413 if(totalEntities == null) { 2414 data = Connections.emptyConnection(); 2415 } else { 2416 try(var objectLimiter = new ObjectLimiter(env, WorkflowStepTypeConstants.COMPONENT_VENDOR_NAME, WorkflowStepTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2417 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2418 2419 var workflowStepTypes = entities.stream() 2420 .map(WorkflowStepTypeObject::new) 2421 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2422 2423 data = new CountedObjects<>(objectLimiter, workflowStepTypes); 2424 } 2425 } 2426 } catch (NamingException ex) { 2427 throw new RuntimeException(ex); 2428 } 2429 2430 return data; 2431 } 2432 2433 @GraphQLField 2434 @GraphQLName("sequence") 2435 static SequenceObject sequence(final DataFetchingEnvironment env, 2436 @GraphQLName("sequenceTypeName") final String sequenceTypeName, 2437 @GraphQLName("sequenceName") final String sequenceName, 2438 @GraphQLName("id") @GraphQLID final String id) { 2439 Sequence sequence; 2440 2441 try { 2442 var commandForm = SequenceUtil.getHome().getGetSequenceForm(); 2443 2444 commandForm.setSequenceTypeName(sequenceTypeName); 2445 commandForm.setSequenceName(sequenceName); 2446 commandForm.setUuid(id); 2447 2448 sequence = CDI.current().select(GetSequenceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2449 } catch (NamingException ex) { 2450 throw new RuntimeException(ex); 2451 } 2452 2453 return sequence == null ? null : new SequenceObject(sequence); 2454 } 2455 2456 @GraphQLField 2457 @GraphQLName("sequenceValue") 2458 static GetSequenceValueResultObject sequenceValue(final DataFetchingEnvironment env, 2459 @GraphQLName("sequenceTypeName") final String sequenceTypeName, 2460 @GraphQLName("sequenceName") final String sequenceName, 2461 @GraphQLName("id") @GraphQLID final String id) { 2462 GetSequenceValueResultObject result = null; 2463 2464 try { 2465 var commandForm = SequenceUtil.getHome().getGetSequenceValueForm(); 2466 2467 commandForm.setSequenceTypeName(sequenceTypeName); 2468 commandForm.setSequenceName(sequenceName); 2469 commandForm.setUuid(id); 2470 2471 var commandResult = SequenceUtil.getHome().getSequenceValue(BaseGraphQl.getUserVisitPK(env), commandForm); 2472 2473 if(!commandResult.hasErrors()) { 2474 result = new GetSequenceValueResultObject((GetSequenceValueResult)commandResult.getExecutionResult().getResult()); 2475 } 2476 } catch (NamingException ex) { 2477 throw new RuntimeException(ex); 2478 } 2479 2480 return result; 2481 } 2482 2483 @GraphQLField 2484 @GraphQLName("sequences") 2485 static Collection<SequenceObject> sequences(final DataFetchingEnvironment env, 2486 @GraphQLName("sequenceTypeName") @GraphQLNonNull final String sequenceTypeName) { 2487 Collection<Sequence> sequences; 2488 Collection<SequenceObject> sequenceObjects; 2489 2490 try { 2491 var commandForm = SequenceUtil.getHome().getGetSequencesForm(); 2492 2493 commandForm.setSequenceTypeName(sequenceTypeName); 2494 2495 sequences = CDI.current().select(GetSequencesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2496 } catch (NamingException ex) { 2497 throw new RuntimeException(ex); 2498 } 2499 2500 if(sequences == null) { 2501 sequenceObjects = emptyList(); 2502 } else { 2503 sequenceObjects = new ArrayList<>(sequences.size()); 2504 2505 sequences.stream() 2506 .map(SequenceObject::new) 2507 .forEachOrdered(sequenceObjects::add); 2508 } 2509 2510 return sequenceObjects; 2511 } 2512 2513 @GraphQLField 2514 @GraphQLName("sequenceType") 2515 static SequenceTypeObject sequenceType(final DataFetchingEnvironment env, 2516 @GraphQLName("sequenceTypeName") final String sequenceTypeName, 2517 @GraphQLName("id") @GraphQLID final String id) { 2518 SequenceType sequenceType; 2519 2520 try { 2521 var commandForm = SequenceUtil.getHome().getGetSequenceTypeForm(); 2522 2523 commandForm.setSequenceTypeName(sequenceTypeName); 2524 commandForm.setUuid(id); 2525 2526 sequenceType = CDI.current().select(GetSequenceTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2527 } catch (NamingException ex) { 2528 throw new RuntimeException(ex); 2529 } 2530 2531 return sequenceType == null ? null : new SequenceTypeObject(sequenceType); 2532 } 2533 2534 @GraphQLField 2535 @GraphQLName("sequenceTypes") 2536 @GraphQLNonNull 2537 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2538 static CountingPaginatedData<SequenceTypeObject> sequenceTypes(final DataFetchingEnvironment env) { 2539 CountingPaginatedData<SequenceTypeObject> data; 2540 2541 try { 2542 var commandForm = SequenceUtil.getHome().getGetSequenceTypesForm(); 2543 var command = CDI.current().select(GetSequenceTypesCommand.class).get(); 2544 2545 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2546 if(totalEntities == null) { 2547 data = Connections.emptyConnection(); 2548 } else { 2549 try(var objectLimiter = new ObjectLimiter(env, SequenceTypeConstants.COMPONENT_VENDOR_NAME, SequenceTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2550 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2551 2552 var sequenceTypes = entities.stream() 2553 .map(SequenceTypeObject::new) 2554 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2555 2556 data = new CountedObjects<>(objectLimiter, sequenceTypes); 2557 } 2558 } 2559 } catch (NamingException ex) { 2560 throw new RuntimeException(ex); 2561 } 2562 2563 return data; 2564 } 2565 2566 @GraphQLField 2567 @GraphQLName("sequenceChecksumType") 2568 static SequenceChecksumTypeObject sequenceChecksumType(final DataFetchingEnvironment env, 2569 @GraphQLName("sequenceChecksumTypeName") @GraphQLNonNull final String sequenceChecksumTypeName) { 2570 SequenceChecksumType sequenceChecksumType; 2571 2572 try { 2573 var commandForm = SequenceUtil.getHome().getGetSequenceChecksumTypeForm(); 2574 2575 commandForm.setSequenceChecksumTypeName(sequenceChecksumTypeName); 2576 2577 sequenceChecksumType = CDI.current().select(GetSequenceChecksumTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2578 } catch (NamingException ex) { 2579 throw new RuntimeException(ex); 2580 } 2581 2582 return sequenceChecksumType == null ? null : new SequenceChecksumTypeObject(sequenceChecksumType); 2583 } 2584 2585 @GraphQLField 2586 @GraphQLName("sequenceChecksumTypes") 2587 @GraphQLNonNull 2588 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2589 static CountingPaginatedData<SequenceChecksumTypeObject> sequenceChecksumTypes(final DataFetchingEnvironment env) { 2590 CountingPaginatedData<SequenceChecksumTypeObject> data; 2591 2592 try { 2593 var commandForm = SequenceUtil.getHome().getGetSequenceChecksumTypesForm(); 2594 var command = CDI.current().select(GetSequenceChecksumTypesCommand.class).get(); 2595 2596 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2597 if(totalEntities == null) { 2598 data = Connections.emptyConnection(); 2599 } else { 2600 try(var objectLimiter = new ObjectLimiter(env, SequenceChecksumTypeConstants.COMPONENT_VENDOR_NAME, SequenceChecksumTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2601 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2602 2603 var sequenceChecksumTypes = entities.stream() 2604 .map(SequenceChecksumTypeObject::new) 2605 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2606 2607 data = new CountedObjects<>(objectLimiter, sequenceChecksumTypes); 2608 } 2609 } 2610 } catch (NamingException ex) { 2611 throw new RuntimeException(ex); 2612 } 2613 2614 return data; 2615 } 2616 2617 @GraphQLField 2618 @GraphQLName("sequenceEncoderType") 2619 static SequenceEncoderTypeObject sequenceEncoderType(final DataFetchingEnvironment env, 2620 @GraphQLName("sequenceEncoderTypeName") @GraphQLNonNull final String sequenceEncoderTypeName) { 2621 SequenceEncoderType sequenceEncoderType; 2622 2623 try { 2624 var commandForm = SequenceUtil.getHome().getGetSequenceEncoderTypeForm(); 2625 2626 commandForm.setSequenceEncoderTypeName(sequenceEncoderTypeName); 2627 2628 sequenceEncoderType = CDI.current().select(GetSequenceEncoderTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2629 } catch (NamingException ex) { 2630 throw new RuntimeException(ex); 2631 } 2632 2633 return sequenceEncoderType == null ? null : new SequenceEncoderTypeObject(sequenceEncoderType); 2634 } 2635 2636 @GraphQLField 2637 @GraphQLName("sequenceEncoderTypes") 2638 @GraphQLNonNull 2639 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2640 static CountingPaginatedData<SequenceEncoderTypeObject> sequenceEncoderTypes(final DataFetchingEnvironment env) { 2641 CountingPaginatedData<SequenceEncoderTypeObject> data; 2642 2643 try { 2644 var commandForm = SequenceUtil.getHome().getGetSequenceEncoderTypesForm(); 2645 var command = CDI.current().select(GetSequenceEncoderTypesCommand.class).get(); 2646 2647 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2648 if(totalEntities == null) { 2649 data = Connections.emptyConnection(); 2650 } else { 2651 try(var objectLimiter = new ObjectLimiter(env, SequenceEncoderTypeConstants.COMPONENT_VENDOR_NAME, SequenceEncoderTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2652 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2653 2654 var sequenceEncoderTypes = entities.stream() 2655 .map(SequenceEncoderTypeObject::new) 2656 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2657 2658 data = new CountedObjects<>(objectLimiter, sequenceEncoderTypes); 2659 } 2660 } 2661 } catch (NamingException ex) { 2662 throw new RuntimeException(ex); 2663 } 2664 2665 return data; 2666 } 2667 2668 @GraphQLField 2669 @GraphQLName("selectorKind") 2670 static SelectorKindObject selectorKind(final DataFetchingEnvironment env, 2671 @GraphQLName("selectorKindName") final String selectorKindName, 2672 @GraphQLName("id") @GraphQLID final String id) { 2673 SelectorKind selectorKind; 2674 2675 try { 2676 var commandForm = SelectorUtil.getHome().getGetSelectorKindForm(); 2677 2678 commandForm.setSelectorKindName(selectorKindName); 2679 commandForm.setUuid(id); 2680 2681 selectorKind = CDI.current().select(GetSelectorKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2682 } catch (NamingException ex) { 2683 throw new RuntimeException(ex); 2684 } 2685 2686 return selectorKind == null ? null : new SelectorKindObject(selectorKind); 2687 } 2688 2689 @GraphQLField 2690 @GraphQLName("selectorKinds") 2691 @GraphQLNonNull 2692 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2693 static CountingPaginatedData<SelectorKindObject> selectorKinds(final DataFetchingEnvironment env) { 2694 CountingPaginatedData<SelectorKindObject> data; 2695 2696 try { 2697 var commandForm = SelectorUtil.getHome().getGetSelectorKindsForm(); 2698 var command = CDI.current().select(GetSelectorKindsCommand.class).get(); 2699 2700 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2701 if(totalEntities == null) { 2702 data = Connections.emptyConnection(); 2703 } else { 2704 try(var objectLimiter = new ObjectLimiter(env, SelectorKindConstants.COMPONENT_VENDOR_NAME, SelectorKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 2705 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2706 2707 var selectorKinds = entities.stream() 2708 .map(SelectorKindObject::new) 2709 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2710 2711 data = new CountedObjects<>(objectLimiter, selectorKinds); 2712 } 2713 } 2714 } catch (NamingException ex) { 2715 throw new RuntimeException(ex); 2716 } 2717 2718 return data; 2719 } 2720 2721 @GraphQLField 2722 @GraphQLName("selectorType") 2723 static SelectorTypeObject selectorType(final DataFetchingEnvironment env, 2724 @GraphQLName("selectorKindName") final String selectorKindName, 2725 @GraphQLName("selectorTypeName") final String selectorTypeName, 2726 @GraphQLName("id") @GraphQLID final String id) { 2727 SelectorType selectorType; 2728 2729 try { 2730 var commandForm = SelectorUtil.getHome().getGetSelectorTypeForm(); 2731 2732 commandForm.setSelectorKindName(selectorKindName); 2733 commandForm.setSelectorTypeName(selectorTypeName); 2734 commandForm.setUuid(id); 2735 2736 selectorType = CDI.current().select(GetSelectorTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2737 } catch (NamingException ex) { 2738 throw new RuntimeException(ex); 2739 } 2740 2741 return selectorType == null ? null : new SelectorTypeObject(selectorType); 2742 } 2743 2744 @GraphQLField 2745 @GraphQLName("selectorTypes") 2746 static Collection<SelectorTypeObject> selectorTypes(final DataFetchingEnvironment env, 2747 @GraphQLName("selectorKindName") @GraphQLNonNull final String selectorKindName) { 2748 Collection<SelectorType> selectorTypes; 2749 Collection<SelectorTypeObject> selectorTypeObjects; 2750 2751 try { 2752 var commandForm = SelectorUtil.getHome().getGetSelectorTypesForm(); 2753 2754 commandForm.setSelectorKindName(selectorKindName); 2755 2756 selectorTypes = CDI.current().select(GetSelectorTypesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2757 } catch (NamingException ex) { 2758 throw new RuntimeException(ex); 2759 } 2760 2761 if(selectorTypes == null) { 2762 selectorTypeObjects = emptyList(); 2763 } else { 2764 selectorTypeObjects = new ArrayList<>(selectorTypes.size()); 2765 2766 selectorTypes.stream() 2767 .map(SelectorTypeObject::new) 2768 .forEachOrdered(selectorTypeObjects::add); 2769 } 2770 2771 return selectorTypeObjects; 2772 } 2773 2774 @GraphQLField 2775 @GraphQLName("selector") 2776 static SelectorObject selector(final DataFetchingEnvironment env, 2777 @GraphQLName("selectorKindName") final String selectorKindName, 2778 @GraphQLName("selectorTypeName") final String selectorTypeName, 2779 @GraphQLName("selectorName") final String selectorName, 2780 @GraphQLName("id") @GraphQLID final String id) { 2781 Selector selector; 2782 2783 try { 2784 var commandForm = SelectorUtil.getHome().getGetSelectorForm(); 2785 2786 commandForm.setSelectorKindName(selectorKindName); 2787 commandForm.setSelectorTypeName(selectorTypeName); 2788 commandForm.setSelectorName(selectorName); 2789 commandForm.setUuid(id); 2790 2791 selector = CDI.current().select(GetSelectorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2792 } catch (NamingException ex) { 2793 throw new RuntimeException(ex); 2794 } 2795 2796 return selector == null ? null : new SelectorObject(selector); 2797 } 2798 2799 @GraphQLField 2800 @GraphQLName("selectors") 2801 static Collection<SelectorObject> selectors(final DataFetchingEnvironment env, 2802 @GraphQLName("selectorKindName") @GraphQLNonNull final String selectorKindName, 2803 @GraphQLName("selectorTypeName") @GraphQLNonNull final String selectorTypeName) { 2804 Collection<Selector> selectors; 2805 Collection<SelectorObject> selectorObjects; 2806 2807 try { 2808 var commandForm = SelectorUtil.getHome().getGetSelectorsForm(); 2809 2810 commandForm.setSelectorKindName(selectorKindName); 2811 commandForm.setSelectorTypeName(selectorTypeName); 2812 2813 selectors = CDI.current().select(GetSelectorsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2814 } catch (NamingException ex) { 2815 throw new RuntimeException(ex); 2816 } 2817 2818 if(selectors == null) { 2819 selectorObjects = emptyList(); 2820 } else { 2821 selectorObjects = new ArrayList<>(selectors.size()); 2822 2823 selectors.stream() 2824 .map(SelectorObject::new) 2825 .forEachOrdered(selectorObjects::add); 2826 } 2827 2828 return selectorObjects; 2829 } 2830 2831 @GraphQLField 2832 @GraphQLName("filterKind") 2833 static FilterKindObject filterKind(final DataFetchingEnvironment env, 2834 @GraphQLName("filterKindName") final String filterKindName, 2835 @GraphQLName("id") @GraphQLID final String id) { 2836 FilterKind filterKind; 2837 2838 try { 2839 var commandForm = FilterUtil.getHome().getGetFilterKindForm(); 2840 2841 commandForm.setFilterKindName(filterKindName); 2842 commandForm.setUuid(id); 2843 2844 filterKind = CDI.current().select(GetFilterKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2845 } catch (NamingException ex) { 2846 throw new RuntimeException(ex); 2847 } 2848 2849 return filterKind == null ? null : new FilterKindObject(filterKind); 2850 } 2851 2852 @GraphQLField 2853 @GraphQLName("filterKinds") 2854 @GraphQLNonNull 2855 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2856 static CountingPaginatedData<FilterKindObject> filterKinds(final DataFetchingEnvironment env) { 2857 CountingPaginatedData<FilterKindObject> data; 2858 2859 try { 2860 var commandForm = FilterUtil.getHome().getGetFilterKindsForm(); 2861 var command = CDI.current().select(GetFilterKindsCommand.class).get(); 2862 2863 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2864 if(totalEntities == null) { 2865 data = Connections.emptyConnection(); 2866 } else { 2867 try(var objectLimiter = new ObjectLimiter(env, FilterKindConstants.COMPONENT_VENDOR_NAME, FilterKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 2868 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2869 2870 var filterKinds = entities.stream() 2871 .map(FilterKindObject::new) 2872 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2873 2874 data = new CountedObjects<>(objectLimiter, filterKinds); 2875 } 2876 } 2877 } catch (NamingException ex) { 2878 throw new RuntimeException(ex); 2879 } 2880 2881 return data; 2882 } 2883 2884 @GraphQLField 2885 @GraphQLName("filterType") 2886 static FilterTypeObject filterType(final DataFetchingEnvironment env, 2887 @GraphQLName("filterKindName") final String filterKindName, 2888 @GraphQLName("filterTypeName") final String filterTypeName, 2889 @GraphQLName("id") @GraphQLID final String id) { 2890 FilterType filterType; 2891 2892 try { 2893 var commandForm = FilterUtil.getHome().getGetFilterTypeForm(); 2894 2895 commandForm.setFilterKindName(filterKindName); 2896 commandForm.setFilterTypeName(filterTypeName); 2897 commandForm.setUuid(id); 2898 2899 filterType = CDI.current().select(GetFilterTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2900 } catch (NamingException ex) { 2901 throw new RuntimeException(ex); 2902 } 2903 2904 return filterType == null ? null : new FilterTypeObject(filterType); 2905 } 2906 2907 @GraphQLField 2908 @GraphQLName("filterTypes") 2909 @GraphQLNonNull 2910 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2911 static CountingPaginatedData<FilterTypeObject> filterTypes(final DataFetchingEnvironment env, 2912 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName) { 2913 CountingPaginatedData<FilterTypeObject> data; 2914 2915 try { 2916 var commandForm = FilterUtil.getHome().getGetFilterTypesForm(); 2917 var command = CDI.current().select(GetFilterTypesCommand.class).get(); 2918 2919 commandForm.setFilterKindName(filterKindName); 2920 2921 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2922 if(totalEntities == null) { 2923 data = Connections.emptyConnection(); 2924 } else { 2925 try(var objectLimiter = new ObjectLimiter(env, FilterTypeConstants.COMPONENT_VENDOR_NAME, FilterTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 2926 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2927 2928 var filterTypes = entities.stream() 2929 .map(FilterTypeObject::new) 2930 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2931 2932 data = new CountedObjects<>(objectLimiter, filterTypes); 2933 } 2934 } 2935 } catch (NamingException ex) { 2936 throw new RuntimeException(ex); 2937 } 2938 2939 return data; 2940 } 2941 2942 @GraphQLField 2943 @GraphQLName("filter") 2944 static FilterObject filter(final DataFetchingEnvironment env, 2945 @GraphQLName("filterKindName") final String filterKindName, 2946 @GraphQLName("filterTypeName") final String filterTypeName, 2947 @GraphQLName("filterName") final String filterName, 2948 @GraphQLName("id") @GraphQLID final String id) { 2949 Filter filter; 2950 2951 try { 2952 var commandForm = FilterUtil.getHome().getGetFilterForm(); 2953 2954 commandForm.setFilterKindName(filterKindName); 2955 commandForm.setFilterTypeName(filterTypeName); 2956 commandForm.setFilterName(filterName); 2957 commandForm.setUuid(id); 2958 2959 filter = CDI.current().select(GetFilterCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 2960 } catch (NamingException ex) { 2961 throw new RuntimeException(ex); 2962 } 2963 2964 return filter == null ? null : new FilterObject(filter); 2965 } 2966 2967 @GraphQLField 2968 @GraphQLName("filters") 2969 @GraphQLNonNull 2970 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 2971 static CountingPaginatedData<FilterObject> filters(final DataFetchingEnvironment env, 2972 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 2973 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName) { 2974 CountingPaginatedData<FilterObject> data; 2975 2976 try { 2977 var commandForm = FilterUtil.getHome().getGetFiltersForm(); 2978 var command = CDI.current().select(GetFiltersCommand.class).get(); 2979 2980 commandForm.setFilterKindName(filterKindName); 2981 commandForm.setFilterTypeName(filterTypeName); 2982 2983 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2984 if(totalEntities == null) { 2985 data = Connections.emptyConnection(); 2986 } else { 2987 try(var objectLimiter = new ObjectLimiter(env, FilterConstants.COMPONENT_VENDOR_NAME, FilterConstants.ENTITY_TYPE_NAME, totalEntities)) { 2988 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 2989 2990 var filters = entities.stream() 2991 .map(FilterObject::new) 2992 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 2993 2994 data = new CountedObjects<>(objectLimiter, filters); 2995 } 2996 } 2997 } catch (NamingException ex) { 2998 throw new RuntimeException(ex); 2999 } 3000 3001 return data; 3002 } 3003 3004 @GraphQLField 3005 @GraphQLName("filterEntranceStep") 3006 static FilterEntranceStepObject filterEntranceStep(final DataFetchingEnvironment env, 3007 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3008 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3009 @GraphQLName("filterName") @GraphQLNonNull final String filterName, 3010 @GraphQLName("filterStepName") @GraphQLNonNull final String filterStepName) { 3011 FilterEntranceStep filterEntranceStep; 3012 3013 try { 3014 var commandForm = FilterUtil.getHome().getGetFilterEntranceStepForm(); 3015 3016 commandForm.setFilterKindName(filterKindName); 3017 commandForm.setFilterTypeName(filterTypeName); 3018 commandForm.setFilterName(filterName); 3019 commandForm.setFilterStepName(filterStepName); 3020 3021 filterEntranceStep = CDI.current().select(GetFilterEntranceStepCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3022 } catch (NamingException ex) { 3023 throw new RuntimeException(ex); 3024 } 3025 3026 return filterEntranceStep == null ? null : new FilterEntranceStepObject(filterEntranceStep); 3027 } 3028 3029 @GraphQLField 3030 @GraphQLName("filterEntranceSteps") 3031 @GraphQLNonNull 3032 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3033 static CountingPaginatedData<FilterEntranceStepObject> filterEntranceSteps(final DataFetchingEnvironment env, 3034 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3035 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3036 @GraphQLName("filterName") @GraphQLNonNull final String filterName) { 3037 CountingPaginatedData<FilterEntranceStepObject> data; 3038 3039 try { 3040 var commandForm = FilterUtil.getHome().getGetFilterEntranceStepsForm(); 3041 var command = CDI.current().select(GetFilterEntranceStepsCommand.class).get(); 3042 3043 commandForm.setFilterKindName(filterKindName); 3044 commandForm.setFilterTypeName(filterTypeName); 3045 commandForm.setFilterName(filterName); 3046 3047 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3048 if(totalEntities == null) { 3049 data = Connections.emptyConnection(); 3050 } else { 3051 try(var objectLimiter = new ObjectLimiter(env, FilterEntranceStepConstants.COMPONENT_VENDOR_NAME, FilterEntranceStepConstants.ENTITY_TYPE_NAME, totalEntities)) { 3052 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3053 3054 var filterEntranceSteps = entities.stream() 3055 .map(FilterEntranceStepObject::new) 3056 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3057 3058 data = new CountedObjects<>(objectLimiter, filterEntranceSteps); 3059 } 3060 } 3061 } catch (NamingException ex) { 3062 throw new RuntimeException(ex); 3063 } 3064 3065 return data; 3066 } 3067 3068 @GraphQLField 3069 @GraphQLName("filterStep") 3070 static FilterStepObject filterStep(final DataFetchingEnvironment env, 3071 @GraphQLName("filterKindName") final String filterKindName, 3072 @GraphQLName("filterTypeName") final String filterTypeName, 3073 @GraphQLName("filterName") final String filterName, 3074 @GraphQLName("filterStepName") final String filterStepName, 3075 @GraphQLName("id") @GraphQLID final String id) { 3076 FilterStep filterStep; 3077 3078 try { 3079 var commandForm = FilterUtil.getHome().getGetFilterStepForm(); 3080 3081 commandForm.setFilterKindName(filterKindName); 3082 commandForm.setFilterTypeName(filterTypeName); 3083 commandForm.setFilterName(filterName); 3084 commandForm.setFilterStepName(filterStepName); 3085 commandForm.setUuid(id); 3086 3087 filterStep = CDI.current().select(GetFilterStepCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3088 } catch (NamingException ex) { 3089 throw new RuntimeException(ex); 3090 } 3091 3092 return filterStep == null ? null : new FilterStepObject(filterStep); 3093 } 3094 3095 @GraphQLField 3096 @GraphQLName("filterSteps") 3097 @GraphQLNonNull 3098 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3099 static CountingPaginatedData<FilterStepObject> filterSteps(final DataFetchingEnvironment env, 3100 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3101 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3102 @GraphQLName("filterName") @GraphQLNonNull final String filterName) { 3103 CountingPaginatedData<FilterStepObject> data; 3104 3105 try { 3106 var commandForm = FilterUtil.getHome().getGetFilterStepsForm(); 3107 var command = CDI.current().select(GetFilterStepsCommand.class).get(); 3108 3109 commandForm.setFilterKindName(filterKindName); 3110 commandForm.setFilterTypeName(filterTypeName); 3111 commandForm.setFilterName(filterName); 3112 3113 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3114 if(totalEntities == null) { 3115 data = Connections.emptyConnection(); 3116 } else { 3117 try(var objectLimiter = new ObjectLimiter(env, FilterStepConstants.COMPONENT_VENDOR_NAME, FilterStepConstants.ENTITY_TYPE_NAME, totalEntities)) { 3118 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3119 3120 var filterSteps = entities.stream() 3121 .map(FilterStepObject::new) 3122 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3123 3124 data = new CountedObjects<>(objectLimiter, filterSteps); 3125 } 3126 } 3127 } catch (NamingException ex) { 3128 throw new RuntimeException(ex); 3129 } 3130 3131 return data; 3132 } 3133 3134 @GraphQLField 3135 @GraphQLName("filterStepElement") 3136 static FilterStepElementObject filterStepElement(final DataFetchingEnvironment env, 3137 @GraphQLName("filterKindName") final String filterKindName, 3138 @GraphQLName("filterTypeName") final String filterTypeName, 3139 @GraphQLName("filterName") final String filterName, 3140 @GraphQLName("filterStepName") final String filterStepName, 3141 @GraphQLName("filterStepElementName") final String filterStepElementName, 3142 @GraphQLName("id") @GraphQLID final String id) { 3143 FilterStepElement filterStepElement; 3144 3145 try { 3146 var commandForm = FilterUtil.getHome().getGetFilterStepElementForm(); 3147 3148 commandForm.setFilterKindName(filterKindName); 3149 commandForm.setFilterTypeName(filterTypeName); 3150 commandForm.setFilterName(filterName); 3151 commandForm.setFilterStepName(filterStepName); 3152 commandForm.setFilterStepElementName(filterStepElementName); 3153 commandForm.setUuid(id); 3154 3155 filterStepElement = CDI.current().select(GetFilterStepElementCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3156 } catch (NamingException ex) { 3157 throw new RuntimeException(ex); 3158 } 3159 3160 return filterStepElement == null ? null : new FilterStepElementObject(filterStepElement); 3161 } 3162 3163 @GraphQLField 3164 @GraphQLName("filterStepElements") 3165 @GraphQLNonNull 3166 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3167 static CountingPaginatedData<FilterStepElementObject> filterStepElements(final DataFetchingEnvironment env, 3168 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3169 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3170 @GraphQLName("filterName") @GraphQLNonNull final String filterName, 3171 @GraphQLName("filterStepName") @GraphQLNonNull final String filterStepName) { 3172 CountingPaginatedData<FilterStepElementObject> data; 3173 3174 try { 3175 var commandForm = FilterUtil.getHome().getGetFilterStepElementsForm(); 3176 var command = CDI.current().select(GetFilterStepElementsCommand.class).get(); 3177 3178 commandForm.setFilterKindName(filterKindName); 3179 commandForm.setFilterTypeName(filterTypeName); 3180 commandForm.setFilterName(filterName); 3181 commandForm.setFilterStepName(filterStepName); 3182 3183 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3184 if(totalEntities == null) { 3185 data = Connections.emptyConnection(); 3186 } else { 3187 try(var objectLimiter = new ObjectLimiter(env, FilterStepElementConstants.COMPONENT_VENDOR_NAME, FilterStepElementConstants.ENTITY_TYPE_NAME, totalEntities)) { 3188 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3189 3190 var filterStepElements = entities.stream() 3191 .map(FilterStepElementObject::new) 3192 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3193 3194 data = new CountedObjects<>(objectLimiter, filterStepElements); 3195 } 3196 } 3197 } catch (NamingException ex) { 3198 throw new RuntimeException(ex); 3199 } 3200 3201 return data; 3202 } 3203 3204 @GraphQLField 3205 @GraphQLName("filterStepDestination") 3206 static FilterStepDestinationObject filterStepDestination(final DataFetchingEnvironment env, 3207 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3208 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3209 @GraphQLName("filterName") @GraphQLNonNull final String filterName, 3210 @GraphQLName("fromFilterStepName") @GraphQLNonNull final String fromFilterStepName, 3211 @GraphQLName("toFilterStepName") @GraphQLNonNull final String toFilterStepName) { 3212 FilterStepDestination filterStepDestination; 3213 3214 try { 3215 var commandForm = FilterUtil.getHome().getGetFilterStepDestinationForm(); 3216 3217 commandForm.setFilterKindName(filterKindName); 3218 commandForm.setFilterTypeName(filterTypeName); 3219 commandForm.setFilterName(filterName); 3220 commandForm.setFromFilterStepName(fromFilterStepName); 3221 commandForm.setToFilterStepName(toFilterStepName); 3222 3223 filterStepDestination = CDI.current().select(GetFilterStepDestinationCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3224 } catch (NamingException ex) { 3225 throw new RuntimeException(ex); 3226 } 3227 3228 return filterStepDestination == null ? null : new FilterStepDestinationObject(filterStepDestination); 3229 } 3230 3231 @GraphQLField 3232 @GraphQLName("filterStepDestinations") 3233 @GraphQLNonNull 3234 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3235 static CountingPaginatedData<FilterStepDestinationObject> filterStepDestinations(final DataFetchingEnvironment env, 3236 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3237 @GraphQLName("filterTypeName") @GraphQLNonNull final String filterTypeName, 3238 @GraphQLName("filterName") @GraphQLNonNull final String filterName, 3239 @GraphQLName("fromFilterStepName") final String fromFilterStepName, 3240 @GraphQLName("toFilterStepName") final String toFilterStepName) { 3241 CountingPaginatedData<FilterStepDestinationObject> data; 3242 3243 try { 3244 var commandForm = FilterUtil.getHome().getGetFilterStepDestinationsForm(); 3245 var command = CDI.current().select(GetFilterStepDestinationsCommand.class).get(); 3246 3247 commandForm.setFilterKindName(filterKindName); 3248 commandForm.setFilterTypeName(filterTypeName); 3249 commandForm.setFilterName(filterName); 3250 commandForm.setFromFilterStepName(fromFilterStepName); 3251 commandForm.setToFilterStepName(toFilterStepName); 3252 3253 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3254 if(totalEntities == null) { 3255 data = Connections.emptyConnection(); 3256 } else { 3257 try(var objectLimiter = new ObjectLimiter(env, FilterStepDestinationConstants.COMPONENT_VENDOR_NAME, FilterStepDestinationConstants.ENTITY_TYPE_NAME, totalEntities)) { 3258 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3259 3260 var filterStepDestinations = entities.stream() 3261 .map(FilterStepDestinationObject::new) 3262 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3263 3264 data = new CountedObjects<>(objectLimiter, filterStepDestinations); 3265 } 3266 } 3267 } catch (NamingException ex) { 3268 throw new RuntimeException(ex); 3269 } 3270 3271 return data; 3272 } 3273 3274 @GraphQLField 3275 @GraphQLName("filterAdjustmentSource") 3276 static FilterAdjustmentSourceObject filterAdjustmentSource(final DataFetchingEnvironment env, 3277 @GraphQLName("filterAdjustmentSourceName") @GraphQLNonNull final String filterAdjustmentSourceName) { 3278 FilterAdjustmentSource filterAdjustmentSource; 3279 3280 try { 3281 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentSourceForm(); 3282 3283 commandForm.setFilterAdjustmentSourceName(filterAdjustmentSourceName); 3284 3285 filterAdjustmentSource = CDI.current().select(GetFilterAdjustmentSourceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3286 } catch (NamingException ex) { 3287 throw new RuntimeException(ex); 3288 } 3289 3290 return filterAdjustmentSource == null ? null : new FilterAdjustmentSourceObject(filterAdjustmentSource); 3291 } 3292 3293 @GraphQLField 3294 @GraphQLName("filterAdjustmentSources") 3295 @GraphQLNonNull 3296 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3297 static CountingPaginatedData<FilterAdjustmentSourceObject> filterAdjustmentSources(final DataFetchingEnvironment env) { 3298 CountingPaginatedData<FilterAdjustmentSourceObject> data; 3299 3300 try { 3301 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentSourcesForm(); 3302 var command = CDI.current().select(GetFilterAdjustmentSourcesCommand.class).get(); 3303 3304 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3305 if(totalEntities == null) { 3306 data = Connections.emptyConnection(); 3307 } else { 3308 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)) { 3309 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3310 3311 var filterAdjustmentSources = entities.stream() 3312 .map(FilterAdjustmentSourceObject::new) 3313 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3314 3315 data = new CountedObjects<>(objectLimiter, filterAdjustmentSources); 3316 } 3317 } 3318 } catch (NamingException ex) { 3319 throw new RuntimeException(ex); 3320 } 3321 3322 return data; 3323 } 3324 3325 @GraphQLField 3326 @GraphQLName("filterAdjustmentType") 3327 static FilterAdjustmentTypeObject filterAdjustmentType(final DataFetchingEnvironment env, 3328 @GraphQLName("filterAdjustmentTypeName") @GraphQLNonNull final String filterAdjustmentTypeName) { 3329 FilterAdjustmentType filterAdjustmentType; 3330 3331 try { 3332 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentTypeForm(); 3333 3334 commandForm.setFilterAdjustmentTypeName(filterAdjustmentTypeName); 3335 3336 filterAdjustmentType = CDI.current().select(GetFilterAdjustmentTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3337 } catch (NamingException ex) { 3338 throw new RuntimeException(ex); 3339 } 3340 3341 return filterAdjustmentType == null ? null : new FilterAdjustmentTypeObject(filterAdjustmentType); 3342 } 3343 3344 @GraphQLField 3345 @GraphQLName("filterAdjustmentTypes") 3346 @GraphQLNonNull 3347 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3348 static CountingPaginatedData<FilterAdjustmentTypeObject> filterAdjustmentTypes(final DataFetchingEnvironment env) { 3349 CountingPaginatedData<FilterAdjustmentTypeObject> data; 3350 3351 try { 3352 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentTypesForm(); 3353 var command = CDI.current().select(GetFilterAdjustmentTypesCommand.class).get(); 3354 3355 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3356 if(totalEntities == null) { 3357 data = Connections.emptyConnection(); 3358 } else { 3359 try(var objectLimiter = new ObjectLimiter(env, FilterAdjustmentTypeConstants.COMPONENT_VENDOR_NAME, FilterAdjustmentTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 3360 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3361 3362 var filterAdjustmentTypes = entities.stream() 3363 .map(FilterAdjustmentTypeObject::new) 3364 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3365 3366 data = new CountedObjects<>(objectLimiter, filterAdjustmentTypes); 3367 } 3368 } 3369 } catch (NamingException ex) { 3370 throw new RuntimeException(ex); 3371 } 3372 3373 return data; 3374 } 3375 3376 @GraphQLField 3377 @GraphQLName("filterAdjustment") 3378 static FilterAdjustmentObject filterAdjustment(final DataFetchingEnvironment env, 3379 @GraphQLName("filterKindName") final String filterKindName, 3380 @GraphQLName("filterAdjustmentName") final String filterAdjustmentName, 3381 @GraphQLName("id") @GraphQLID final String id) { 3382 FilterAdjustment filterAdjustment; 3383 3384 try { 3385 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentForm(); 3386 3387 commandForm.setFilterKindName(filterKindName); 3388 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3389 commandForm.setUuid(id); 3390 3391 filterAdjustment = CDI.current().select(GetFilterAdjustmentCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3392 } catch (NamingException ex) { 3393 throw new RuntimeException(ex); 3394 } 3395 3396 return filterAdjustment == null ? null : new FilterAdjustmentObject(filterAdjustment); 3397 } 3398 3399 @GraphQLField 3400 @GraphQLName("filterAdjustments") 3401 static Collection<FilterAdjustmentObject> filterAdjustments(final DataFetchingEnvironment env, 3402 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName) { 3403 Collection<FilterAdjustment> filterAdjustments; 3404 Collection<FilterAdjustmentObject> filterAdjustmentObjects; 3405 3406 try { 3407 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentsForm(); 3408 3409 commandForm.setFilterKindName(filterKindName); 3410 3411 filterAdjustments = CDI.current().select(GetFilterAdjustmentsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3412 } catch (NamingException ex) { 3413 throw new RuntimeException(ex); 3414 } 3415 3416 if(filterAdjustments == null) { 3417 filterAdjustmentObjects = emptyList(); 3418 } else { 3419 filterAdjustmentObjects = new ArrayList<>(filterAdjustments.size()); 3420 3421 filterAdjustments.stream() 3422 .map(FilterAdjustmentObject::new) 3423 .forEachOrdered(filterAdjustmentObjects::add); 3424 } 3425 3426 return filterAdjustmentObjects; 3427 } 3428 3429 @GraphQLField 3430 @GraphQLName("filterAdjustmentAmount") 3431 static FilterAdjustmentAmountObject filterAdjustmentAmount(final DataFetchingEnvironment env, 3432 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3433 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName, 3434 @GraphQLName("unitOfMeasureName") final String unitOfMeasureName, 3435 @GraphQLName("unitOfMeasureKindName") final String unitOfMeasureKindName, 3436 @GraphQLName("unitOfMeasureTypeName") final String unitOfMeasureTypeName, 3437 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 3438 FilterAdjustmentAmount filterAdjustmentAmount; 3439 3440 try { 3441 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentAmountForm(); 3442 3443 commandForm.setFilterKindName(filterKindName); 3444 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3445 commandForm.setUnitOfMeasureName(unitOfMeasureName); 3446 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 3447 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 3448 commandForm.setCurrencyIsoName(currencyIsoName); 3449 3450 filterAdjustmentAmount = CDI.current().select(GetFilterAdjustmentAmountCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3451 } catch (NamingException ex) { 3452 throw new RuntimeException(ex); 3453 } 3454 3455 return filterAdjustmentAmount == null ? null : new FilterAdjustmentAmountObject(filterAdjustmentAmount); 3456 } 3457 3458 @GraphQLField 3459 @GraphQLName("filterAdjustmentAmounts") 3460 static Collection<FilterAdjustmentAmountObject> filterAdjustmentAmounts(final DataFetchingEnvironment env, 3461 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3462 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName) { 3463 Collection<FilterAdjustmentAmount> filterAdjustmentAmounts; 3464 Collection<FilterAdjustmentAmountObject> filterAdjustmentAmountObjects; 3465 3466 try { 3467 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentAmountsForm(); 3468 3469 commandForm.setFilterKindName(filterKindName); 3470 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3471 3472 filterAdjustmentAmounts = CDI.current().select(GetFilterAdjustmentAmountsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3473 } catch (NamingException ex) { 3474 throw new RuntimeException(ex); 3475 } 3476 3477 if(filterAdjustmentAmounts == null) { 3478 filterAdjustmentAmountObjects = emptyList(); 3479 } else { 3480 filterAdjustmentAmountObjects = new ArrayList<>(filterAdjustmentAmounts.size()); 3481 3482 filterAdjustmentAmounts.stream() 3483 .map(FilterAdjustmentAmountObject::new) 3484 .forEachOrdered(filterAdjustmentAmountObjects::add); 3485 } 3486 3487 return filterAdjustmentAmountObjects; 3488 } 3489 3490 @GraphQLField 3491 @GraphQLName("filterAdjustmentFixedAmount") 3492 static FilterAdjustmentFixedAmountObject filterAdjustmentFixedAmount(final DataFetchingEnvironment env, 3493 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3494 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName, 3495 @GraphQLName("unitOfMeasureName") final String unitOfMeasureName, 3496 @GraphQLName("unitOfMeasureKindName") final String unitOfMeasureKindName, 3497 @GraphQLName("unitOfMeasureTypeName") final String unitOfMeasureTypeName, 3498 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 3499 FilterAdjustmentFixedAmount filterAdjustmentFixedAmount; 3500 3501 try { 3502 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentFixedAmountForm(); 3503 3504 commandForm.setFilterKindName(filterKindName); 3505 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3506 commandForm.setUnitOfMeasureName(unitOfMeasureName); 3507 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 3508 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 3509 commandForm.setCurrencyIsoName(currencyIsoName); 3510 3511 filterAdjustmentFixedAmount = CDI.current().select(GetFilterAdjustmentFixedAmountCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3512 } catch (NamingException ex) { 3513 throw new RuntimeException(ex); 3514 } 3515 3516 return filterAdjustmentFixedAmount == null ? null : new FilterAdjustmentFixedAmountObject(filterAdjustmentFixedAmount); 3517 } 3518 3519 @GraphQLField 3520 @GraphQLName("filterAdjustmentFixedAmounts") 3521 static Collection<FilterAdjustmentFixedAmountObject> filterAdjustmentFixedAmounts(final DataFetchingEnvironment env, 3522 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3523 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName) { 3524 Collection<FilterAdjustmentFixedAmount> filterAdjustmentFixedAmounts; 3525 Collection<FilterAdjustmentFixedAmountObject> filterAdjustmentFixedAmountObjects; 3526 3527 try { 3528 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentFixedAmountsForm(); 3529 3530 commandForm.setFilterKindName(filterKindName); 3531 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3532 3533 filterAdjustmentFixedAmounts = CDI.current().select(GetFilterAdjustmentFixedAmountsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3534 } catch (NamingException ex) { 3535 throw new RuntimeException(ex); 3536 } 3537 3538 if(filterAdjustmentFixedAmounts == null) { 3539 filterAdjustmentFixedAmountObjects = emptyList(); 3540 } else { 3541 filterAdjustmentFixedAmountObjects = new ArrayList<>(filterAdjustmentFixedAmounts.size()); 3542 3543 filterAdjustmentFixedAmounts.stream() 3544 .map(FilterAdjustmentFixedAmountObject::new) 3545 .forEachOrdered(filterAdjustmentFixedAmountObjects::add); 3546 } 3547 3548 return filterAdjustmentFixedAmountObjects; 3549 } 3550 3551 @GraphQLField 3552 @GraphQLName("filterAdjustmentPercent") 3553 static FilterAdjustmentPercentObject filterAdjustmentPercent(final DataFetchingEnvironment env, 3554 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3555 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName, 3556 @GraphQLName("unitOfMeasureName") final String unitOfMeasureName, 3557 @GraphQLName("unitOfMeasureKindName") final String unitOfMeasureKindName, 3558 @GraphQLName("unitOfMeasureTypeName") final String unitOfMeasureTypeName, 3559 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 3560 FilterAdjustmentPercent filterAdjustmentPercent; 3561 3562 try { 3563 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentPercentForm(); 3564 3565 commandForm.setFilterKindName(filterKindName); 3566 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3567 commandForm.setUnitOfMeasureName(unitOfMeasureName); 3568 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 3569 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 3570 commandForm.setCurrencyIsoName(currencyIsoName); 3571 3572 filterAdjustmentPercent = CDI.current().select(GetFilterAdjustmentPercentCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3573 } catch (NamingException ex) { 3574 throw new RuntimeException(ex); 3575 } 3576 3577 return filterAdjustmentPercent == null ? null : new FilterAdjustmentPercentObject(filterAdjustmentPercent); 3578 } 3579 3580 @GraphQLField 3581 @GraphQLName("filterAdjustmentPercents") 3582 static Collection<FilterAdjustmentPercentObject> filterAdjustmentPercents(final DataFetchingEnvironment env, 3583 @GraphQLName("filterKindName") @GraphQLNonNull final String filterKindName, 3584 @GraphQLName("filterAdjustmentName") @GraphQLNonNull final String filterAdjustmentName) { 3585 Collection<FilterAdjustmentPercent> filterAdjustmentPercents; 3586 Collection<FilterAdjustmentPercentObject> filterAdjustmentPercentObjects; 3587 3588 try { 3589 var commandForm = FilterUtil.getHome().getGetFilterAdjustmentPercentsForm(); 3590 3591 commandForm.setFilterKindName(filterKindName); 3592 commandForm.setFilterAdjustmentName(filterAdjustmentName); 3593 3594 filterAdjustmentPercents = CDI.current().select(GetFilterAdjustmentPercentsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3595 } catch (NamingException ex) { 3596 throw new RuntimeException(ex); 3597 } 3598 3599 if(filterAdjustmentPercents == null) { 3600 filterAdjustmentPercentObjects = emptyList(); 3601 } else { 3602 filterAdjustmentPercentObjects = new ArrayList<>(filterAdjustmentPercents.size()); 3603 3604 filterAdjustmentPercents.stream() 3605 .map(FilterAdjustmentPercentObject::new) 3606 .forEachOrdered(filterAdjustmentPercentObjects::add); 3607 } 3608 3609 return filterAdjustmentPercentObjects; 3610 } 3611 3612 @GraphQLField 3613 @GraphQLName("offerUse") 3614 static OfferUseObject offerUse(final DataFetchingEnvironment env, 3615 @GraphQLName("offerName") @GraphQLNonNull final String offerName, 3616 @GraphQLName("useName") @GraphQLNonNull final String useName) { 3617 OfferUse offerUse; 3618 3619 try { 3620 var commandForm = OfferUtil.getHome().getGetOfferUseForm(); 3621 3622 commandForm.setOfferName(offerName); 3623 commandForm.setUseName(useName); 3624 3625 offerUse = CDI.current().select(GetOfferUseCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3626 } catch (NamingException ex) { 3627 throw new RuntimeException(ex); 3628 } 3629 3630 return offerUse == null ? null : new OfferUseObject(offerUse); 3631 } 3632 3633 @GraphQLField 3634 @GraphQLName("offerUses") 3635 static Collection<OfferUseObject> offerUses(final DataFetchingEnvironment env, 3636 @GraphQLName("offerName") final String offerName, 3637 @GraphQLName("useName") final String useName) { 3638 Collection<OfferUse> offerUses; 3639 Collection<OfferUseObject> offerUseObjects; 3640 3641 try { 3642 var commandForm = OfferUtil.getHome().getGetOfferUsesForm(); 3643 3644 commandForm.setOfferName(offerName); 3645 commandForm.setUseName(useName); 3646 3647 offerUses = CDI.current().select(GetOfferUsesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3648 } catch (NamingException ex) { 3649 throw new RuntimeException(ex); 3650 } 3651 3652 if(offerUses == null) { 3653 offerUseObjects = emptyList(); 3654 } else { 3655 offerUseObjects = new ArrayList<>(offerUses.size()); 3656 3657 offerUses.stream() 3658 .map(OfferUseObject::new) 3659 .forEachOrdered(offerUseObjects::add); 3660 } 3661 3662 return offerUseObjects; 3663 } 3664 3665 @GraphQLField 3666 @GraphQLName("offer") 3667 static OfferObject offer(final DataFetchingEnvironment env, 3668 @GraphQLName("offerName") final String offerName, 3669 @GraphQLName("id") @GraphQLID final String id) { 3670 Offer offer; 3671 3672 try { 3673 var commandForm = OfferUtil.getHome().getGetOfferForm(); 3674 3675 commandForm.setOfferName(offerName); 3676 commandForm.setUuid(id); 3677 3678 offer = CDI.current().select(GetOfferCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3679 } catch (NamingException ex) { 3680 throw new RuntimeException(ex); 3681 } 3682 3683 return offer == null ? null : new OfferObject(offer); 3684 } 3685 3686 @GraphQLField 3687 @GraphQLName("offers") 3688 @GraphQLNonNull 3689 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3690 static CountingPaginatedData<OfferObject> offers(final DataFetchingEnvironment env) { 3691 CountingPaginatedData<OfferObject> data; 3692 3693 try { 3694 var commandForm = OfferUtil.getHome().getGetOffersForm(); 3695 var command = CDI.current().select(GetOffersCommand.class).get(); 3696 3697 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3698 if(totalEntities == null) { 3699 data = Connections.emptyConnection(); 3700 } else { 3701 try(var objectLimiter = new ObjectLimiter(env, OfferConstants.COMPONENT_VENDOR_NAME, OfferConstants.ENTITY_TYPE_NAME, totalEntities)) { 3702 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3703 3704 var offers = entities.stream() 3705 .map(OfferObject::new) 3706 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3707 3708 data = new CountedObjects<>(objectLimiter, offers); 3709 } 3710 } 3711 } catch (NamingException ex) { 3712 throw new RuntimeException(ex); 3713 } 3714 3715 return data; 3716 } 3717 3718 @GraphQLField 3719 @GraphQLName("offerItem") 3720 static OfferItemObject offerItem(final DataFetchingEnvironment env, 3721 @GraphQLName("offerName") final String offerName, 3722 @GraphQLName("itemName") final String itemName, 3723 @GraphQLName("id") @GraphQLID final String id) { 3724 OfferItem offerItem; 3725 3726 try { 3727 var commandForm = OfferUtil.getHome().getGetOfferItemForm(); 3728 3729 commandForm.setOfferName(offerName); 3730 commandForm.setItemName(itemName); 3731 commandForm.setUuid(id); 3732 3733 offerItem = CDI.current().select(GetOfferItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3734 } catch (NamingException ex) { 3735 throw new RuntimeException(ex); 3736 } 3737 3738 return offerItem == null ? null : new OfferItemObject(offerItem); 3739 } 3740 3741 @GraphQLField 3742 @GraphQLName("offerItems") 3743 static Collection<OfferItemObject> offerItems(final DataFetchingEnvironment env, 3744 @GraphQLName("offerName") @GraphQLNonNull final String offerName) { 3745 Collection<OfferItem> offerItem; 3746 Collection<OfferItemObject> offerItemObjects; 3747 3748 try { 3749 var commandForm = OfferUtil.getHome().getGetOfferItemsForm(); 3750 3751 commandForm.setOfferName(offerName); 3752 3753 offerItem = CDI.current().select(GetOfferItemsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3754 } catch (NamingException ex) { 3755 throw new RuntimeException(ex); 3756 } 3757 3758 if(offerItem == null) { 3759 offerItemObjects = emptyList(); 3760 } else { 3761 offerItemObjects = new ArrayList<>(offerItem.size()); 3762 3763 offerItem.stream() 3764 .map(OfferItemObject::new) 3765 .forEachOrdered(offerItemObjects::add); 3766 } 3767 3768 return offerItemObjects; 3769 } 3770 3771 @GraphQLField 3772 @GraphQLName("offerItemPrice") 3773 static OfferItemPriceObject offerItemPrice(final DataFetchingEnvironment env, 3774 @GraphQLName("offerName") @GraphQLNonNull final String offerName, 3775 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 3776 @GraphQLName("inventoryConditionName") @GraphQLNonNull final String inventoryConditionName, 3777 @GraphQLName("unitOfMeasureTypeName") @GraphQLNonNull final String unitOfMeasureTypeName, 3778 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 3779 OfferItemPrice offerItemPrice; 3780 3781 try { 3782 var commandForm = OfferUtil.getHome().getGetOfferItemPriceForm(); 3783 3784 commandForm.setOfferName(offerName); 3785 commandForm.setItemName(itemName); 3786 commandForm.setInventoryConditionName(inventoryConditionName); 3787 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 3788 commandForm.setCurrencyIsoName(currencyIsoName); 3789 3790 offerItemPrice = CDI.current().select(GetOfferItemPriceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3791 } catch (NamingException ex) { 3792 throw new RuntimeException(ex); 3793 } 3794 3795 return offerItemPrice == null ? null : new OfferItemPriceObject(offerItemPrice); 3796 } 3797 3798 @GraphQLField 3799 @GraphQLName("offerItemPrices") 3800 static Collection<OfferItemPriceObject> offerItemPrices(final DataFetchingEnvironment env, 3801 @GraphQLName("offerName") @GraphQLNonNull final String offerName, 3802 @GraphQLName("itemName") @GraphQLNonNull final String itemName) { 3803 Collection<OfferItemPrice> offerItemPrice; 3804 Collection<OfferItemPriceObject> offerItemPriceObjects; 3805 3806 try { 3807 var commandForm = OfferUtil.getHome().getGetOfferItemPricesForm(); 3808 3809 commandForm.setOfferName(offerName); 3810 commandForm.setItemName(itemName); 3811 3812 offerItemPrice = CDI.current().select(GetOfferItemPricesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3813 } catch (NamingException ex) { 3814 throw new RuntimeException(ex); 3815 } 3816 3817 if(offerItemPrice == null) { 3818 offerItemPriceObjects = emptyList(); 3819 } else { 3820 offerItemPriceObjects = new ArrayList<>(offerItemPrice.size()); 3821 3822 offerItemPrice.stream() 3823 .map(OfferItemPriceObject::new) 3824 .forEachOrdered(offerItemPriceObjects::add); 3825 } 3826 3827 return offerItemPriceObjects; 3828 } 3829 3830 @GraphQLField 3831 @GraphQLName("use") 3832 static UseObject use(final DataFetchingEnvironment env, 3833 @GraphQLName("useName") final String useName, 3834 @GraphQLName("id") @GraphQLID final String id) { 3835 Use use; 3836 3837 try { 3838 var commandForm = OfferUtil.getHome().getGetUseForm(); 3839 3840 commandForm.setUseName(useName); 3841 commandForm.setUuid(id); 3842 3843 use = CDI.current().select(GetUseCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3844 } catch (NamingException ex) { 3845 throw new RuntimeException(ex); 3846 } 3847 3848 return use == null ? null : new UseObject(use); 3849 } 3850 3851 @GraphQLField 3852 @GraphQLName("uses") 3853 @GraphQLNonNull 3854 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3855 static CountingPaginatedData<UseObject> uses(final DataFetchingEnvironment env) { 3856 CountingPaginatedData<UseObject> data; 3857 3858 try { 3859 var commandForm = OfferUtil.getHome().getGetUsesForm(); 3860 var command = CDI.current().select(GetUsesCommand.class).get(); 3861 3862 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3863 if(totalEntities == null) { 3864 data = Connections.emptyConnection(); 3865 } else { 3866 try(var objectLimiter = new ObjectLimiter(env, UseConstants.COMPONENT_VENDOR_NAME, UseConstants.ENTITY_TYPE_NAME, totalEntities)) { 3867 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3868 3869 var uses = entities.stream() 3870 .map(UseObject::new) 3871 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3872 3873 data = new CountedObjects<>(objectLimiter, uses); 3874 } 3875 } 3876 } catch (NamingException ex) { 3877 throw new RuntimeException(ex); 3878 } 3879 3880 return data; 3881 } 3882 3883 @GraphQLField 3884 @GraphQLName("offerNameElement") 3885 static OfferNameElementObject offerNameElement(final DataFetchingEnvironment env, 3886 @GraphQLName("offerNameElementName") final String offerNameElementName, 3887 @GraphQLName("id") @GraphQLID final String id) { 3888 OfferNameElement offerNameElement; 3889 3890 try { 3891 var commandForm = OfferUtil.getHome().getGetOfferNameElementForm(); 3892 3893 commandForm.setOfferNameElementName(offerNameElementName); 3894 commandForm.setUuid(id); 3895 3896 offerNameElement = CDI.current().select(GetOfferNameElementCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3897 } catch (NamingException ex) { 3898 throw new RuntimeException(ex); 3899 } 3900 3901 return offerNameElement == null ? null : new OfferNameElementObject(offerNameElement); 3902 } 3903 3904 @GraphQLField 3905 @GraphQLName("offerNameElements") 3906 @GraphQLNonNull 3907 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3908 static CountingPaginatedData<OfferNameElementObject> offerNameElements(final DataFetchingEnvironment env) { 3909 CountingPaginatedData<OfferNameElementObject> data; 3910 3911 try { 3912 var commandForm = OfferUtil.getHome().getGetOfferNameElementsForm(); 3913 var command = CDI.current().select(GetOfferNameElementsCommand.class).get(); 3914 3915 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3916 if(totalEntities == null) { 3917 data = Connections.emptyConnection(); 3918 } else { 3919 try(var objectLimiter = new ObjectLimiter(env, OfferNameElementConstants.COMPONENT_VENDOR_NAME, OfferNameElementConstants.ENTITY_TYPE_NAME, totalEntities)) { 3920 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3921 3922 var offerNameElementObjects = entities.stream() 3923 .map(OfferNameElementObject::new) 3924 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3925 3926 data = new CountedObjects<>(objectLimiter, offerNameElementObjects); 3927 } 3928 } 3929 } catch (NamingException ex) { 3930 throw new RuntimeException(ex); 3931 } 3932 3933 return data; 3934 } 3935 3936 @GraphQLField 3937 @GraphQLName("useNameElement") 3938 static UseNameElementObject useNameElement(final DataFetchingEnvironment env, 3939 @GraphQLName("useNameElementName") final String useNameElementName, 3940 @GraphQLName("id") @GraphQLID final String id) { 3941 UseNameElement useNameElement; 3942 3943 try { 3944 var commandForm = OfferUtil.getHome().getGetUseNameElementForm(); 3945 3946 commandForm.setUseNameElementName(useNameElementName); 3947 commandForm.setUuid(id); 3948 3949 useNameElement = CDI.current().select(GetUseNameElementCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 3950 } catch (NamingException ex) { 3951 throw new RuntimeException(ex); 3952 } 3953 3954 return useNameElement == null ? null : new UseNameElementObject(useNameElement); 3955 } 3956 3957 @GraphQLField 3958 @GraphQLName("useNameElements") 3959 @GraphQLNonNull 3960 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 3961 static CountingPaginatedData<UseNameElementObject> useNameElements(final DataFetchingEnvironment env) { 3962 CountingPaginatedData<UseNameElementObject> data; 3963 3964 try { 3965 var commandForm = OfferUtil.getHome().getGetUseNameElementsForm(); 3966 var command = CDI.current().select(GetUseNameElementsCommand.class).get(); 3967 3968 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3969 if(totalEntities == null) { 3970 data = Connections.emptyConnection(); 3971 } else { 3972 try(var objectLimiter = new ObjectLimiter(env, UseNameElementConstants.COMPONENT_VENDOR_NAME, UseNameElementConstants.ENTITY_TYPE_NAME, totalEntities)) { 3973 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 3974 3975 var useNameElementObjects = entities.stream() 3976 .map(UseNameElementObject::new) 3977 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 3978 3979 data = new CountedObjects<>(objectLimiter, useNameElementObjects); 3980 } 3981 } 3982 } catch (NamingException ex) { 3983 throw new RuntimeException(ex); 3984 } 3985 3986 return data; 3987 } 3988 3989 @GraphQLField 3990 @GraphQLName("useType") 3991 static UseTypeObject useType(final DataFetchingEnvironment env, 3992 @GraphQLName("useTypeName") final String useTypeName, 3993 @GraphQLName("id") @GraphQLID final String id) { 3994 UseType useType; 3995 3996 try { 3997 var commandForm = OfferUtil.getHome().getGetUseTypeForm(); 3998 3999 commandForm.setUseTypeName(useTypeName); 4000 commandForm.setUuid(id); 4001 4002 useType = CDI.current().select(GetUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4003 } catch (NamingException ex) { 4004 throw new RuntimeException(ex); 4005 } 4006 4007 return useType == null ? null : new UseTypeObject(useType); 4008 } 4009 4010 @GraphQLField 4011 @GraphQLName("useTypes") 4012 @GraphQLNonNull 4013 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4014 static CountingPaginatedData<UseTypeObject> useTypes(final DataFetchingEnvironment env) { 4015 CountingPaginatedData<UseTypeObject> data; 4016 4017 try { 4018 var commandForm = OfferUtil.getHome().getGetUseTypesForm(); 4019 var command = CDI.current().select(GetUseTypesCommand.class).get(); 4020 4021 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4022 if(totalEntities == null) { 4023 data = Connections.emptyConnection(); 4024 } else { 4025 try(var objectLimiter = new ObjectLimiter(env, UseTypeConstants.COMPONENT_VENDOR_NAME, UseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4026 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4027 4028 var useTypes = entities.stream() 4029 .map(UseTypeObject::new) 4030 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4031 4032 data = new CountedObjects<>(objectLimiter, useTypes); 4033 } 4034 } 4035 } catch (NamingException ex) { 4036 throw new RuntimeException(ex); 4037 } 4038 4039 return data; 4040 } 4041 4042 @GraphQLField 4043 @GraphQLName("freeOnBoard") 4044 static FreeOnBoardObject freeOnBoard(final DataFetchingEnvironment env, 4045 @GraphQLName("freeOnBoardName") final String freeOnBoardName, 4046 @GraphQLName("id") @GraphQLID final String id) { 4047 FreeOnBoard freeOnBoard; 4048 4049 try { 4050 var commandForm = ShipmentUtil.getHome().getGetFreeOnBoardForm(); 4051 4052 commandForm.setFreeOnBoardName(freeOnBoardName); 4053 commandForm.setUuid(id); 4054 4055 freeOnBoard = CDI.current().select(GetFreeOnBoardCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4056 } catch (NamingException ex) { 4057 throw new RuntimeException(ex); 4058 } 4059 4060 return freeOnBoard == null ? null : new FreeOnBoardObject(freeOnBoard); 4061 } 4062 4063 @GraphQLField 4064 @GraphQLName("freeOnBoards") 4065 @GraphQLNonNull 4066 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4067 static CountingPaginatedData<FreeOnBoardObject> freeOnBoards(final DataFetchingEnvironment env) { 4068 CountingPaginatedData<FreeOnBoardObject> data; 4069 4070 try { 4071 var commandForm = ShipmentUtil.getHome().getGetFreeOnBoardsForm(); 4072 var command = CDI.current().select(GetFreeOnBoardsCommand.class).get(); 4073 4074 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4075 if(totalEntities == null) { 4076 data = Connections.emptyConnection(); 4077 } else { 4078 try(var objectLimiter = new ObjectLimiter(env, FreeOnBoardConstants.COMPONENT_VENDOR_NAME, FreeOnBoardConstants.ENTITY_TYPE_NAME, totalEntities)) { 4079 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4080 4081 var freeOnBoards = entities.stream() 4082 .map(FreeOnBoardObject::new) 4083 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4084 4085 data = new CountedObjects<>(objectLimiter, freeOnBoards); 4086 } 4087 } 4088 } catch (NamingException ex) { 4089 throw new RuntimeException(ex); 4090 } 4091 4092 return data; 4093 } 4094 4095 @GraphQLField 4096 @GraphQLName("paymentProcessorTypeCodeType") 4097 static PaymentProcessorTypeCodeTypeObject paymentProcessorTypeCodeType(final DataFetchingEnvironment env, 4098 @GraphQLName("paymentProcessorTypeName") final String paymentProcessorTypeName, 4099 @GraphQLName("paymentProcessorTypeCodeTypeName") final String paymentProcessorTypeCodeTypeName, 4100 @GraphQLName("id") @GraphQLID final String id) { 4101 PaymentProcessorTypeCodeType paymentProcessorTypeCodeType; 4102 4103 try { 4104 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTypeCodeTypeForm(); 4105 4106 commandForm.setPaymentProcessorTypeName(paymentProcessorTypeName); 4107 commandForm.setPaymentProcessorTypeCodeTypeName(paymentProcessorTypeCodeTypeName); 4108 commandForm.setUuid(id); 4109 4110 paymentProcessorTypeCodeType = CDI.current().select(GetPaymentProcessorTypeCodeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4111 } catch (NamingException ex) { 4112 throw new RuntimeException(ex); 4113 } 4114 4115 return paymentProcessorTypeCodeType == null ? null : new PaymentProcessorTypeCodeTypeObject(paymentProcessorTypeCodeType); 4116 } 4117 4118 @GraphQLField 4119 @GraphQLName("paymentProcessorTypeCode") 4120 static PaymentProcessorTypeCodeObject paymentProcessorTypeCode(final DataFetchingEnvironment env, 4121 @GraphQLName("paymentProcessorTypeName") final String paymentProcessorTypeName, 4122 @GraphQLName("paymentProcessorTypeCodeTypeName") final String paymentProcessorTypeCodeTypeName, 4123 @GraphQLName("paymentProcessorTypeCodeName") final String paymentProcessorTypeCodeName, 4124 @GraphQLName("id") @GraphQLID final String id) { 4125 PaymentProcessorTypeCode paymentProcessorTypeCode; 4126 4127 try { 4128 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTypeCodeForm(); 4129 4130 commandForm.setPaymentProcessorTypeName(paymentProcessorTypeName); 4131 commandForm.setPaymentProcessorTypeCodeTypeName(paymentProcessorTypeCodeTypeName); 4132 commandForm.setPaymentProcessorTypeCodeName(paymentProcessorTypeCodeName); 4133 commandForm.setUuid(id); 4134 4135 paymentProcessorTypeCode = CDI.current().select(GetPaymentProcessorTypeCodeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4136 } catch (NamingException ex) { 4137 throw new RuntimeException(ex); 4138 } 4139 4140 return paymentProcessorTypeCode == null ? null : new PaymentProcessorTypeCodeObject(paymentProcessorTypeCode); 4141 } 4142 4143 @GraphQLField 4144 @GraphQLName("paymentProcessorTransaction") 4145 static PaymentProcessorTransactionObject paymentProcessorTransaction(final DataFetchingEnvironment env, 4146 @GraphQLName("paymentProcessorTransactionName") final String paymentProcessorTransactionName, 4147 @GraphQLName("id") @GraphQLID final String id) { 4148 PaymentProcessorTransaction paymentProcessorTransaction; 4149 4150 try { 4151 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTransactionForm(); 4152 4153 commandForm.setPaymentProcessorTransactionName(paymentProcessorTransactionName); 4154 commandForm.setUuid(id); 4155 4156 paymentProcessorTransaction = CDI.current().select(GetPaymentProcessorTransactionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4157 } catch (NamingException ex) { 4158 throw new RuntimeException(ex); 4159 } 4160 4161 return paymentProcessorTransaction == null ? null : new PaymentProcessorTransactionObject(paymentProcessorTransaction); 4162 } 4163 4164 @GraphQLField 4165 @GraphQLName("paymentProcessorTransactions") 4166 static Collection<PaymentProcessorTransactionObject> paymentProcessorTransactions(final DataFetchingEnvironment env) { 4167 Collection<PaymentProcessorTransaction> paymentProcessorTransactions; 4168 Collection<PaymentProcessorTransactionObject> paymentProcessorTransactionObjects; 4169 4170 try { 4171 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTransactionsForm(); 4172 4173 paymentProcessorTransactions = CDI.current().select(GetPaymentProcessorTransactionsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4174 } catch (NamingException ex) { 4175 throw new RuntimeException(ex); 4176 } 4177 4178 if(paymentProcessorTransactions == null) { 4179 paymentProcessorTransactionObjects = emptyList(); 4180 } else { 4181 paymentProcessorTransactionObjects = new ArrayList<>(paymentProcessorTransactions.size()); 4182 4183 paymentProcessorTransactions.stream() 4184 .map(PaymentProcessorTransactionObject::new) 4185 .forEachOrdered(paymentProcessorTransactionObjects::add); 4186 } 4187 4188 return paymentProcessorTransactionObjects; 4189 } 4190 4191 @GraphQLField 4192 @GraphQLName("paymentProcessor") 4193 static PaymentProcessorObject paymentProcessor(final DataFetchingEnvironment env, 4194 @GraphQLName("paymentProcessorName") final String paymentProcessorName, 4195 @GraphQLName("id") @GraphQLID final String id) { 4196 PaymentProcessor paymentProcessor; 4197 4198 try { 4199 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorForm(); 4200 4201 commandForm.setPaymentProcessorName(paymentProcessorName); 4202 commandForm.setUuid(id); 4203 4204 paymentProcessor = CDI.current().select(GetPaymentProcessorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4205 } catch (NamingException ex) { 4206 throw new RuntimeException(ex); 4207 } 4208 4209 return paymentProcessor == null ? null : new PaymentProcessorObject(paymentProcessor); 4210 } 4211 4212 @GraphQLField 4213 @GraphQLName("paymentProcessors") 4214 @GraphQLNonNull 4215 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4216 static CountingPaginatedData<PaymentProcessorObject> paymentProcessors(final DataFetchingEnvironment env) { 4217 CountingPaginatedData<PaymentProcessorObject> data; 4218 4219 try { 4220 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorsForm(); 4221 var command = CDI.current().select(GetPaymentProcessorsCommand.class).get(); 4222 4223 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4224 if(totalEntities == null) { 4225 data = Connections.emptyConnection(); 4226 } else { 4227 try(var objectLimiter = new ObjectLimiter(env, PaymentProcessorConstants.COMPONENT_VENDOR_NAME, PaymentProcessorConstants.ENTITY_TYPE_NAME, totalEntities)) { 4228 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4229 4230 var paymentProcessors = entities.stream() 4231 .map(PaymentProcessorObject::new) 4232 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4233 4234 data = new CountedObjects<>(objectLimiter, paymentProcessors); 4235 } 4236 } 4237 } catch (NamingException ex) { 4238 throw new RuntimeException(ex); 4239 } 4240 4241 return data; 4242 } 4243 4244 @GraphQLField 4245 @GraphQLName("paymentProcessorType") 4246 static PaymentProcessorTypeObject paymentProcessorType(final DataFetchingEnvironment env, 4247 @GraphQLName("paymentProcessorTypeName") final String paymentProcessorTypeName, 4248 @GraphQLName("id") @GraphQLID final String id) { 4249 PaymentProcessorType paymentProcessorType; 4250 4251 try { 4252 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTypeForm(); 4253 4254 commandForm.setPaymentProcessorTypeName(paymentProcessorTypeName); 4255 commandForm.setUuid(id); 4256 4257 paymentProcessorType = CDI.current().select(GetPaymentProcessorTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4258 } catch (NamingException ex) { 4259 throw new RuntimeException(ex); 4260 } 4261 4262 return paymentProcessorType == null ? null : new PaymentProcessorTypeObject(paymentProcessorType); 4263 } 4264 4265 @GraphQLField 4266 @GraphQLName("paymentProcessorTypes") 4267 @GraphQLNonNull 4268 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4269 static CountingPaginatedData<PaymentProcessorTypeObject> paymentProcessorTypes(final DataFetchingEnvironment env) { 4270 CountingPaginatedData<PaymentProcessorTypeObject> data; 4271 4272 try { 4273 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorTypesForm(); 4274 var command = CDI.current().select(GetPaymentProcessorTypesCommand.class).get(); 4275 4276 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4277 if(totalEntities == null) { 4278 data = Connections.emptyConnection(); 4279 } else { 4280 try(var objectLimiter = new ObjectLimiter(env, PaymentProcessorTypeConstants.COMPONENT_VENDOR_NAME, PaymentProcessorTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4281 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4282 4283 var paymentProcessorTypes = entities.stream() 4284 .map(PaymentProcessorTypeObject::new) 4285 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4286 4287 data = new CountedObjects<>(objectLimiter, paymentProcessorTypes); 4288 } 4289 } 4290 } catch (NamingException ex) { 4291 throw new RuntimeException(ex); 4292 } 4293 4294 return data; 4295 } 4296 4297 @GraphQLField 4298 @GraphQLName("paymentMethodType") 4299 static PaymentMethodTypeObject paymentMethodType(final DataFetchingEnvironment env, 4300 @GraphQLName("paymentMethodTypeName") final String paymentMethodTypeName, 4301 @GraphQLName("id") @GraphQLID final String id) { 4302 PaymentMethodType paymentMethodType; 4303 4304 try { 4305 var commandForm = PaymentUtil.getHome().getGetPaymentMethodTypeForm(); 4306 4307 commandForm.setPaymentMethodTypeName(paymentMethodTypeName); 4308 commandForm.setUuid(id); 4309 4310 paymentMethodType = CDI.current().select(GetPaymentMethodTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4311 } catch (NamingException ex) { 4312 throw new RuntimeException(ex); 4313 } 4314 4315 return paymentMethodType == null ? null : new PaymentMethodTypeObject(paymentMethodType); 4316 } 4317 4318 @GraphQLField 4319 @GraphQLName("paymentMethodTypes") 4320 @GraphQLNonNull 4321 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4322 static CountingPaginatedData<PaymentMethodTypeObject> paymentMethodTypes(final DataFetchingEnvironment env) { 4323 CountingPaginatedData<PaymentMethodTypeObject> data; 4324 4325 try { 4326 var commandForm = PaymentUtil.getHome().getGetPaymentMethodTypesForm(); 4327 var command = CDI.current().select(GetPaymentMethodTypesCommand.class).get(); 4328 4329 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4330 if(totalEntities == null) { 4331 data = Connections.emptyConnection(); 4332 } else { 4333 try(var objectLimiter = new ObjectLimiter(env, PaymentMethodTypeConstants.COMPONENT_VENDOR_NAME, PaymentMethodTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4334 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4335 4336 var paymentMethodTypes = entities.stream() 4337 .map(PaymentMethodTypeObject::new) 4338 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4339 4340 data = new CountedObjects<>(objectLimiter, paymentMethodTypes); 4341 } 4342 } 4343 } catch (NamingException ex) { 4344 throw new RuntimeException(ex); 4345 } 4346 4347 return data; 4348 } 4349 4350 @GraphQLField 4351 @GraphQLName("paymentProcessorResultCode") 4352 static PaymentProcessorResultCodeObject paymentProcessorResultCode(final DataFetchingEnvironment env, 4353 @GraphQLName("paymentProcessorResultCodeName") final String paymentProcessorResultCodeName, 4354 @GraphQLName("id") @GraphQLID final String id) { 4355 PaymentProcessorResultCode paymentProcessorResultCode; 4356 4357 try { 4358 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorResultCodeForm(); 4359 4360 commandForm.setPaymentProcessorResultCodeName(paymentProcessorResultCodeName); 4361 commandForm.setUuid(id); 4362 4363 paymentProcessorResultCode = CDI.current().select(GetPaymentProcessorResultCodeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4364 } catch (NamingException ex) { 4365 throw new RuntimeException(ex); 4366 } 4367 4368 return paymentProcessorResultCode == null ? null : new PaymentProcessorResultCodeObject(paymentProcessorResultCode); 4369 } 4370 4371 @GraphQLField 4372 @GraphQLName("paymentProcessorResultCodes") 4373 static Collection<PaymentProcessorResultCodeObject> paymentProcessorResultCodes(final DataFetchingEnvironment env) { 4374 Collection<PaymentProcessorResultCode> paymentProcessorResultCodes; 4375 Collection<PaymentProcessorResultCodeObject> paymentProcessorResultCodeObjects; 4376 4377 try { 4378 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorResultCodesForm(); 4379 4380 paymentProcessorResultCodes = CDI.current().select(GetPaymentProcessorResultCodesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4381 } catch (NamingException ex) { 4382 throw new RuntimeException(ex); 4383 } 4384 4385 if(paymentProcessorResultCodes == null) { 4386 paymentProcessorResultCodeObjects = emptyList(); 4387 } else { 4388 paymentProcessorResultCodeObjects = new ArrayList<>(paymentProcessorResultCodes.size()); 4389 4390 paymentProcessorResultCodes.stream() 4391 .map(PaymentProcessorResultCodeObject::new) 4392 .forEachOrdered(paymentProcessorResultCodeObjects::add); 4393 } 4394 4395 return paymentProcessorResultCodeObjects; 4396 } 4397 4398 @GraphQLField 4399 @GraphQLName("paymentProcessorActionType") 4400 static PaymentProcessorActionTypeObject paymentProcessorActionType(final DataFetchingEnvironment env, 4401 @GraphQLName("paymentProcessorActionTypeName") final String paymentProcessorActionTypeName, 4402 @GraphQLName("id") @GraphQLID final String id) { 4403 PaymentProcessorActionType paymentProcessorActionType; 4404 4405 try { 4406 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorActionTypeForm(); 4407 4408 commandForm.setPaymentProcessorActionTypeName(paymentProcessorActionTypeName); 4409 commandForm.setUuid(id); 4410 4411 paymentProcessorActionType = CDI.current().select(GetPaymentProcessorActionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4412 } catch (NamingException ex) { 4413 throw new RuntimeException(ex); 4414 } 4415 4416 return paymentProcessorActionType == null ? null : new PaymentProcessorActionTypeObject(paymentProcessorActionType); 4417 } 4418 4419 @GraphQLField 4420 @GraphQLName("paymentProcessorActionTypes") 4421 static Collection<PaymentProcessorActionTypeObject> paymentProcessorActionTypes(final DataFetchingEnvironment env) { 4422 Collection<PaymentProcessorActionType> paymentProcessorActionTypes; 4423 Collection<PaymentProcessorActionTypeObject> paymentProcessorActionTypeObjects; 4424 4425 try { 4426 var commandForm = PaymentUtil.getHome().getGetPaymentProcessorActionTypesForm(); 4427 4428 paymentProcessorActionTypes = CDI.current().select(GetPaymentProcessorActionTypesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4429 } catch (NamingException ex) { 4430 throw new RuntimeException(ex); 4431 } 4432 4433 if(paymentProcessorActionTypes == null) { 4434 paymentProcessorActionTypeObjects = emptyList(); 4435 } else { 4436 paymentProcessorActionTypeObjects = new ArrayList<>(paymentProcessorActionTypes.size()); 4437 4438 paymentProcessorActionTypes.stream() 4439 .map(PaymentProcessorActionTypeObject::new) 4440 .forEachOrdered(paymentProcessorActionTypeObjects::add); 4441 } 4442 4443 return paymentProcessorActionTypeObjects; 4444 } 4445 4446 @GraphQLField 4447 @GraphQLName("appearance") 4448 static AppearanceObject appearance(final DataFetchingEnvironment env, 4449 @GraphQLName("appearanceName") final String appearanceName, 4450 @GraphQLName("id") @GraphQLID final String id) { 4451 Appearance appearance; 4452 4453 try { 4454 var commandForm = CoreUtil.getHome().getGetAppearanceForm(); 4455 4456 commandForm.setAppearanceName(appearanceName); 4457 commandForm.setUuid(id); 4458 4459 appearance = CDI.current().select(GetAppearanceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4460 } catch (NamingException ex) { 4461 throw new RuntimeException(ex); 4462 } 4463 4464 return appearance == null ? null : new AppearanceObject(appearance); 4465 } 4466 4467 @GraphQLField 4468 @GraphQLName("appearances") 4469 @GraphQLNonNull 4470 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4471 static CountingPaginatedData<AppearanceObject> appearances(final DataFetchingEnvironment env) { 4472 CountingPaginatedData<AppearanceObject> data; 4473 4474 try { 4475 var commandForm = CoreUtil.getHome().getGetAppearancesForm(); 4476 var command = CDI.current().select(GetAppearancesCommand.class).get(); 4477 4478 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4479 if(totalEntities == null) { 4480 data = Connections.emptyConnection(); 4481 } else { 4482 try(var objectLimiter = new ObjectLimiter(env, AppearanceConstants.COMPONENT_VENDOR_NAME, AppearanceConstants.ENTITY_TYPE_NAME, totalEntities)) { 4483 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4484 4485 var appearances = entities.stream() 4486 .map(AppearanceObject::new) 4487 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4488 4489 data = new CountedObjects<>(objectLimiter, appearances); 4490 } 4491 } 4492 } catch (NamingException ex) { 4493 throw new RuntimeException(ex); 4494 } 4495 4496 return data; 4497 } 4498 4499 @GraphQLField 4500 @GraphQLName("eventType") 4501 static EventTypeObject eventType(final DataFetchingEnvironment env, 4502 @GraphQLName("eventTypeName") final String eventTypeName, 4503 @GraphQLName("id") @GraphQLID final String id) { 4504 EventType eventType; 4505 4506 try { 4507 var commandForm = CoreUtil.getHome().getGetEventTypeForm(); 4508 4509 commandForm.setEventTypeName(eventTypeName); 4510 commandForm.setUuid(id); 4511 4512 eventType = CDI.current().select(GetEventTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4513 } catch (NamingException ex) { 4514 throw new RuntimeException(ex); 4515 } 4516 4517 return eventType == null ? null : new EventTypeObject(eventType); 4518 } 4519 4520 @GraphQLField 4521 @GraphQLName("eventTypes") 4522 @GraphQLNonNull 4523 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4524 static CountingPaginatedData<EventTypeObject> eventTypes(final DataFetchingEnvironment env) { 4525 CountingPaginatedData<EventTypeObject> data; 4526 4527 try { 4528 var commandForm = CoreUtil.getHome().getGetEventTypesForm(); 4529 var command = CDI.current().select(GetEventTypesCommand.class).get(); 4530 4531 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4532 if(totalEntities == null) { 4533 data = Connections.emptyConnection(); 4534 } else { 4535 try(var objectLimiter = new ObjectLimiter(env, EventTypeConstants.COMPONENT_VENDOR_NAME, EventTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4536 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4537 4538 var eventTypes = entities.stream() 4539 .map(EventTypeObject::new) 4540 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4541 4542 data = new CountedObjects<>(objectLimiter, eventTypes); 4543 } 4544 } 4545 } catch (NamingException ex) { 4546 throw new RuntimeException(ex); 4547 } 4548 4549 return data; 4550 } 4551 4552 @GraphQLField 4553 @GraphQLName("entityAliasType") 4554 static EntityAliasTypeObject entityAliasType(final DataFetchingEnvironment env, 4555 @GraphQLName("componentVendorName") final String componentVendorName, 4556 @GraphQLName("entityTypeName") final String entityTypeName, 4557 @GraphQLName("entityAliasTypeName") final String entityAliasTypeName, 4558 @GraphQLName("id") @GraphQLID final String id) { 4559 EntityAliasType entityAliasType; 4560 4561 try { 4562 var commandForm = CoreUtil.getHome().getGetEntityAliasTypeForm(); 4563 4564 commandForm.setComponentVendorName(componentVendorName); 4565 commandForm.setEntityTypeName(entityTypeName); 4566 commandForm.setEntityAliasTypeName(entityAliasTypeName); 4567 commandForm.setUuid(id); 4568 4569 entityAliasType = CDI.current().select(GetEntityAliasTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4570 } catch (NamingException ex) { 4571 throw new RuntimeException(ex); 4572 } 4573 4574 return entityAliasType == null ? null : new EntityAliasTypeObject(entityAliasType, null); 4575 } 4576 4577 @GraphQLField 4578 @GraphQLName("entityAliasTypes") 4579 @GraphQLNonNull 4580 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4581 static CountingPaginatedData<EntityAliasTypeObject> entityAliasTypes(final DataFetchingEnvironment env, 4582 @GraphQLName("componentVendorName") final String componentVendorName, 4583 @GraphQLName("entityTypeName") final String entityTypeName, 4584 @GraphQLName("id") @GraphQLID final String id) { 4585 CountingPaginatedData<EntityAliasTypeObject> data; 4586 4587 try { 4588 var commandForm = CoreUtil.getHome().getGetEntityAliasTypesForm(); 4589 var command = CDI.current().select(GetEntityAliasTypesCommand.class).get(); 4590 4591 commandForm.setComponentVendorName(componentVendorName); 4592 commandForm.setEntityTypeName(entityTypeName); 4593 commandForm.setUuid(id); 4594 4595 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4596 if(totalEntities == null) { 4597 data = Connections.emptyConnection(); 4598 } else { 4599 try(var objectLimiter = new ObjectLimiter(env, EntityAliasTypeConstants.COMPONENT_VENDOR_NAME, EntityAliasTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4600 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4601 4602 var entityAliasTypes = entities.stream() 4603 .map(entityAliasType -> new EntityAliasTypeObject(entityAliasType, null)) 4604 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4605 4606 data = new CountedObjects<>(objectLimiter, entityAliasTypes); 4607 } 4608 } 4609 } catch (NamingException ex) { 4610 throw new RuntimeException(ex); 4611 } 4612 4613 return data; 4614 } 4615 4616 @GraphQLField 4617 @GraphQLName("entityAlias") 4618 static EntityAliasObject entityAlias(final DataFetchingEnvironment env, 4619 @GraphQLName("componentVendorName") final String componentVendorName, 4620 @GraphQLName("entityTypeName") final String entityTypeName, 4621 @GraphQLName("entityAliasTypeName") final String entityAliasTypeName, 4622 @GraphQLName("id") @GraphQLID final String id, 4623 @GraphQLName("alias") @GraphQLNonNull final String alias) { 4624 EntityAlias entityAlias; 4625 4626 try { 4627 var commandForm = CoreUtil.getHome().getGetEntityAliasForm(); 4628 4629 commandForm.setComponentVendorName(componentVendorName); 4630 commandForm.setEntityTypeName(entityTypeName); 4631 commandForm.setEntityAliasTypeName(entityAliasTypeName); 4632 commandForm.setUuid(id); 4633 commandForm.setAlias(alias); 4634 4635 entityAlias = CDI.current().select(GetEntityAliasCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4636 } catch (NamingException ex) { 4637 throw new RuntimeException(ex); 4638 } 4639 4640 return entityAlias == null ? null : new EntityAliasObject(entityAlias); 4641 } 4642 4643 @GraphQLField 4644 @GraphQLName("entityAliases") 4645 @GraphQLNonNull 4646 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4647 static CountingPaginatedData<EntityAliasObject> entityAliases(final DataFetchingEnvironment env, 4648 @GraphQLName("componentVendorName") final String componentVendorName, 4649 @GraphQLName("entityTypeName") final String entityTypeName, 4650 @GraphQLName("entityAliasTypeName") final String entityAliasTypeName, 4651 @GraphQLName("id") @GraphQLID final String id) { 4652 CountingPaginatedData<EntityAliasObject> data; 4653 4654 try { 4655 var commandForm = CoreUtil.getHome().getGetEntityAliasesForm(); 4656 var command = CDI.current().select(GetEntityAliasesCommand.class).get(); 4657 4658 commandForm.setComponentVendorName(componentVendorName); 4659 commandForm.setEntityTypeName(entityTypeName); 4660 commandForm.setEntityAliasTypeName(entityAliasTypeName); 4661 commandForm.setUuid(id); 4662 4663 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4664 if(totalEntities == null) { 4665 data = Connections.emptyConnection(); 4666 } else { 4667 try(var objectLimiter = new ObjectLimiter(env, EntityAliasConstants.COMPONENT_VENDOR_NAME, EntityAliasConstants.ENTITY_TYPE_NAME, totalEntities)) { 4668 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4669 4670 var entityAliases = entities.stream() 4671 .map(EntityAliasObject::new) 4672 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4673 4674 data = new CountedObjects<>(objectLimiter, entityAliases); 4675 } 4676 } 4677 } catch (NamingException ex) { 4678 throw new RuntimeException(ex); 4679 } 4680 4681 return data; 4682 } 4683 4684 4685 @GraphQLField 4686 @GraphQLName("entityAttributeGroup") 4687 static EntityAttributeGroupObject entityAttributeGroup(final DataFetchingEnvironment env, 4688 @GraphQLName("entityAttributeGroupName") final String entityAttributeGroupName, 4689 @GraphQLName("id") @GraphQLID final String id) { 4690 EntityAttributeGroup entityAttributeGroup; 4691 4692 try { 4693 var commandForm = CoreUtil.getHome().getGetEntityAttributeGroupForm(); 4694 4695 commandForm.setEntityAttributeGroupName(entityAttributeGroupName); 4696 commandForm.setUuid(id); 4697 4698 entityAttributeGroup = CDI.current().select(GetEntityAttributeGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4699 } catch (NamingException ex) { 4700 throw new RuntimeException(ex); 4701 } 4702 4703 return entityAttributeGroup == null ? null : new EntityAttributeGroupObject(entityAttributeGroup, null); 4704 } 4705 4706 @GraphQLField 4707 @GraphQLName("entityAttributeGroups") 4708 @GraphQLNonNull 4709 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4710 static CountingPaginatedData<EntityAttributeGroupObject> entityAttributeGroups(final DataFetchingEnvironment env) { 4711 CountingPaginatedData<EntityAttributeGroupObject> data; 4712 4713 try { 4714 var commandForm = CoreUtil.getHome().getGetEntityAttributeGroupsForm(); 4715 var command = CDI.current().select(GetEntityAttributeGroupsCommand.class).get(); 4716 4717 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4718 if(totalEntities == null) { 4719 data = Connections.emptyConnection(); 4720 } else { 4721 try(var objectLimiter = new ObjectLimiter(env, EntityAttributeGroupConstants.COMPONENT_VENDOR_NAME, EntityAttributeGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 4722 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4723 4724 var entityAttributeGroups = entities.stream() 4725 .map(entityAttributeGroup -> new EntityAttributeGroupObject(entityAttributeGroup, null)) 4726 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4727 4728 data = new CountedObjects<>(objectLimiter, entityAttributeGroups); 4729 } 4730 } 4731 } catch (NamingException ex) { 4732 throw new RuntimeException(ex); 4733 } 4734 4735 return data; 4736 } 4737 4738 @GraphQLField 4739 @GraphQLName("entityAttribute") 4740 static EntityAttributeObject entityAttribute(final DataFetchingEnvironment env, 4741 @GraphQLName("componentVendorName") final String componentVendorName, 4742 @GraphQLName("entityTypeName") final String entityTypeName, 4743 @GraphQLName("entityAttributeName") final String entityAttributeName, 4744 @GraphQLName("id") @GraphQLID final String id) { 4745 EntityAttribute entityAttribute; 4746 4747 try { 4748 var commandForm = CoreUtil.getHome().getGetEntityAttributeForm(); 4749 4750 commandForm.setComponentVendorName(componentVendorName); 4751 commandForm.setEntityTypeName(entityTypeName); 4752 commandForm.setEntityAttributeName(entityAttributeName); 4753 commandForm.setUuid(id); 4754 4755 entityAttribute = CDI.current().select(GetEntityAttributeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4756 } catch (NamingException ex) { 4757 throw new RuntimeException(ex); 4758 } 4759 4760 return entityAttribute == null ? null : new EntityAttributeObject(entityAttribute, null); 4761 } 4762 4763 @GraphQLField 4764 @GraphQLName("entityAttributes") 4765 @GraphQLNonNull 4766 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4767 static CountingPaginatedData<EntityAttributeObject> entityAttributes(final DataFetchingEnvironment env, 4768 @GraphQLName("componentVendorName") final String componentVendorName, 4769 @GraphQLName("entityTypeName") final String entityTypeName, 4770 @GraphQLName("entityAttributeTypeNames") final String entityAttributeTypeNames, 4771 @GraphQLName("id") @GraphQLID final String id) { 4772 CountingPaginatedData<EntityAttributeObject> data; 4773 4774 try { 4775 var commandForm = CoreUtil.getHome().getGetEntityAttributesForm(); 4776 var command = CDI.current().select(GetEntityAttributesCommand.class).get(); 4777 4778 commandForm.setComponentVendorName(componentVendorName); 4779 commandForm.setEntityTypeName(entityTypeName); 4780 commandForm.setEntityAttributeTypeNames(entityAttributeTypeNames); 4781 commandForm.setUuid(id); 4782 4783 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4784 if(totalEntities == null) { 4785 data = Connections.emptyConnection(); 4786 } else { 4787 try(var objectLimiter = new ObjectLimiter(env, EntityAttributeConstants.COMPONENT_VENDOR_NAME, EntityAttributeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4788 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4789 4790 var entityAttributes = entities.stream() 4791 .map(entityAttribute -> new EntityAttributeObject(entityAttribute, null)) 4792 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4793 4794 data = new CountedObjects<>(objectLimiter, entityAttributes); 4795 } 4796 } 4797 } catch (NamingException ex) { 4798 throw new RuntimeException(ex); 4799 } 4800 4801 return data; 4802 } 4803 4804 @GraphQLField 4805 @GraphQLName("entityAttributeEntityAttributeGroup") 4806 static EntityAttributeEntityAttributeGroupObject entityAttributeEntityAttributeGroup(final DataFetchingEnvironment env, 4807 @GraphQLName("componentVendorName") @GraphQLNonNull final String componentVendorName, 4808 @GraphQLName("entityTypeName") @GraphQLNonNull final String entityTypeName, 4809 @GraphQLName("entityAttributeName") @GraphQLNonNull final String entityAttributeName, 4810 @GraphQLName("entityAttributeGroupName") @GraphQLNonNull final String entityAttributeGroupName) { 4811 EntityAttributeEntityAttributeGroup entityAttributeEntityAttributeGroup; 4812 4813 try { 4814 var commandForm = CoreUtil.getHome().getGetEntityAttributeEntityAttributeGroupForm(); 4815 4816 commandForm.setComponentVendorName(componentVendorName); 4817 commandForm.setEntityTypeName(entityTypeName); 4818 commandForm.setEntityAttributeName(entityAttributeName); 4819 commandForm.setEntityAttributeGroupName(entityAttributeGroupName); 4820 4821 entityAttributeEntityAttributeGroup = CDI.current().select(GetEntityAttributeEntityAttributeGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4822 } catch (NamingException ex) { 4823 throw new RuntimeException(ex); 4824 } 4825 4826 return entityAttributeEntityAttributeGroup == null ? null : new EntityAttributeEntityAttributeGroupObject(entityAttributeEntityAttributeGroup); 4827 } 4828 4829 @GraphQLField 4830 @GraphQLName("entityAttributeEntityAttributeGroups") 4831 @GraphQLNonNull 4832 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4833 static CountingPaginatedData<EntityAttributeEntityAttributeGroupObject> entityAttributeEntityAttributeGroups(final DataFetchingEnvironment env, 4834 @GraphQLName("componentVendorName") final String componentVendorName, 4835 @GraphQLName("entityTypeName") final String entityTypeName, 4836 @GraphQLName("entityAttributeName") final String entityAttributeName, 4837 @GraphQLName("entityAttributeGroupName") final String entityAttributeGroupName) { 4838 CountingPaginatedData<EntityAttributeEntityAttributeGroupObject> data; 4839 4840 try { 4841 var commandForm = CoreUtil.getHome().getGetEntityAttributeEntityAttributeGroupsForm(); 4842 var command = CDI.current().select(GetEntityAttributeEntityAttributeGroupsCommand.class).get(); 4843 4844 commandForm.setComponentVendorName(componentVendorName); 4845 commandForm.setEntityTypeName(entityTypeName); 4846 commandForm.setEntityAttributeName(entityAttributeName); 4847 commandForm.setEntityAttributeGroupName(entityAttributeGroupName); 4848 4849 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4850 if(totalEntities == null) { 4851 data = Connections.emptyConnection(); 4852 } else { 4853 try(var objectLimiter = new ObjectLimiter(env, EntityAttributeEntityAttributeGroupConstants.COMPONENT_VENDOR_NAME, EntityAttributeEntityAttributeGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 4854 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4855 4856 var entityAttributeEntityAttributeGroups = entities.stream() 4857 .map(EntityAttributeEntityAttributeGroupObject::new) 4858 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4859 4860 data = new CountedObjects<>(objectLimiter, entityAttributeEntityAttributeGroups); 4861 } 4862 } 4863 } catch (NamingException ex) { 4864 throw new RuntimeException(ex); 4865 } 4866 4867 return data; 4868 } 4869 4870 @GraphQLField 4871 @GraphQLName("entityInstance") 4872 static EntityInstanceObject entityInstance(final DataFetchingEnvironment env, 4873 @GraphQLName("id") @GraphQLID final String id, 4874 @GraphQLName("entityRef") final String entityRef) { 4875 EntityInstance entityInstance; 4876 4877 try { 4878 var commandForm = CoreUtil.getHome().getGetEntityInstanceForm(); 4879 4880 commandForm.setUuid(id); 4881 commandForm.setEntityRef(entityRef); 4882 4883 entityInstance = CDI.current().select(GetEntityInstanceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4884 } catch (NamingException ex) { 4885 throw new RuntimeException(ex); 4886 } 4887 4888 return entityInstance == null ? null : new EntityInstanceObject(entityInstance); 4889 } 4890 4891 @GraphQLField 4892 @GraphQLName("entityInstances") 4893 @GraphQLNonNull 4894 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4895 static CountingPaginatedData<EntityInstanceObject> entityInstances(final DataFetchingEnvironment env, 4896 @GraphQLName("componentVendorName") @GraphQLNonNull final String componentVendorName, 4897 @GraphQLName("entityTypeName") @GraphQLNonNull final String entityTypeName) { 4898 CountingPaginatedData<EntityInstanceObject> data; 4899 4900 try { 4901 var commandForm = CoreUtil.getHome().getGetEntityInstancesForm(); 4902 var command = CDI.current().select(GetEntityInstancesCommand.class).get(); 4903 4904 commandForm.setComponentVendorName(componentVendorName); 4905 commandForm.setEntityTypeName(entityTypeName); 4906 4907 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4908 if(totalEntities == null) { 4909 data = Connections.emptyConnection(); 4910 } else { 4911 try(var objectLimiter = new ObjectLimiter(env, EntityInstanceConstants.COMPONENT_VENDOR_NAME, EntityInstanceConstants.ENTITY_TYPE_NAME, totalEntities)) { 4912 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4913 4914 var entityInstances = entities.stream() 4915 .map(EntityInstanceObject::new) 4916 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4917 4918 data = new CountedObjects<>(objectLimiter, entityInstances); 4919 } 4920 } 4921 } catch (NamingException ex) { 4922 throw new RuntimeException(ex); 4923 } 4924 4925 return data; 4926 } 4927 4928 @GraphQLField 4929 @GraphQLName("entityType") 4930 static EntityTypeObject entityType(final DataFetchingEnvironment env, 4931 @GraphQLName("componentVendorName") final String componentVendorName, 4932 @GraphQLName("entityTypeName") final String entityTypeName, 4933 @GraphQLName("id") @GraphQLID final String id) { 4934 EntityType entityType; 4935 4936 try { 4937 var commandForm = CoreUtil.getHome().getGetEntityTypeForm(); 4938 4939 commandForm.setComponentVendorName(componentVendorName); 4940 commandForm.setEntityTypeName(entityTypeName); 4941 commandForm.setUuid(id); 4942 4943 entityType = CDI.current().select(GetEntityTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 4944 } catch (NamingException ex) { 4945 throw new RuntimeException(ex); 4946 } 4947 4948 return entityType == null ? null : new EntityTypeObject(entityType); 4949 } 4950 4951 @GraphQLField 4952 @GraphQLName("entityTypes") 4953 @GraphQLNonNull 4954 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 4955 static CountingPaginatedData<EntityTypeObject> entityTypes(final DataFetchingEnvironment env, 4956 @GraphQLName("componentVendorName") final String componentVendorName) { 4957 CountingPaginatedData<EntityTypeObject> data; 4958 4959 try { 4960 var commandForm = CoreUtil.getHome().getGetEntityTypesForm(); 4961 var command = CDI.current().select(GetEntityTypesCommand.class).get(); 4962 4963 commandForm.setComponentVendorName(componentVendorName); 4964 4965 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4966 if(totalEntities == null) { 4967 data = Connections.emptyConnection(); 4968 } else { 4969 try(var objectLimiter = new ObjectLimiter(env, EntityTypeConstants.COMPONENT_VENDOR_NAME, EntityTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 4970 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 4971 4972 var entityTypes = entities.stream() 4973 .map(EntityTypeObject::new) 4974 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 4975 4976 data = new CountedObjects<>(objectLimiter, entityTypes); 4977 } 4978 } 4979 } catch (NamingException ex) { 4980 throw new RuntimeException(ex); 4981 } 4982 4983 return data; 4984 } 4985 4986 @GraphQLField 4987 @GraphQLName("componentVendor") 4988 static ComponentVendorObject componentVendor(final DataFetchingEnvironment env, 4989 @GraphQLName("componentVendorName") final String componentVendorName, 4990 @GraphQLName("id") @GraphQLID final String id) { 4991 ComponentVendor componentVendor; 4992 4993 try { 4994 var commandForm = CoreUtil.getHome().getGetComponentVendorForm(); 4995 4996 commandForm.setComponentVendorName(componentVendorName); 4997 commandForm.setUuid(id); 4998 4999 componentVendor = CDI.current().select(GetComponentVendorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5000 } catch (NamingException ex) { 5001 throw new RuntimeException(ex); 5002 } 5003 5004 return componentVendor == null ? null : new ComponentVendorObject(componentVendor); 5005 } 5006 5007 @GraphQLField 5008 @GraphQLName("componentVendors") 5009 @GraphQLNonNull 5010 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5011 static CountingPaginatedData<ComponentVendorObject> componentVendors(final DataFetchingEnvironment env) { 5012 CountingPaginatedData<ComponentVendorObject> data; 5013 5014 try { 5015 var commandForm = CoreUtil.getHome().getGetComponentVendorsForm(); 5016 var command = CDI.current().select(GetComponentVendorsCommand.class).get(); 5017 5018 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5019 if(totalEntities == null) { 5020 data = Connections.emptyConnection(); 5021 } else { 5022 try(var objectLimiter = new ObjectLimiter(env, ComponentVendorConstants.COMPONENT_VENDOR_NAME, ComponentVendorConstants.ENTITY_TYPE_NAME, totalEntities)) { 5023 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5024 5025 var componentVendors = entities.stream() 5026 .map(ComponentVendorObject::new) 5027 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5028 5029 data = new CountedObjects<>(objectLimiter, componentVendors); 5030 } 5031 } 5032 } catch (NamingException ex) { 5033 throw new RuntimeException(ex); 5034 } 5035 5036 return data; 5037 } 5038 5039 @GraphQLField 5040 @GraphQLName("inventoryCondition") 5041 static InventoryConditionObject inventoryCondition(final DataFetchingEnvironment env, 5042 @GraphQLName("inventoryConditionName") final String inventoryConditionName, 5043 @GraphQLName("id") @GraphQLID final String id) { 5044 InventoryCondition inventoryCondition; 5045 5046 try { 5047 var commandForm = InventoryUtil.getHome().getGetInventoryConditionForm(); 5048 5049 commandForm.setInventoryConditionName(inventoryConditionName); 5050 commandForm.setUuid(id); 5051 5052 inventoryCondition = CDI.current().select(GetInventoryConditionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5053 } catch (NamingException ex) { 5054 throw new RuntimeException(ex); 5055 } 5056 5057 return inventoryCondition == null ? null : new InventoryConditionObject(inventoryCondition); 5058 } 5059 5060 @GraphQLField 5061 @GraphQLName("inventoryConditions") 5062 @GraphQLNonNull 5063 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5064 static CountingPaginatedData<InventoryConditionObject> inventoryConditions(final DataFetchingEnvironment env) { 5065 CountingPaginatedData<InventoryConditionObject> data; 5066 5067 try { 5068 var commandForm = InventoryUtil.getHome().getGetInventoryConditionsForm(); 5069 var command = CDI.current().select(GetInventoryConditionsCommand.class).get(); 5070 5071 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5072 if(totalEntities == null) { 5073 data = Connections.emptyConnection(); 5074 } else { 5075 try(var objectLimiter = new ObjectLimiter(env, InventoryConditionConstants.COMPONENT_VENDOR_NAME, InventoryConditionConstants.ENTITY_TYPE_NAME, totalEntities)) { 5076 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5077 5078 var inventoryConditions = entities.stream() 5079 .map(InventoryConditionObject::new) 5080 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5081 5082 data = new CountedObjects<>(objectLimiter, inventoryConditions); 5083 } 5084 } 5085 } catch (NamingException ex) { 5086 throw new RuntimeException(ex); 5087 } 5088 5089 return data; 5090 } 5091 5092 @GraphQLField 5093 @GraphQLName("allocationPriority") 5094 static AllocationPriorityObject allocationPriority(final DataFetchingEnvironment env, 5095 @GraphQLName("allocationPriorityName") final String allocationPriorityName, 5096 @GraphQLName("id") @GraphQLID final String id) { 5097 AllocationPriority allocationPriority; 5098 5099 try { 5100 var commandForm = InventoryUtil.getHome().getGetAllocationPriorityForm(); 5101 5102 commandForm.setAllocationPriorityName(allocationPriorityName); 5103 commandForm.setUuid(id); 5104 5105 allocationPriority = CDI.current().select(GetAllocationPriorityCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5106 } catch (NamingException ex) { 5107 throw new RuntimeException(ex); 5108 } 5109 5110 return allocationPriority == null ? null : new AllocationPriorityObject(allocationPriority); 5111 } 5112 5113 @GraphQLField 5114 @GraphQLName("allocationPriorities") 5115 @GraphQLNonNull 5116 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5117 static CountingPaginatedData<AllocationPriorityObject> allocationPriorities(final DataFetchingEnvironment env) { 5118 CountingPaginatedData<AllocationPriorityObject> data; 5119 5120 try { 5121 var commandForm = InventoryUtil.getHome().getGetAllocationPrioritiesForm(); 5122 var command = CDI.current().select(GetAllocationPrioritiesCommand.class).get(); 5123 5124 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5125 if(totalEntities == null) { 5126 data = Connections.emptyConnection(); 5127 } else { 5128 try(var objectLimiter = new ObjectLimiter(env, AllocationPriorityConstants.COMPONENT_VENDOR_NAME, AllocationPriorityConstants.ENTITY_TYPE_NAME, totalEntities)) { 5129 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5130 5131 var allocationPriorities = entities.stream() 5132 .map(AllocationPriorityObject::new) 5133 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5134 5135 data = new CountedObjects<>(objectLimiter, allocationPriorities); 5136 } 5137 } 5138 } catch (NamingException ex) { 5139 throw new RuntimeException(ex); 5140 } 5141 5142 return data; 5143 } 5144 5145 @GraphQLField 5146 @GraphQLName("inventoryTransactionType") 5147 static InventoryTransactionTypeObject inventoryTransactionType(final DataFetchingEnvironment env, 5148 @GraphQLName("inventoryTransactionTypeName") final String inventoryTransactionTypeName, 5149 @GraphQLName("id") @GraphQLID final String id) { 5150 InventoryTransactionType inventoryTransactionType; 5151 5152 try { 5153 var commandForm = InventoryUtil.getHome().getGetInventoryTransactionTypeForm(); 5154 5155 commandForm.setInventoryTransactionTypeName(inventoryTransactionTypeName); 5156 commandForm.setUuid(id); 5157 5158 inventoryTransactionType = CDI.current().select(GetInventoryTransactionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5159 } catch (NamingException ex) { 5160 throw new RuntimeException(ex); 5161 } 5162 5163 return inventoryTransactionType == null ? null : new InventoryTransactionTypeObject(inventoryTransactionType); 5164 } 5165 5166 @GraphQLField 5167 @GraphQLName("inventoryAdjustmentType") 5168 static InventoryAdjustmentTypeObject inventoryAdjustmentType(final DataFetchingEnvironment env, 5169 @GraphQLName("inventoryAdjustmentTypeName") final String inventoryAdjustmentTypeName, 5170 @GraphQLName("id") @GraphQLID final String id) { 5171 InventoryAdjustmentType inventoryAdjustmentType; 5172 5173 try { 5174 var commandForm = InventoryUtil.getHome().getGetInventoryAdjustmentTypeForm(); 5175 5176 commandForm.setInventoryAdjustmentTypeName(inventoryAdjustmentTypeName); 5177 commandForm.setUuid(id); 5178 5179 inventoryAdjustmentType = CDI.current().select(GetInventoryAdjustmentTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5180 } catch (NamingException ex) { 5181 throw new RuntimeException(ex); 5182 } 5183 5184 return inventoryAdjustmentType == null ? null : new InventoryAdjustmentTypeObject(inventoryAdjustmentType); 5185 } 5186 5187 @GraphQLField 5188 @GraphQLName("inventoryAdjustmentTypes") 5189 @GraphQLNonNull 5190 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5191 static CountingPaginatedData<InventoryAdjustmentTypeObject> inventoryAdjustmentTypes(final DataFetchingEnvironment env) { 5192 CountingPaginatedData<InventoryAdjustmentTypeObject> data; 5193 5194 try { 5195 var commandForm = InventoryUtil.getHome().getGetInventoryAdjustmentTypesForm(); 5196 var command = CDI.current().select(GetInventoryAdjustmentTypesCommand.class).get(); 5197 5198 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5199 if(totalEntities == null) { 5200 data = Connections.emptyConnection(); 5201 } else { 5202 try(var objectLimiter = new ObjectLimiter(env, InventoryAdjustmentTypeConstants.COMPONENT_VENDOR_NAME, InventoryAdjustmentTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 5203 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5204 5205 var inventoryAdjustmentTypes = entities.stream() 5206 .map(InventoryAdjustmentTypeObject::new) 5207 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5208 5209 data = new CountedObjects<>(objectLimiter, inventoryAdjustmentTypes); 5210 } 5211 } 5212 } catch (NamingException ex) { 5213 throw new RuntimeException(ex); 5214 } 5215 5216 return data; 5217 } 5218 5219 @GraphQLField 5220 @GraphQLName("inventoryTransactionTypes") 5221 @GraphQLNonNull 5222 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5223 static CountingPaginatedData<InventoryTransactionTypeObject> inventoryTransactionTypes(final DataFetchingEnvironment env) { 5224 CountingPaginatedData<InventoryTransactionTypeObject> data; 5225 5226 try { 5227 var commandForm = InventoryUtil.getHome().getGetInventoryTransactionTypesForm(); 5228 var command = CDI.current().select(GetInventoryTransactionTypesCommand.class).get(); 5229 5230 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5231 if(totalEntities == null) { 5232 data = Connections.emptyConnection(); 5233 } else { 5234 try(var objectLimiter = new ObjectLimiter(env, InventoryTransactionTypeConstants.COMPONENT_VENDOR_NAME, InventoryTransactionTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 5235 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5236 5237 var inventoryTransactionTypes = entities.stream() 5238 .map(InventoryTransactionTypeObject::new) 5239 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5240 5241 data = new CountedObjects<>(objectLimiter, inventoryTransactionTypes); 5242 } 5243 } 5244 } catch (NamingException ex) { 5245 throw new RuntimeException(ex); 5246 } 5247 5248 return data; 5249 } 5250 5251 @GraphQLField 5252 @GraphQLName("lot") 5253 static LotObject lot(final DataFetchingEnvironment env, 5254 @GraphQLName("itemName") final String itemName, 5255 @GraphQLName("lotIdentifier") final String lotIdentifier, 5256 @GraphQLName("id") @GraphQLID final String id) { 5257 Lot lot; 5258 5259 try { 5260 var commandForm = InventoryUtil.getHome().getGetLotForm(); 5261 5262 commandForm.setItemName(itemName); 5263 commandForm.setLotIdentifier(lotIdentifier); 5264 commandForm.setUuid(id); 5265 5266 lot = CDI.current().select(GetLotCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5267 } catch (NamingException ex) { 5268 throw new RuntimeException(ex); 5269 } 5270 5271 return lot == null ? null : new LotObject(lot); 5272 } 5273 5274 @GraphQLField 5275 @GraphQLName("lots") 5276 @GraphQLNonNull 5277 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5278 static CountingPaginatedData<LotObject> lots(final DataFetchingEnvironment env, 5279 @GraphQLName("itemName") @GraphQLNonNull final String itemName) { 5280 CountingPaginatedData<LotObject> data; 5281 5282 try { 5283 var commandForm = InventoryUtil.getHome().getGetLotsForm(); 5284 var command = CDI.current().select(GetLotsCommand.class).get(); 5285 5286 commandForm.setItemName(itemName); 5287 5288 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5289 if(totalEntities == null) { 5290 data = Connections.emptyConnection(); 5291 } else { 5292 try(var objectLimiter = new ObjectLimiter(env, LotConstants.COMPONENT_VENDOR_NAME, LotConstants.ENTITY_TYPE_NAME, totalEntities)) { 5293 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5294 5295 var lots = entities.stream() 5296 .map(LotObject::new) 5297 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5298 5299 data = new CountedObjects<>(objectLimiter, lots); 5300 } 5301 } 5302 } catch (NamingException ex) { 5303 throw new RuntimeException(ex); 5304 } 5305 5306 return data; 5307 } 5308 5309 @GraphQLField 5310 @GraphQLName("contentPageLayout") 5311 static ContentPageLayoutObject contentPageLayout(final DataFetchingEnvironment env, 5312 @GraphQLName("contentPageLayoutName") final String contentPageLayoutName, 5313 @GraphQLName("id") @GraphQLID final String id) { 5314 ContentPageLayout contentPageLayout; 5315 5316 try { 5317 var commandForm = ContentUtil.getHome().getGetContentPageLayoutForm(); 5318 5319 commandForm.setContentPageLayoutName(contentPageLayoutName); 5320 commandForm.setUuid(id); 5321 5322 contentPageLayout = CDI.current().select(GetContentPageLayoutCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5323 } catch (NamingException ex) { 5324 throw new RuntimeException(ex); 5325 } 5326 5327 return contentPageLayout == null ? null : new ContentPageLayoutObject(contentPageLayout); 5328 } 5329 5330 @GraphQLField 5331 @GraphQLName("contentPageLayouts") 5332 @GraphQLNonNull 5333 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5334 static CountingPaginatedData<ContentPageLayoutObject> contentPageLayouts(final DataFetchingEnvironment env) { 5335 CountingPaginatedData<ContentPageLayoutObject> data; 5336 5337 try { 5338 var commandForm = ContentUtil.getHome().getGetContentPageLayoutsForm(); 5339 var command = CDI.current().select(GetContentPageLayoutsCommand.class).get(); 5340 5341 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5342 if(totalEntities == null) { 5343 data = Connections.emptyConnection(); 5344 } else { 5345 try(var objectLimiter = new ObjectLimiter(env, ContentPageLayoutConstants.COMPONENT_VENDOR_NAME, ContentPageLayoutConstants.ENTITY_TYPE_NAME, totalEntities)) { 5346 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5347 5348 var contentPageLayouts = entities.stream() 5349 .map(ContentPageLayoutObject::new) 5350 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5351 5352 data = new CountedObjects<>(objectLimiter, contentPageLayouts); 5353 } 5354 } 5355 } catch (NamingException ex) { 5356 throw new RuntimeException(ex); 5357 } 5358 5359 return data; 5360 } 5361 5362 @GraphQLField 5363 @GraphQLName("contentPageLayoutArea") 5364 static ContentPageLayoutAreaObject contentPageLayoutArea(final DataFetchingEnvironment env, 5365 @GraphQLName("contentCollectionName") @GraphQLNonNull final String contentCollectionName, 5366 @GraphQLName("contentSectionName") @GraphQLNonNull final String contentSectionName, 5367 @GraphQLName("contentPageName") @GraphQLNonNull final String contentPageName, 5368 @GraphQLName("sortOrder") @GraphQLNonNull final String sortOrder) { 5369 ContentPageLayoutArea contentPageLayoutArea; 5370 5371 try { 5372 var commandForm = ContentUtil.getHome().getGetContentPageLayoutAreaForm(); 5373 5374 commandForm.setContentCollectionName(contentCollectionName); 5375 commandForm.setContentSectionName(contentSectionName); 5376 commandForm.setContentPageName(contentPageName); 5377 commandForm.setSortOrder(sortOrder); 5378 5379 contentPageLayoutArea = CDI.current().select(GetContentPageLayoutAreaCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5380 } catch (NamingException ex) { 5381 throw new RuntimeException(ex); 5382 } 5383 5384 return contentPageLayoutArea == null ? null : new ContentPageLayoutAreaObject(contentPageLayoutArea); 5385 } 5386 5387 @GraphQLField 5388 @GraphQLName("contentPageLayoutAreas") 5389 @GraphQLNonNull 5390 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5391 static CountingPaginatedData<ContentPageLayoutAreaObject> contentPageLayoutAreas(final DataFetchingEnvironment env, 5392 @GraphQLName("contentCollectionName") @GraphQLNonNull final String contentCollectionName, 5393 @GraphQLName("contentSectionName") @GraphQLNonNull final String contentSectionName, 5394 @GraphQLName("contentPageName") @GraphQLNonNull final String contentPageName) { 5395 CountingPaginatedData<ContentPageLayoutAreaObject> data; 5396 5397 try { 5398 var commandForm = ContentUtil.getHome().getGetContentPageLayoutAreasForm(); 5399 var command = CDI.current().select(GetContentPageLayoutAreasCommand.class).get(); 5400 5401 5402 commandForm.setContentCollectionName(contentCollectionName); 5403 commandForm.setContentSectionName(contentSectionName); 5404 commandForm.setContentPageName(contentPageName); 5405 5406 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5407 if(totalEntities == null) { 5408 data = Connections.emptyConnection(); 5409 } else { 5410 try(var objectLimiter = new ObjectLimiter(env, ContentPageLayoutAreaConstants.COMPONENT_VENDOR_NAME, ContentPageLayoutAreaConstants.ENTITY_TYPE_NAME, totalEntities)) { 5411 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5412 5413 var contentPageLayoutAreas = entities.stream() 5414 .map(ContentPageLayoutAreaObject::new) 5415 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5416 5417 data = new CountedObjects<>(objectLimiter, contentPageLayoutAreas); 5418 } 5419 } 5420 } catch (NamingException ex) { 5421 throw new RuntimeException(ex); 5422 } 5423 5424 return data; 5425 } 5426 5427 @GraphQLField 5428 @GraphQLName("contentPageAreaType") 5429 static ContentPageAreaTypeObject contentPageAreaType(final DataFetchingEnvironment env, 5430 @GraphQLName("contentPageAreaTypeName") final String contentPageAreaTypeName, 5431 @GraphQLName("id") @GraphQLID final String id) { 5432 ContentPageAreaType contentPageAreaType; 5433 5434 try { 5435 var commandForm = ContentUtil.getHome().getGetContentPageAreaTypeForm(); 5436 5437 commandForm.setContentPageAreaTypeName(contentPageAreaTypeName); 5438 commandForm.setUuid(id); 5439 5440 contentPageAreaType = CDI.current().select(GetContentPageAreaTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5441 } catch (NamingException ex) { 5442 throw new RuntimeException(ex); 5443 } 5444 5445 return contentPageAreaType == null ? null : new ContentPageAreaTypeObject(contentPageAreaType); 5446 } 5447 5448 @GraphQLField 5449 @GraphQLName("contentPageAreaTypes") 5450 @GraphQLNonNull 5451 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5452 static CountingPaginatedData<ContentPageAreaTypeObject> contentPageAreaTypes(final DataFetchingEnvironment env) { 5453 CountingPaginatedData<ContentPageAreaTypeObject> data; 5454 5455 try { 5456 var commandForm = ContentUtil.getHome().getGetContentPageAreaTypesForm(); 5457 var command = CDI.current().select(GetContentPageAreaTypesCommand.class).get(); 5458 5459 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5460 if(totalEntities == null) { 5461 data = Connections.emptyConnection(); 5462 } else { 5463 try(var objectLimiter = new ObjectLimiter(env, ContentPageAreaTypeConstants.COMPONENT_VENDOR_NAME, ContentPageAreaTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 5464 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5465 5466 var contentPageAreaTypes = entities.stream() 5467 .map(ContentPageAreaTypeObject::new) 5468 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5469 5470 data = new CountedObjects<>(objectLimiter, contentPageAreaTypes); 5471 } 5472 } 5473 } catch (NamingException ex) { 5474 throw new RuntimeException(ex); 5475 } 5476 5477 return data; 5478 } 5479 5480 @GraphQLField 5481 @GraphQLName("contentWebAddress") 5482 static ContentWebAddressObject contentWebAddress(final DataFetchingEnvironment env, 5483 @GraphQLName("contentWebAddressName") @GraphQLNonNull final String contentWebAddressName) { 5484 ContentWebAddress contentWebAddress; 5485 5486 try { 5487 var commandForm = ContentUtil.getHome().getGetContentWebAddressForm(); 5488 5489 commandForm.setContentWebAddressName(contentWebAddressName); 5490 5491 contentWebAddress = CDI.current().select(GetContentWebAddressCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5492 } catch (NamingException ex) { 5493 throw new RuntimeException(ex); 5494 } 5495 5496 return contentWebAddress == null ? null : new ContentWebAddressObject(contentWebAddress); 5497 } 5498 5499 @GraphQLField 5500 @GraphQLName("contentWebAddresses") 5501 @GraphQLNonNull 5502 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5503 static CountingPaginatedData<ContentWebAddressObject> contentWebAddresses(final DataFetchingEnvironment env) { 5504 CountingPaginatedData<ContentWebAddressObject> data; 5505 5506 try { 5507 var commandForm = ContentUtil.getHome().getGetContentWebAddressesForm(); 5508 var command = CDI.current().select(GetContentWebAddressesCommand.class).get(); 5509 5510 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5511 if(totalEntities == null) { 5512 data = Connections.emptyConnection(); 5513 } else { 5514 try(var objectLimiter = new ObjectLimiter(env, ContentWebAddressConstants.COMPONENT_VENDOR_NAME, ContentWebAddressConstants.ENTITY_TYPE_NAME, totalEntities)) { 5515 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5516 5517 var contentWebAddresses = entities.stream() 5518 .map(ContentWebAddressObject::new) 5519 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5520 5521 data = new CountedObjects<>(objectLimiter, contentWebAddresses); 5522 } 5523 } 5524 } catch (NamingException ex) { 5525 throw new RuntimeException(ex); 5526 } 5527 5528 return data; 5529 } 5530 5531 @GraphQLField 5532 @GraphQLName("contentCollection") 5533 static ContentCollectionObject contentCollection(final DataFetchingEnvironment env, 5534 @GraphQLName("contentCollectionName") final String contentCollectionName) { 5535 ContentCollection contentCollection; 5536 5537 try { 5538 var commandForm = ContentUtil.getHome().getGetContentCollectionForm(); 5539 5540 commandForm.setContentCollectionName(contentCollectionName); 5541 5542 contentCollection = CDI.current().select(GetContentCollectionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5543 } catch (NamingException ex) { 5544 throw new RuntimeException(ex); 5545 } 5546 5547 return contentCollection == null ? null : new ContentCollectionObject(contentCollection); 5548 } 5549 5550 @GraphQLField 5551 @GraphQLName("contentCollections") 5552 @GraphQLNonNull 5553 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5554 static CountingPaginatedData<ContentCollectionObject> contentCollections(final DataFetchingEnvironment env) { 5555 CountingPaginatedData<ContentCollectionObject> data; 5556 5557 try { 5558 var commandForm = ContentUtil.getHome().getGetContentCollectionsForm(); 5559 var command = CDI.current().select(GetContentCollectionsCommand.class).get(); 5560 5561 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5562 if(totalEntities == null) { 5563 data = Connections.emptyConnection(); 5564 } else { 5565 try(var objectLimiter = new ObjectLimiter(env, ContentCollectionConstants.COMPONENT_VENDOR_NAME, ContentCollectionConstants.ENTITY_TYPE_NAME, totalEntities)) { 5566 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5567 5568 var contentCollections = entities.stream() 5569 .map(ContentCollectionObject::new) 5570 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5571 5572 data = new CountedObjects<>(objectLimiter, contentCollections); 5573 } 5574 } 5575 } catch (NamingException ex) { 5576 throw new RuntimeException(ex); 5577 } 5578 5579 return data; 5580 } 5581 5582 @GraphQLField 5583 @GraphQLName("contentSection") 5584 static ContentSectionObject contentSection(final DataFetchingEnvironment env, 5585 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5586 @GraphQLName("contentCollectionName") final String contentCollectionName, 5587 @GraphQLName("contentSectionName") final String contentSectionName, 5588 @GraphQLName("associateProgramName") final String associateProgramName, 5589 @GraphQLName("associateName") final String associateName, 5590 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5591 ContentSection contentSection; 5592 5593 try { 5594 var commandForm = ContentUtil.getHome().getGetContentSectionForm(); 5595 5596 commandForm.setContentWebAddressName(contentWebAddressName); 5597 commandForm.setContentCollectionName(contentCollectionName); 5598 commandForm.setContentSectionName(contentSectionName); 5599 commandForm.setAssociateProgramName(associateProgramName); 5600 commandForm.setAssociateName(associateName); 5601 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5602 5603 contentSection = CDI.current().select(GetContentSectionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5604 } catch (NamingException ex) { 5605 throw new RuntimeException(ex); 5606 } 5607 5608 return contentSection == null ? null : new ContentSectionObject(contentSection); 5609 } 5610 5611 @GraphQLField 5612 @GraphQLName("contentSections") 5613 @GraphQLNonNull 5614 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5615 static CountingPaginatedData<ContentSectionObject> contentSections(final DataFetchingEnvironment env, 5616 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5617 @GraphQLName("contentCollectionName") final String contentCollectionName, 5618 @GraphQLName("parentContentSectionName") final String parentContentSectionName, 5619 @GraphQLName("associateProgramName") final String associateProgramName, 5620 @GraphQLName("associateName") final String associateName, 5621 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5622 CountingPaginatedData<ContentSectionObject> data; 5623 5624 try { 5625 var commandForm = ContentUtil.getHome().getGetContentSectionsForm(); 5626 var command = CDI.current().select(GetContentSectionsCommand.class).get(); 5627 5628 commandForm.setContentWebAddressName(contentWebAddressName); 5629 commandForm.setContentCollectionName(contentCollectionName); 5630 commandForm.setParentContentSectionName(parentContentSectionName); 5631 commandForm.setAssociateProgramName(associateProgramName); 5632 commandForm.setAssociateName(associateName); 5633 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5634 5635 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5636 if(totalEntities == null) { 5637 data = Connections.emptyConnection(); 5638 } else { 5639 try(var objectLimiter = new ObjectLimiter(env, ContentSectionConstants.COMPONENT_VENDOR_NAME, ContentSectionConstants.ENTITY_TYPE_NAME, totalEntities)) { 5640 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5641 5642 var contentSections = entities.stream() 5643 .map(ContentSectionObject::new) 5644 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5645 5646 data = new CountedObjects<>(objectLimiter, contentSections); 5647 } 5648 } 5649 } catch (NamingException ex) { 5650 throw new RuntimeException(ex); 5651 } 5652 5653 return data; 5654 } 5655 5656 @GraphQLField 5657 @GraphQLName("contentPage") 5658 static ContentPageObject contentPage(final DataFetchingEnvironment env, 5659 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5660 @GraphQLName("contentCollectionName") final String contentCollectionName, 5661 @GraphQLName("contentSectionName") final String contentSectionName, 5662 @GraphQLName("contentPageName") final String contentPageName, 5663 @GraphQLName("associateProgramName") final String associateProgramName, 5664 @GraphQLName("associateName") final String associateName, 5665 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5666 ContentPage contentPage; 5667 5668 try { 5669 var commandForm = ContentUtil.getHome().getGetContentPageForm(); 5670 5671 commandForm.setContentWebAddressName(contentWebAddressName); 5672 commandForm.setContentCollectionName(contentCollectionName); 5673 commandForm.setContentSectionName(contentSectionName); 5674 commandForm.setContentPageName(contentPageName); 5675 commandForm.setAssociateProgramName(associateProgramName); 5676 commandForm.setAssociateName(associateName); 5677 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5678 5679 contentPage = CDI.current().select(GetContentPageCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5680 } catch (NamingException ex) { 5681 throw new RuntimeException(ex); 5682 } 5683 5684 return contentPage == null ? null : new ContentPageObject(contentPage); 5685 } 5686 5687 @GraphQLField 5688 @GraphQLName("contentPages") 5689 @GraphQLNonNull 5690 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5691 static CountingPaginatedData<ContentPageObject> contentPages(final DataFetchingEnvironment env, 5692 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5693 @GraphQLName("contentCollectionName") final String contentCollectionName, 5694 @GraphQLName("contentSectionName") final String contentSectionName, 5695 @GraphQLName("associateProgramName") final String associateProgramName, 5696 @GraphQLName("associateName") final String associateName, 5697 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5698 CountingPaginatedData<ContentPageObject> data; 5699 5700 try { 5701 var commandForm = ContentUtil.getHome().getGetContentPagesForm(); 5702 var command = CDI.current().select(GetContentPagesCommand.class).get(); 5703 5704 commandForm.setContentWebAddressName(contentWebAddressName); 5705 commandForm.setContentCollectionName(contentCollectionName); 5706 commandForm.setContentSectionName(contentSectionName); 5707 commandForm.setAssociateProgramName(associateProgramName); 5708 commandForm.setAssociateName(associateName); 5709 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5710 5711 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5712 if(totalEntities == null) { 5713 data = Connections.emptyConnection(); 5714 } else { 5715 try(var objectLimiter = new ObjectLimiter(env, ContentPageConstants.COMPONENT_VENDOR_NAME, ContentPageConstants.ENTITY_TYPE_NAME, totalEntities)) { 5716 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5717 5718 var contentPages = entities.stream() 5719 .map(ContentPageObject::new) 5720 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5721 5722 data = new CountedObjects<>(objectLimiter, contentPages); 5723 } 5724 } 5725 } catch (NamingException ex) { 5726 throw new RuntimeException(ex); 5727 } 5728 5729 return data; 5730 } 5731 5732 @GraphQLField 5733 @GraphQLName("contentPageArea") 5734 static ContentPageAreaObject contentPageArea(final DataFetchingEnvironment env, 5735 @GraphQLName("contentCollectionName") @GraphQLNonNull final String contentCollectionName, 5736 @GraphQLName("contentSectionName") @GraphQLNonNull final String contentSectionName, 5737 @GraphQLName("contentPageName") @GraphQLNonNull final String contentPageName, 5738 @GraphQLName("sortOrder") @GraphQLNonNull final String sortOrder, 5739 @GraphQLName("languageIsoName") @GraphQLNonNull final String languageIsoName) { 5740 ContentPageArea contentPageArea; 5741 5742 try { 5743 var commandForm = ContentUtil.getHome().getGetContentPageAreaForm(); 5744 5745 commandForm.setContentCollectionName(contentCollectionName); 5746 commandForm.setContentSectionName(contentSectionName); 5747 commandForm.setContentPageName(contentPageName); 5748 commandForm.setSortOrder(sortOrder); 5749 commandForm.setLanguageIsoName(languageIsoName); 5750 5751 contentPageArea = CDI.current().select(GetContentPageAreaCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5752 } catch (NamingException ex) { 5753 throw new RuntimeException(ex); 5754 } 5755 5756 return contentPageArea == null ? null : new ContentPageAreaObject(contentPageArea); 5757 } 5758 5759 @GraphQLField 5760 @GraphQLName("contentPageAreas") 5761 @GraphQLNonNull 5762 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5763 static CountingPaginatedData<ContentPageAreaObject> contentPageAreas(final DataFetchingEnvironment env, 5764 @GraphQLName("contentCollectionName") @GraphQLNonNull final String contentCollectionName, 5765 @GraphQLName("contentSectionName") @GraphQLNonNull final String contentSectionName, 5766 @GraphQLName("contentPageName") @GraphQLNonNull final String contentPageName) { 5767 CountingPaginatedData<ContentPageAreaObject> data; 5768 5769 try { 5770 var commandForm = ContentUtil.getHome().getGetContentPageAreasForm(); 5771 var command = CDI.current().select(GetContentPageAreasCommand.class).get(); 5772 5773 5774 commandForm.setContentCollectionName(contentCollectionName); 5775 commandForm.setContentSectionName(contentSectionName); 5776 commandForm.setContentPageName(contentPageName); 5777 5778 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5779 if(totalEntities == null) { 5780 data = Connections.emptyConnection(); 5781 } else { 5782 try(var objectLimiter = new ObjectLimiter(env, ContentPageAreaConstants.COMPONENT_VENDOR_NAME, ContentPageAreaConstants.ENTITY_TYPE_NAME, totalEntities)) { 5783 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5784 5785 var contentPageAreas = entities.stream() 5786 .map(ContentPageAreaObject::new) 5787 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5788 5789 data = new CountedObjects<>(objectLimiter, contentPageAreas); 5790 } 5791 } 5792 } catch (NamingException ex) { 5793 throw new RuntimeException(ex); 5794 } 5795 5796 return data; 5797 } 5798 5799 5800 @GraphQLField 5801 @GraphQLName("contentCatalog") 5802 static ContentCatalogObject contentCatalog(final DataFetchingEnvironment env, 5803 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5804 @GraphQLName("contentCollectionName") final String contentCollectionName, 5805 @GraphQLName("contentCatalogName") final String contentCatalogName, 5806 @GraphQLName("associateProgramName") final String associateProgramName, 5807 @GraphQLName("associateName") final String associateName, 5808 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5809 ContentCatalog contentCatalog; 5810 5811 try { 5812 var commandForm = ContentUtil.getHome().getGetContentCatalogForm(); 5813 5814 commandForm.setContentWebAddressName(contentWebAddressName); 5815 commandForm.setContentCollectionName(contentCollectionName); 5816 commandForm.setContentCatalogName(contentCatalogName); 5817 commandForm.setAssociateProgramName(associateProgramName); 5818 commandForm.setAssociateName(associateName); 5819 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5820 5821 contentCatalog = CDI.current().select(GetContentCatalogCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5822 } catch (NamingException ex) { 5823 throw new RuntimeException(ex); 5824 } 5825 5826 return contentCatalog == null ? null : new ContentCatalogObject(contentCatalog); 5827 } 5828 5829 @GraphQLField 5830 @GraphQLName("contentCatalogs") 5831 @GraphQLNonNull 5832 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5833 static CountingPaginatedData<ContentCatalogObject> contentCatalogs(final DataFetchingEnvironment env, 5834 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5835 @GraphQLName("contentCollectionName") final String contentCollectionName, 5836 @GraphQLName("associateProgramName") final String associateProgramName, 5837 @GraphQLName("associateName") final String associateName, 5838 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5839 CountingPaginatedData<ContentCatalogObject> data; 5840 5841 try { 5842 var commandForm = ContentUtil.getHome().getGetContentCatalogsForm(); 5843 var command = CDI.current().select(GetContentCatalogsCommand.class).get(); 5844 5845 commandForm.setContentWebAddressName(contentWebAddressName); 5846 commandForm.setContentCollectionName(contentCollectionName); 5847 commandForm.setAssociateProgramName(associateProgramName); 5848 commandForm.setAssociateName(associateName); 5849 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5850 5851 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5852 if(totalEntities == null) { 5853 data = Connections.emptyConnection(); 5854 } else { 5855 try(var objectLimiter = new ObjectLimiter(env, ContentCatalogConstants.COMPONENT_VENDOR_NAME, ContentCatalogConstants.ENTITY_TYPE_NAME, totalEntities)) { 5856 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5857 5858 var contentCatalogs = entities.stream() 5859 .map(ContentCatalogObject::new) 5860 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5861 5862 data = new CountedObjects<>(objectLimiter, contentCatalogs); 5863 } 5864 } 5865 } catch (NamingException ex) { 5866 throw new RuntimeException(ex); 5867 } 5868 5869 return data; 5870 } 5871 5872 @GraphQLField 5873 @GraphQLName("contentCatalogItem") 5874 static ContentCatalogItemObject contentCatalogItem(final DataFetchingEnvironment env, 5875 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5876 @GraphQLName("contentCollectionName") final String contentCollectionName, 5877 @GraphQLName("contentCatalogName") final String contentCatalogName, 5878 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 5879 @GraphQLName("inventoryConditionName") final String inventoryConditionName, 5880 @GraphQLName("unitOfMeasureTypeName") final String unitOfMeasureTypeName, 5881 @GraphQLName("currencyIsoName") final String currencyIsoName, 5882 @GraphQLName("associateProgramName") final String associateProgramName, 5883 @GraphQLName("associateName") final String associateName, 5884 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5885 ContentCatalogItem contentCatalogItem; 5886 5887 try { 5888 var commandForm = ContentUtil.getHome().getGetContentCatalogItemForm(); 5889 5890 commandForm.setContentWebAddressName(contentWebAddressName); 5891 commandForm.setContentCollectionName(contentCollectionName); 5892 commandForm.setContentCatalogName(contentCatalogName); 5893 commandForm.setItemName(itemName); 5894 commandForm.setInventoryConditionName(inventoryConditionName); 5895 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 5896 commandForm.setCurrencyIsoName(currencyIsoName); 5897 commandForm.setAssociateProgramName(associateProgramName); 5898 commandForm.setAssociateName(associateName); 5899 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5900 5901 contentCatalogItem = CDI.current().select(GetContentCatalogItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5902 } catch (NamingException ex) { 5903 throw new RuntimeException(ex); 5904 } 5905 5906 return contentCatalogItem == null ? null : new ContentCatalogItemObject(contentCatalogItem); 5907 } 5908 5909 @GraphQLField 5910 @GraphQLName("contentCatalogItems") 5911 @GraphQLNonNull 5912 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5913 static CountingPaginatedData<ContentCatalogItemObject> contentCatalogItems(final DataFetchingEnvironment env, 5914 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5915 @GraphQLName("contentCollectionName") final String contentCollectionName, 5916 @GraphQLName("contentCatalogName") final String contentCatalogName, 5917 @GraphQLName("associateProgramName") final String associateProgramName, 5918 @GraphQLName("associateName") final String associateName, 5919 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5920 CountingPaginatedData<ContentCatalogItemObject> data; 5921 5922 try { 5923 var commandForm = ContentUtil.getHome().getGetContentCatalogItemsForm(); 5924 var command = CDI.current().select(GetContentCatalogItemsCommand.class).get(); 5925 5926 commandForm.setContentWebAddressName(contentWebAddressName); 5927 commandForm.setContentCollectionName(contentCollectionName); 5928 commandForm.setContentCatalogName(contentCatalogName); 5929 commandForm.setAssociateProgramName(associateProgramName); 5930 commandForm.setAssociateName(associateName); 5931 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5932 5933 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5934 if(totalEntities == null) { 5935 data = Connections.emptyConnection(); 5936 } else { 5937 try(var objectLimiter = new ObjectLimiter(env, ContentCatalogItemConstants.COMPONENT_VENDOR_NAME, ContentCatalogItemConstants.ENTITY_TYPE_NAME, totalEntities)) { 5938 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 5939 5940 var contentCatalogItems = entities.stream() 5941 .map(ContentCatalogItemObject::new) 5942 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 5943 5944 data = new CountedObjects<>(objectLimiter, contentCatalogItems); 5945 } 5946 } 5947 } catch (NamingException ex) { 5948 throw new RuntimeException(ex); 5949 } 5950 5951 return data; 5952 } 5953 5954 @GraphQLField 5955 @GraphQLName("contentCategory") 5956 static ContentCategoryObject contentCategory(final DataFetchingEnvironment env, 5957 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5958 @GraphQLName("contentCollectionName") final String contentCollectionName, 5959 @GraphQLName("contentCatalogName") final String contentCatalogName, 5960 @GraphQLName("contentCategoryName") final String contentCategoryName, 5961 @GraphQLName("associateProgramName") final String associateProgramName, 5962 @GraphQLName("associateName") final String associateName, 5963 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5964 ContentCategory contentCategory; 5965 5966 try { 5967 var commandForm = ContentUtil.getHome().getGetContentCategoryForm(); 5968 5969 commandForm.setContentWebAddressName(contentWebAddressName); 5970 commandForm.setContentCollectionName(contentCollectionName); 5971 commandForm.setContentCatalogName(contentCatalogName); 5972 commandForm.setContentCategoryName(contentCategoryName); 5973 commandForm.setAssociateProgramName(associateProgramName); 5974 commandForm.setAssociateName(associateName); 5975 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 5976 5977 contentCategory = CDI.current().select(GetContentCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 5978 } catch (NamingException ex) { 5979 throw new RuntimeException(ex); 5980 } 5981 5982 return contentCategory == null ? null : new ContentCategoryObject(contentCategory); 5983 } 5984 5985 @GraphQLField 5986 @GraphQLName("contentCategories") 5987 @GraphQLNonNull 5988 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 5989 static CountingPaginatedData<ContentCategoryObject> contentCategories(final DataFetchingEnvironment env, 5990 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 5991 @GraphQLName("contentCollectionName") final String contentCollectionName, 5992 @GraphQLName("contentCatalogName") final String contentCatalogName, 5993 @GraphQLName("parentContentCategoryName") final String parentContentCategoryName, 5994 @GraphQLName("associateProgramName") final String associateProgramName, 5995 @GraphQLName("associateName") final String associateName, 5996 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 5997 CountingPaginatedData<ContentCategoryObject> data; 5998 5999 try { 6000 var commandForm = ContentUtil.getHome().getGetContentCategoriesForm(); 6001 var command = CDI.current().select(GetContentCategoriesCommand.class).get(); 6002 6003 commandForm.setContentWebAddressName(contentWebAddressName); 6004 commandForm.setContentCollectionName(contentCollectionName); 6005 commandForm.setContentCatalogName(contentCatalogName); 6006 commandForm.setParentContentCategoryName(parentContentCategoryName); 6007 commandForm.setAssociateProgramName(associateProgramName); 6008 commandForm.setAssociateName(associateName); 6009 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 6010 6011 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6012 if(totalEntities == null) { 6013 data = Connections.emptyConnection(); 6014 } else { 6015 try(var objectLimiter = new ObjectLimiter(env, ContentCategoryConstants.COMPONENT_VENDOR_NAME, ContentCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 6016 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6017 6018 var contentCategories = entities.stream() 6019 .map(ContentCategoryObject::new) 6020 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6021 6022 data = new CountedObjects<>(objectLimiter, contentCategories); 6023 } 6024 } 6025 } catch (NamingException ex) { 6026 throw new RuntimeException(ex); 6027 } 6028 6029 return data; 6030 } 6031 6032 @GraphQLField 6033 @GraphQLName("contentCategoryItem") 6034 static ContentCategoryItemObject contentCategoryItem(final DataFetchingEnvironment env, 6035 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 6036 @GraphQLName("contentCollectionName") final String contentCollectionName, 6037 @GraphQLName("contentCatalogName") final String contentCatalogName, 6038 @GraphQLName("contentCategoryName") final String contentCategoryName, 6039 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 6040 @GraphQLName("inventoryConditionName") final String inventoryConditionName, 6041 @GraphQLName("unitOfMeasureTypeName") final String unitOfMeasureTypeName, 6042 @GraphQLName("currencyIsoName") final String currencyIsoName, 6043 @GraphQLName("associateProgramName") final String associateProgramName, 6044 @GraphQLName("associateName") final String associateName, 6045 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 6046 ContentCategoryItem contentCategoryItem; 6047 6048 try { 6049 var commandForm = ContentUtil.getHome().getGetContentCategoryItemForm(); 6050 6051 commandForm.setContentWebAddressName(contentWebAddressName); 6052 commandForm.setContentCollectionName(contentCollectionName); 6053 commandForm.setContentCatalogName(contentCatalogName); 6054 commandForm.setContentCategoryName(contentCategoryName); 6055 commandForm.setItemName(itemName); 6056 commandForm.setInventoryConditionName(inventoryConditionName); 6057 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 6058 commandForm.setCurrencyIsoName(currencyIsoName); 6059 commandForm.setAssociateProgramName(associateProgramName); 6060 commandForm.setAssociateName(associateName); 6061 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 6062 6063 contentCategoryItem = CDI.current().select(GetContentCategoryItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6064 } catch (NamingException ex) { 6065 throw new RuntimeException(ex); 6066 } 6067 6068 return contentCategoryItem == null ? null : new ContentCategoryItemObject(contentCategoryItem); 6069 } 6070 6071 @GraphQLField 6072 @GraphQLName("contentCategoryItems") 6073 @GraphQLNonNull 6074 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6075 static CountingPaginatedData<ContentCategoryItemObject> contentCategoryItems(final DataFetchingEnvironment env, 6076 @GraphQLName("contentWebAddressName") final String contentWebAddressName, 6077 @GraphQLName("contentCollectionName") final String contentCollectionName, 6078 @GraphQLName("contentCatalogName") final String contentCatalogName, 6079 @GraphQLName("contentCategoryName") final String contentCategoryName, 6080 @GraphQLName("associateProgramName") final String associateProgramName, 6081 @GraphQLName("associateName") final String associateName, 6082 @GraphQLName("associatePartyContactMechanismName") final String associatePartyContactMechanismName) { 6083 CountingPaginatedData<ContentCategoryItemObject> data; 6084 6085 try { 6086 var commandForm = ContentUtil.getHome().getGetContentCategoryItemsForm(); 6087 var command = CDI.current().select(GetContentCategoryItemsCommand.class).get(); 6088 6089 commandForm.setContentWebAddressName(contentWebAddressName); 6090 commandForm.setContentCollectionName(contentCollectionName); 6091 commandForm.setContentCatalogName(contentCatalogName); 6092 commandForm.setContentCategoryName(contentCategoryName); 6093 commandForm.setAssociateProgramName(associateProgramName); 6094 commandForm.setAssociateName(associateName); 6095 commandForm.setAssociatePartyContactMechanismName(associatePartyContactMechanismName); 6096 6097 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6098 if(totalEntities == null) { 6099 data = Connections.emptyConnection(); 6100 } else { 6101 try(var objectLimiter = new ObjectLimiter(env, ContentCategoryItemConstants.COMPONENT_VENDOR_NAME, ContentCategoryItemConstants.ENTITY_TYPE_NAME, totalEntities)) { 6102 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6103 6104 var contentCategoryItems = entities.stream() 6105 .map(ContentCategoryItemObject::new) 6106 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6107 6108 data = new CountedObjects<>(objectLimiter, contentCategoryItems); 6109 } 6110 } 6111 } catch (NamingException ex) { 6112 throw new RuntimeException(ex); 6113 } 6114 6115 return data; 6116 } 6117 6118 @GraphQLField 6119 @GraphQLName("mimeTypeFileExtension") 6120 static MimeTypeFileExtensionObject mimeTypeFileExtension(final DataFetchingEnvironment env, 6121 @GraphQLName("fileExtension") @GraphQLNonNull final String fileExtension) { 6122 MimeTypeFileExtension mimeTypeFileExtension; 6123 6124 try { 6125 var commandForm = CoreUtil.getHome().getGetMimeTypeFileExtensionForm(); 6126 6127 commandForm.setFileExtension(fileExtension); 6128 6129 mimeTypeFileExtension = CDI.current().select(GetMimeTypeFileExtensionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6130 } catch (NamingException ex) { 6131 throw new RuntimeException(ex); 6132 } 6133 6134 return mimeTypeFileExtension == null ? null : new MimeTypeFileExtensionObject(mimeTypeFileExtension); 6135 } 6136 6137 @GraphQLField 6138 @GraphQLName("mimeTypeFileExtensions") 6139 static Collection<MimeTypeFileExtensionObject> mimeTypeFileExtensions(final DataFetchingEnvironment env) { 6140 Collection<MimeTypeFileExtension> mimeTypeFileExtensions; 6141 Collection<MimeTypeFileExtensionObject> mimeTypeFileExtensionObjects; 6142 6143 try { 6144 var commandForm = CoreUtil.getHome().getGetMimeTypeFileExtensionsForm(); 6145 6146 mimeTypeFileExtensions = CDI.current().select(GetMimeTypeFileExtensionsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6147 } catch (NamingException ex) { 6148 throw new RuntimeException(ex); 6149 } 6150 6151 if(mimeTypeFileExtensions == null) { 6152 mimeTypeFileExtensionObjects = emptyList(); 6153 } else { 6154 mimeTypeFileExtensionObjects = new ArrayList<>(mimeTypeFileExtensions.size()); 6155 6156 mimeTypeFileExtensions.stream() 6157 .map(MimeTypeFileExtensionObject::new) 6158 .forEachOrdered(mimeTypeFileExtensionObjects::add); 6159 } 6160 6161 return mimeTypeFileExtensionObjects; 6162 } 6163 6164 @GraphQLField 6165 @GraphQLName("mimeTypeUsageType") 6166 static MimeTypeUsageTypeObject mimeTypeUsageType(final DataFetchingEnvironment env, 6167 @GraphQLName("mimeTypeUsageTypeName") @GraphQLNonNull final String mimeTypeUsageTypeName) { 6168 MimeTypeUsageType mimeTypeUsageType; 6169 6170 try { 6171 var commandForm = CoreUtil.getHome().getGetMimeTypeUsageTypeForm(); 6172 6173 commandForm.setMimeTypeUsageTypeName(mimeTypeUsageTypeName); 6174 6175 mimeTypeUsageType = CDI.current().select(GetMimeTypeUsageTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6176 } catch (NamingException ex) { 6177 throw new RuntimeException(ex); 6178 } 6179 6180 return mimeTypeUsageType == null ? null : new MimeTypeUsageTypeObject(mimeTypeUsageType); 6181 } 6182 6183 @GraphQLField 6184 @GraphQLName("mimeTypeUsageTypes") 6185 @GraphQLNonNull 6186 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6187 static CountingPaginatedData<MimeTypeUsageTypeObject> mimeTypeUsageTypes(final DataFetchingEnvironment env) { 6188 CountingPaginatedData<MimeTypeUsageTypeObject> data; 6189 6190 try { 6191 var commandForm = CoreUtil.getHome().getGetMimeTypeUsageTypesForm(); 6192 var command = CDI.current().select(GetMimeTypeUsageTypesCommand.class).get(); 6193 6194 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6195 if(totalEntities == null) { 6196 data = Connections.emptyConnection(); 6197 } else { 6198 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)) { 6199 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6200 6201 var mimeTypeUsageTypes = entities.stream() 6202 .map(MimeTypeUsageTypeObject::new) 6203 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6204 6205 data = new CountedObjects<>(objectLimiter, mimeTypeUsageTypes); 6206 } 6207 } 6208 } catch (NamingException ex) { 6209 throw new RuntimeException(ex); 6210 } 6211 6212 return data; 6213 } 6214 6215 @GraphQLField 6216 @GraphQLName("mimeType") 6217 static MimeTypeObject mimeType(final DataFetchingEnvironment env, 6218 @GraphQLName("mimeTypeName") @GraphQLNonNull final String mimeTypeName) { 6219 MimeType mimeType; 6220 6221 try { 6222 var commandForm = CoreUtil.getHome().getGetMimeTypeForm(); 6223 6224 commandForm.setMimeTypeName(mimeTypeName); 6225 6226 mimeType = CDI.current().select(GetMimeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6227 } catch (NamingException ex) { 6228 throw new RuntimeException(ex); 6229 } 6230 6231 return mimeType == null ? null : new MimeTypeObject(mimeType); 6232 } 6233 6234 @GraphQLField 6235 @GraphQLName("mimeTypes") 6236 @GraphQLNonNull 6237 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6238 static CountingPaginatedData<MimeTypeObject> mimeTypes(final DataFetchingEnvironment env, 6239 @GraphQLName("mimeTypeUsageTypeName") final String mimeTypeUsageTypeName) { 6240 CountingPaginatedData<MimeTypeObject> data; 6241 6242 try { 6243 var commandForm = CoreUtil.getHome().getGetMimeTypesForm(); 6244 var command = CDI.current().select(GetMimeTypesCommand.class).get(); 6245 6246 commandForm.setMimeTypeUsageTypeName(mimeTypeUsageTypeName); 6247 6248 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6249 if(totalEntities == null) { 6250 data = Connections.emptyConnection(); 6251 } else { 6252 try(var objectLimiter = new ObjectLimiter(env, MimeTypeConstants.COMPONENT_VENDOR_NAME, MimeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6253 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6254 6255 var mimeTypes = entities.stream() 6256 .map(MimeTypeObject::new) 6257 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6258 6259 data = new CountedObjects<>(objectLimiter, mimeTypes); 6260 } 6261 } 6262 } catch (NamingException ex) { 6263 throw new RuntimeException(ex); 6264 } 6265 6266 return data; 6267 } 6268 6269 @GraphQLField 6270 @GraphQLName("queueType") 6271 static QueueTypeObject queueType(final DataFetchingEnvironment env, 6272 @GraphQLName("queueTypeName") @GraphQLNonNull final String queueTypeName) { 6273 QueueType queueType; 6274 6275 try { 6276 var commandForm = QueueUtil.getHome().getGetQueueTypeForm(); 6277 6278 commandForm.setQueueTypeName(queueTypeName); 6279 6280 queueType = CDI.current().select(GetQueueTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6281 } catch (NamingException ex) { 6282 throw new RuntimeException(ex); 6283 } 6284 6285 return queueType == null ? null : new QueueTypeObject(queueType); 6286 } 6287 6288 @GraphQLField 6289 @GraphQLName("queueTypes") 6290 @GraphQLNonNull 6291 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6292 static CountingPaginatedData<QueueTypeObject> queueTypes(final DataFetchingEnvironment env) { 6293 CountingPaginatedData<QueueTypeObject> data; 6294 6295 try { 6296 var commandForm = QueueUtil.getHome().getGetQueueTypesForm(); 6297 var command = CDI.current().select(GetQueueTypesCommand.class).get(); 6298 6299 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6300 if(totalEntities == null) { 6301 data = Connections.emptyConnection(); 6302 } else { 6303 try(var objectLimiter = new ObjectLimiter(env, QueueTypeConstants.COMPONENT_VENDOR_NAME, QueueTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6304 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6305 6306 var queueTypes = entities.stream() 6307 .map(QueueTypeObject::new) 6308 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6309 6310 data = new CountedObjects<>(objectLimiter, queueTypes); 6311 } 6312 } 6313 } catch (NamingException ex) { 6314 throw new RuntimeException(ex); 6315 } 6316 6317 return data; 6318 } 6319 6320 @GraphQLField 6321 @GraphQLName("unitOfMeasureKindUse") 6322 static UnitOfMeasureKindUseObject unitOfMeasureKindUse(final DataFetchingEnvironment env, 6323 @GraphQLName("unitOfMeasureKindUseTypeName") @GraphQLNonNull final String unitOfMeasureKindUseTypeName, 6324 @GraphQLName("unitOfMeasureKindName") @GraphQLNonNull final String unitOfMeasureKindName) { 6325 UnitOfMeasureKindUse unitOfMeasureKindUse; 6326 6327 try { 6328 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindUseForm(); 6329 6330 commandForm.setUnitOfMeasureKindUseTypeName(unitOfMeasureKindUseTypeName); 6331 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 6332 6333 unitOfMeasureKindUse = CDI.current().select(GetUnitOfMeasureKindUseCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6334 } catch (NamingException ex) { 6335 throw new RuntimeException(ex); 6336 } 6337 6338 return unitOfMeasureKindUse == null ? null : new UnitOfMeasureKindUseObject(unitOfMeasureKindUse); 6339 } 6340 6341 @GraphQLField 6342 @GraphQLName("unitOfMeasureKindUses") 6343 static Collection<UnitOfMeasureKindUseObject> unitOfMeasureKindUses(final DataFetchingEnvironment env, 6344 @GraphQLName("unitOfMeasureKindUseTypeName") final String unitOfMeasureKindUseTypeName, 6345 @GraphQLName("unitOfMeasureKindName") final String unitOfMeasureKindName) { 6346 Collection<UnitOfMeasureKindUse> unitOfMeasureKindUses; 6347 Collection<UnitOfMeasureKindUseObject> unitOfMeasureKindUseObjects; 6348 6349 try { 6350 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindUsesForm(); 6351 6352 commandForm.setUnitOfMeasureKindUseTypeName(unitOfMeasureKindUseTypeName); 6353 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 6354 6355 unitOfMeasureKindUses = CDI.current().select(GetUnitOfMeasureKindUsesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6356 } catch (NamingException ex) { 6357 throw new RuntimeException(ex); 6358 } 6359 6360 if(unitOfMeasureKindUses == null) { 6361 unitOfMeasureKindUseObjects = emptyList(); 6362 } else { 6363 unitOfMeasureKindUseObjects = new ArrayList<>(unitOfMeasureKindUses.size()); 6364 6365 unitOfMeasureKindUses.stream() 6366 .map(UnitOfMeasureKindUseObject::new) 6367 .forEachOrdered(unitOfMeasureKindUseObjects::add); 6368 } 6369 6370 return unitOfMeasureKindUseObjects; 6371 } 6372 6373 @GraphQLField 6374 @GraphQLName("unitOfMeasureType") 6375 static UnitOfMeasureTypeObject unitOfMeasureType(final DataFetchingEnvironment env, 6376 @GraphQLName("unitOfMeasureKindName") @GraphQLNonNull final String unitOfMeasureKindName, 6377 @GraphQLName("unitOfMeasureTypeName") @GraphQLNonNull final String unitOfMeasureTypeName) { 6378 UnitOfMeasureType unitOfMeasureType; 6379 6380 try { 6381 var commandForm = UomUtil.getHome().getGetUnitOfMeasureTypeForm(); 6382 6383 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 6384 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 6385 6386 unitOfMeasureType = CDI.current().select(GetUnitOfMeasureTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6387 } catch (NamingException ex) { 6388 throw new RuntimeException(ex); 6389 } 6390 6391 return unitOfMeasureType == null ? null : new UnitOfMeasureTypeObject(unitOfMeasureType); 6392 } 6393 6394 @GraphQLField 6395 @GraphQLName("unitOfMeasureTypes") 6396 @GraphQLNonNull 6397 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6398 static CountingPaginatedData<UnitOfMeasureTypeObject> unitOfMeasureTypes(final DataFetchingEnvironment env, 6399 @GraphQLName("unitOfMeasureKindName") @GraphQLNonNull final String unitOfMeasureKindName) { 6400 CountingPaginatedData<UnitOfMeasureTypeObject> data; 6401 6402 try { 6403 var commandForm = UomUtil.getHome().getGetUnitOfMeasureTypesForm(); 6404 var command = CDI.current().select(GetUnitOfMeasureTypesCommand.class).get(); 6405 6406 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 6407 6408 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6409 if(totalEntities == null) { 6410 data = Connections.emptyConnection(); 6411 } else { 6412 try(var objectLimiter = new ObjectLimiter(env, UnitOfMeasureTypeConstants.COMPONENT_VENDOR_NAME, UnitOfMeasureTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6413 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6414 6415 var unitOfMeasureTypes = entities.stream() 6416 .map(UnitOfMeasureTypeObject::new) 6417 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6418 6419 data = new CountedObjects<>(objectLimiter, unitOfMeasureTypes); 6420 } 6421 } 6422 } catch (NamingException ex) { 6423 throw new RuntimeException(ex); 6424 } 6425 6426 return data; 6427 } 6428 6429 @GraphQLField 6430 @GraphQLName("unitOfMeasureKind") 6431 static UnitOfMeasureKindObject unitOfMeasureKind(final DataFetchingEnvironment env, 6432 @GraphQLName("unitOfMeasureKindName") @GraphQLNonNull final String unitOfMeasureKindName) { 6433 UnitOfMeasureKind unitOfMeasureKind; 6434 6435 try { 6436 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindForm(); 6437 6438 commandForm.setUnitOfMeasureKindName(unitOfMeasureKindName); 6439 6440 unitOfMeasureKind = CDI.current().select(GetUnitOfMeasureKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6441 } catch (NamingException ex) { 6442 throw new RuntimeException(ex); 6443 } 6444 6445 return unitOfMeasureKind == null ? null : new UnitOfMeasureKindObject(unitOfMeasureKind); 6446 } 6447 6448 @GraphQLField 6449 @GraphQLName("unitOfMeasureKinds") 6450 @GraphQLNonNull 6451 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6452 static CountingPaginatedData<UnitOfMeasureKindObject> unitOfMeasureKinds(final DataFetchingEnvironment env) { 6453 CountingPaginatedData<UnitOfMeasureKindObject> data; 6454 6455 try { 6456 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindsForm(); 6457 var command = CDI.current().select(GetUnitOfMeasureKindsCommand.class).get(); 6458 6459 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6460 if(totalEntities == null) { 6461 data = Connections.emptyConnection(); 6462 } else { 6463 try(var objectLimiter = new ObjectLimiter(env, UnitOfMeasureKindConstants.COMPONENT_VENDOR_NAME, UnitOfMeasureKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 6464 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6465 6466 var unitOfMeasureKinds = entities.stream() 6467 .map(UnitOfMeasureKindObject::new) 6468 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6469 6470 data = new CountedObjects<>(objectLimiter, unitOfMeasureKinds); 6471 } 6472 } 6473 } catch (NamingException ex) { 6474 throw new RuntimeException(ex); 6475 } 6476 6477 return data; 6478 } 6479 6480 @GraphQLField 6481 @GraphQLName("unitOfMeasureKindUseType") 6482 static UnitOfMeasureKindUseTypeObject unitOfMeasureKindUseType(final DataFetchingEnvironment env, 6483 @GraphQLName("unitOfMeasureKindUseTypeName") @GraphQLNonNull final String unitOfMeasureKindUseTypeName) { 6484 UnitOfMeasureKindUseType unitOfMeasureKindUseType; 6485 6486 try { 6487 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindUseTypeForm(); 6488 6489 commandForm.setUnitOfMeasureKindUseTypeName(unitOfMeasureKindUseTypeName); 6490 6491 unitOfMeasureKindUseType = CDI.current().select(GetUnitOfMeasureKindUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6492 } catch (NamingException ex) { 6493 throw new RuntimeException(ex); 6494 } 6495 6496 return unitOfMeasureKindUseType == null ? null : new UnitOfMeasureKindUseTypeObject(unitOfMeasureKindUseType); 6497 } 6498 6499 @GraphQLField 6500 @GraphQLName("unitOfMeasureKindUseTypes") 6501 @GraphQLNonNull 6502 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6503 static CountingPaginatedData<UnitOfMeasureKindUseTypeObject> unitOfMeasureKindUseTypes(final DataFetchingEnvironment env) { 6504 CountingPaginatedData<UnitOfMeasureKindUseTypeObject> data; 6505 6506 try { 6507 var commandForm = UomUtil.getHome().getGetUnitOfMeasureKindUseTypesForm(); 6508 var command = CDI.current().select(GetUnitOfMeasureKindUseTypesCommand.class).get(); 6509 6510 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6511 if(totalEntities == null) { 6512 data = Connections.emptyConnection(); 6513 } else { 6514 try(var objectLimiter = new ObjectLimiter(env, UnitOfMeasureKindUseTypeConstants.COMPONENT_VENDOR_NAME, UnitOfMeasureKindUseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6515 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6516 6517 var objects = entities.stream() 6518 .map(UnitOfMeasureKindUseTypeObject::new) 6519 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6520 6521 data = new CountedObjects<>(objectLimiter, objects); 6522 } 6523 } 6524 } catch (NamingException ex) { 6525 throw new RuntimeException(ex); 6526 } 6527 6528 return data; 6529 } 6530 6531 @GraphQLField 6532 @GraphQLName("entityAttributeType") 6533 static EntityAttributeTypeObject entityAttributeType(final DataFetchingEnvironment env, 6534 @GraphQLName("entityAttributeTypeName") @GraphQLNonNull final String entityAttributeTypeName) { 6535 EntityAttributeType entityAttributeType; 6536 6537 try { 6538 var commandForm = CoreUtil.getHome().getGetEntityAttributeTypeForm(); 6539 6540 commandForm.setEntityAttributeTypeName(entityAttributeTypeName); 6541 6542 entityAttributeType = CDI.current().select(GetEntityAttributeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6543 } catch (NamingException ex) { 6544 throw new RuntimeException(ex); 6545 } 6546 6547 return entityAttributeType == null ? null : new EntityAttributeTypeObject(entityAttributeType); 6548 } 6549 6550 @GraphQLField 6551 @GraphQLName("entityAttributeTypes") 6552 @GraphQLNonNull 6553 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6554 static CountingPaginatedData<EntityAttributeTypeObject> entityAttributeTypes(final DataFetchingEnvironment env) { 6555 CountingPaginatedData<EntityAttributeTypeObject> data; 6556 6557 try { 6558 var commandForm = CoreUtil.getHome().getGetEntityAttributeTypesForm(); 6559 var command = CDI.current().select(GetEntityAttributeTypesCommand.class).get(); 6560 6561 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6562 if(totalEntities == null) { 6563 data = Connections.emptyConnection(); 6564 } else { 6565 try(var objectLimiter = new ObjectLimiter(env, EntityAttributeTypeConstants.COMPONENT_VENDOR_NAME, EntityAttributeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 6566 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6567 6568 var entityAttributeTypes = entities.stream() 6569 .map(EntityAttributeTypeObject::new) 6570 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6571 6572 data = new CountedObjects<>(objectLimiter, entityAttributeTypes); 6573 } 6574 } 6575 } catch (NamingException ex) { 6576 throw new RuntimeException(ex); 6577 } 6578 6579 return data; 6580 } 6581 6582 @GraphQLField 6583 @GraphQLName("componentVendorResults") 6584 static ComponentVendorResultsObject componentVendorResults(final DataFetchingEnvironment env, 6585 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6586 ComponentVendorResultsObject componentVendorResultsObject = null; 6587 6588 try { 6589 var commandForm = SearchUtil.getHome().getGetComponentVendorResultsForm(); 6590 6591 commandForm.setSearchTypeName(searchTypeName); 6592 6593 if(CDI.current().select(GetComponentVendorResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6594 componentVendorResultsObject = new ComponentVendorResultsObject(commandForm); 6595 } 6596 } catch (NamingException ex) { 6597 throw new RuntimeException(ex); 6598 } 6599 6600 return componentVendorResultsObject; 6601 } 6602 6603 @GraphQLField 6604 @GraphQLName("entityTypeResults") 6605 static EntityTypeResultsObject entityTypeResults(final DataFetchingEnvironment env, 6606 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6607 EntityTypeResultsObject entityTypeResultsObject = null; 6608 6609 try { 6610 var commandForm = SearchUtil.getHome().getGetEntityTypeResultsForm(); 6611 6612 commandForm.setSearchTypeName(searchTypeName); 6613 6614 if(CDI.current().select(GetEntityTypeResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6615 entityTypeResultsObject = new EntityTypeResultsObject(commandForm); 6616 } 6617 } catch (NamingException ex) { 6618 throw new RuntimeException(ex); 6619 } 6620 6621 return entityTypeResultsObject; 6622 } 6623 6624 @GraphQLField 6625 @GraphQLName("entityAliasTypeResults") 6626 static EntityAliasTypeResultsObject entityAliasTypeResults(final DataFetchingEnvironment env, 6627 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6628 EntityAliasTypeResultsObject entityAliasTypeResultsObject = null; 6629 6630 try { 6631 var commandForm = SearchUtil.getHome().getGetEntityAliasTypeResultsForm(); 6632 6633 commandForm.setSearchTypeName(searchTypeName); 6634 6635 if(CDI.current().select(GetEntityAliasTypeResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6636 entityAliasTypeResultsObject = new EntityAliasTypeResultsObject(commandForm); 6637 } 6638 } catch (NamingException ex) { 6639 throw new RuntimeException(ex); 6640 } 6641 6642 return entityAliasTypeResultsObject; 6643 } 6644 6645 @GraphQLField 6646 @GraphQLName("entityAttributeGroupResults") 6647 static EntityAttributeGroupResultsObject entityAttributeGroupResults(final DataFetchingEnvironment env, 6648 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6649 EntityAttributeGroupResultsObject entityAttributeGroupResultsObject = null; 6650 6651 try { 6652 var commandForm = SearchUtil.getHome().getGetEntityAttributeGroupResultsForm(); 6653 6654 commandForm.setSearchTypeName(searchTypeName); 6655 6656 if(CDI.current().select(GetEntityAttributeGroupResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6657 entityAttributeGroupResultsObject = new EntityAttributeGroupResultsObject(commandForm); 6658 } 6659 } catch (NamingException ex) { 6660 throw new RuntimeException(ex); 6661 } 6662 6663 return entityAttributeGroupResultsObject; 6664 } 6665 6666 @GraphQLField 6667 @GraphQLName("entityAttributeResults") 6668 static EntityAttributeResultsObject entityAttributeResults(final DataFetchingEnvironment env, 6669 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6670 EntityAttributeResultsObject entityAttributeResultsObject = null; 6671 6672 try { 6673 var commandForm = SearchUtil.getHome().getGetEntityAttributeResultsForm(); 6674 6675 commandForm.setSearchTypeName(searchTypeName); 6676 6677 if(CDI.current().select(GetEntityAttributeResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6678 entityAttributeResultsObject = new EntityAttributeResultsObject(commandForm); 6679 } 6680 } catch (NamingException ex) { 6681 throw new RuntimeException(ex); 6682 } 6683 6684 return entityAttributeResultsObject; 6685 } 6686 6687 @GraphQLField 6688 @GraphQLName("entityListItemResults") 6689 static EntityListItemResultsObject entityListItemResults(final DataFetchingEnvironment env, 6690 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6691 EntityListItemResultsObject entityListItemResultsObject = null; 6692 6693 try { 6694 var commandForm = SearchUtil.getHome().getGetEntityListItemResultsForm(); 6695 6696 commandForm.setSearchTypeName(searchTypeName); 6697 6698 if(CDI.current().select(GetEntityListItemResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6699 entityListItemResultsObject = new EntityListItemResultsObject(commandForm); 6700 } 6701 } catch (NamingException ex) { 6702 throw new RuntimeException(ex); 6703 } 6704 6705 return entityListItemResultsObject; 6706 } 6707 6708 @GraphQLField 6709 @GraphQLName("customerResults") 6710 static CustomerResultsObject customerResults(final DataFetchingEnvironment env, 6711 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6712 CustomerResultsObject customerResultsObject = null; 6713 6714 try { 6715 var commandForm = SearchUtil.getHome().getGetCustomerResultsForm(); 6716 6717 commandForm.setSearchTypeName(searchTypeName); 6718 6719 if(CDI.current().select(GetCustomerResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6720 customerResultsObject = new CustomerResultsObject(commandForm); 6721 } 6722 } catch (NamingException ex) { 6723 throw new RuntimeException(ex); 6724 } 6725 6726 return customerResultsObject; 6727 } 6728 6729 @GraphQLField 6730 @GraphQLName("employeeResults") 6731 static EmployeeResultsObject employeeResults(final DataFetchingEnvironment env, 6732 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6733 EmployeeResultsObject employeeResultsObject = null; 6734 6735 try { 6736 var commandForm = SearchUtil.getHome().getGetEmployeeResultsForm(); 6737 6738 commandForm.setSearchTypeName(searchTypeName); 6739 6740 if(CDI.current().select(GetEmployeeResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6741 employeeResultsObject = new EmployeeResultsObject(commandForm); 6742 } 6743 } catch (NamingException ex) { 6744 throw new RuntimeException(ex); 6745 } 6746 6747 return employeeResultsObject; 6748 } 6749 6750 @GraphQLField 6751 @GraphQLName("itemResults") 6752 static ItemResultsObject itemResults(final DataFetchingEnvironment env, 6753 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6754 ItemResultsObject itemResultsObject = null; 6755 6756 try { 6757 var commandForm = SearchUtil.getHome().getGetItemResultsForm(); 6758 6759 commandForm.setSearchTypeName(searchTypeName); 6760 6761 if(CDI.current().select(GetItemResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6762 itemResultsObject = new ItemResultsObject(commandForm); 6763 } 6764 } catch (NamingException ex) { 6765 throw new RuntimeException(ex); 6766 } 6767 6768 return itemResultsObject; 6769 } 6770 6771 @GraphQLField 6772 @GraphQLName("checkItemSpelling") 6773 static CheckItemSpellingObject checkItemSpelling(final DataFetchingEnvironment env, 6774 @GraphQLName("languageIsoName") final String languageIsoName, 6775 @GraphQLName("searchDefaultOperatorName") final String searchDefaultOperatorName, 6776 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName, 6777 @GraphQLName("q") final String q) { 6778 var checkItemSpellingObject = new CheckItemSpellingObject(); 6779 6780 try { 6781 var commandForm = SearchUtil.getHome().getCheckItemSpellingForm(); 6782 6783 commandForm.setLanguageIsoName(languageIsoName); 6784 commandForm.setSearchDefaultOperatorName(searchDefaultOperatorName); 6785 commandForm.setSearchTypeName(searchTypeName); 6786 commandForm.setQ(q); 6787 6788 var commandResult = SearchUtil.getHome().checkItemSpelling(getUserVisitPK(env), commandForm); 6789 checkItemSpellingObject.setCommandResult(commandResult); 6790 checkItemSpellingObject.setResult(commandResult.hasErrors() ? null : (CheckItemSpellingResult)commandResult.getExecutionResult().getResult()); 6791 } catch (NamingException ex) { 6792 throw new RuntimeException(ex); 6793 } 6794 6795 return checkItemSpellingObject; 6796 } 6797 6798 @GraphQLField 6799 @GraphQLName("vendorResults") 6800 static VendorResultsObject vendorResults(final DataFetchingEnvironment env, 6801 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6802 VendorResultsObject vendorResultsObject = null; 6803 6804 try { 6805 var commandForm = SearchUtil.getHome().getGetVendorResultsForm(); 6806 6807 commandForm.setSearchTypeName(searchTypeName); 6808 6809 if(CDI.current().select(GetVendorResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6810 vendorResultsObject = new VendorResultsObject(commandForm); 6811 } 6812 } catch (NamingException ex) { 6813 throw new RuntimeException(ex); 6814 } 6815 6816 return vendorResultsObject; 6817 } 6818 6819 @GraphQLField 6820 @GraphQLName("shippingMethodResults") 6821 static ShippingMethodResultsObject shippingMethodResults(final DataFetchingEnvironment env, 6822 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6823 ShippingMethodResultsObject shippingMethodResultsObject = null; 6824 6825 try { 6826 var commandForm = SearchUtil.getHome().getGetShippingMethodResultsForm(); 6827 6828 commandForm.setSearchTypeName(searchTypeName); 6829 6830 if(CDI.current().select(GetShippingMethodResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6831 shippingMethodResultsObject = new ShippingMethodResultsObject(commandForm); 6832 } 6833 } catch (NamingException ex) { 6834 throw new RuntimeException(ex); 6835 } 6836 6837 return shippingMethodResultsObject; 6838 } 6839 6840 @GraphQLField 6841 @GraphQLName("warehouseResults") 6842 static WarehouseResultsObject warehouseResults(final DataFetchingEnvironment env, 6843 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6844 WarehouseResultsObject warehouseResultsObject = null; 6845 6846 try { 6847 var commandForm = SearchUtil.getHome().getGetWarehouseResultsForm(); 6848 6849 commandForm.setSearchTypeName(searchTypeName); 6850 6851 if(CDI.current().select(GetWarehouseResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6852 warehouseResultsObject = new WarehouseResultsObject(commandForm); 6853 } 6854 } catch (NamingException ex) { 6855 throw new RuntimeException(ex); 6856 } 6857 6858 return warehouseResultsObject; 6859 } 6860 6861 @GraphQLField 6862 @GraphQLName("contentCatalogResults") 6863 static ContentCatalogResultsObject contentCatalogResults(final DataFetchingEnvironment env, 6864 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6865 ContentCatalogResultsObject contentCatalogResultsObject = null; 6866 6867 try { 6868 var commandForm = SearchUtil.getHome().getGetContentCatalogResultsForm(); 6869 6870 commandForm.setSearchTypeName(searchTypeName); 6871 6872 if(CDI.current().select(GetContentCatalogResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6873 contentCatalogResultsObject = new ContentCatalogResultsObject(commandForm); 6874 } 6875 } catch (NamingException ex) { 6876 throw new RuntimeException(ex); 6877 } 6878 6879 return contentCatalogResultsObject; 6880 } 6881 6882 @GraphQLField 6883 @GraphQLName("contentCatalogItemResults") 6884 static ContentCatalogItemResultsObject contentCatalogItemResults(final DataFetchingEnvironment env, 6885 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6886 ContentCatalogItemResultsObject contentCatalogItemResultsObject = null; 6887 6888 try { 6889 var commandForm = SearchUtil.getHome().getGetContentCatalogItemResultsForm(); 6890 6891 commandForm.setSearchTypeName(searchTypeName); 6892 6893 if(CDI.current().select(GetContentCatalogItemResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6894 contentCatalogItemResultsObject = new ContentCatalogItemResultsObject(commandForm); 6895 } 6896 } catch (NamingException ex) { 6897 throw new RuntimeException(ex); 6898 } 6899 6900 return contentCatalogItemResultsObject; 6901 } 6902 6903 @GraphQLField 6904 @GraphQLName("contentCategoryResults") 6905 static ContentCategoryResultsObject contentCategoryResults(final DataFetchingEnvironment env, 6906 @GraphQLName("searchTypeName") @GraphQLNonNull final String searchTypeName) { 6907 ContentCategoryResultsObject contentCategoryResultsObject = null; 6908 6909 try { 6910 var commandForm = SearchUtil.getHome().getGetContentCategoryResultsForm(); 6911 6912 commandForm.setSearchTypeName(searchTypeName); 6913 6914 if(CDI.current().select(GetContentCategoryResultsCommand.class).get().canQueryByGraphQl(getUserVisitPK(env), commandForm)) { 6915 contentCategoryResultsObject = new ContentCategoryResultsObject(commandForm); 6916 } 6917 } catch (NamingException ex) { 6918 throw new RuntimeException(ex); 6919 } 6920 6921 return contentCategoryResultsObject; 6922 } 6923 6924 @GraphQLField 6925 @GraphQLName("color") 6926 static ColorObject color(final DataFetchingEnvironment env, 6927 @GraphQLName("colorName") final String colorName, 6928 @GraphQLName("id") @GraphQLID final String id) { 6929 Color color; 6930 6931 try { 6932 var commandForm = CoreUtil.getHome().getGetColorForm(); 6933 6934 commandForm.setColorName(colorName); 6935 commandForm.setUuid(id); 6936 6937 color = CDI.current().select(GetColorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6938 } catch (NamingException ex) { 6939 throw new RuntimeException(ex); 6940 } 6941 6942 return color == null ? null : new ColorObject(color); 6943 } 6944 6945 @GraphQLField 6946 @GraphQLName("colors") 6947 @GraphQLNonNull 6948 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 6949 static CountingPaginatedData<ColorObject> colors(final DataFetchingEnvironment env) { 6950 CountingPaginatedData<ColorObject> data; 6951 6952 try { 6953 var commandForm = CoreUtil.getHome().getGetColorsForm(); 6954 var command = CDI.current().select(GetColorsCommand.class).get(); 6955 6956 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6957 if(totalEntities == null) { 6958 data = Connections.emptyConnection(); 6959 } else { 6960 try(var objectLimiter = new ObjectLimiter(env, ColorConstants.COMPONENT_VENDOR_NAME, ColorConstants.ENTITY_TYPE_NAME, totalEntities)) { 6961 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 6962 6963 var colors = entities.stream() 6964 .map(ColorObject::new) 6965 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 6966 6967 data = new CountedObjects<>(objectLimiter, colors); 6968 } 6969 } 6970 } catch (NamingException ex) { 6971 throw new RuntimeException(ex); 6972 } 6973 6974 return data; 6975 } 6976 6977 @GraphQLField 6978 @GraphQLName("fontStyle") 6979 static FontStyleObject fontStyle(final DataFetchingEnvironment env, 6980 @GraphQLName("fontStyleName") final String fontStyleName, 6981 @GraphQLName("id") @GraphQLID final String id) { 6982 FontStyle fontStyle; 6983 6984 try { 6985 var commandForm = CoreUtil.getHome().getGetFontStyleForm(); 6986 6987 commandForm.setFontStyleName(fontStyleName); 6988 commandForm.setUuid(id); 6989 6990 fontStyle = CDI.current().select(GetFontStyleCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 6991 } catch (NamingException ex) { 6992 throw new RuntimeException(ex); 6993 } 6994 6995 return fontStyle == null ? null : new FontStyleObject(fontStyle); 6996 } 6997 6998 @GraphQLField 6999 @GraphQLName("fontStyles") 7000 @GraphQLNonNull 7001 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7002 static CountingPaginatedData<FontStyleObject> fontStyles(final DataFetchingEnvironment env) { 7003 CountingPaginatedData<FontStyleObject> data; 7004 7005 try { 7006 var commandForm = CoreUtil.getHome().getGetFontStylesForm(); 7007 var command = CDI.current().select(GetFontStylesCommand.class).get(); 7008 7009 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7010 if(totalEntities == null) { 7011 data = Connections.emptyConnection(); 7012 } else { 7013 try(var objectLimiter = new ObjectLimiter(env, FontStyleConstants.COMPONENT_VENDOR_NAME, FontStyleConstants.ENTITY_TYPE_NAME, totalEntities)) { 7014 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7015 7016 var fontStyles = entities.stream() 7017 .map(FontStyleObject::new) 7018 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7019 7020 data = new CountedObjects<>(objectLimiter, fontStyles); 7021 } 7022 } 7023 } catch (NamingException ex) { 7024 throw new RuntimeException(ex); 7025 } 7026 7027 return data; 7028 } 7029 7030 @GraphQLField 7031 @GraphQLName("fontWeight") 7032 static FontWeightObject fontWeight(final DataFetchingEnvironment env, 7033 @GraphQLName("fontWeightName") final String fontWeightName, 7034 @GraphQLName("id") @GraphQLID final String id) { 7035 FontWeight fontWeight; 7036 7037 try { 7038 var commandForm = CoreUtil.getHome().getGetFontWeightForm(); 7039 7040 commandForm.setFontWeightName(fontWeightName); 7041 commandForm.setUuid(id); 7042 7043 fontWeight = CDI.current().select(GetFontWeightCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7044 } catch (NamingException ex) { 7045 throw new RuntimeException(ex); 7046 } 7047 7048 return fontWeight == null ? null : new FontWeightObject(fontWeight); 7049 } 7050 7051 @GraphQLField 7052 @GraphQLName("fontWeights") 7053 @GraphQLNonNull 7054 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7055 static CountingPaginatedData<FontWeightObject> fontWeights(final DataFetchingEnvironment env) { 7056 CountingPaginatedData<FontWeightObject> data; 7057 7058 try { 7059 var commandForm = CoreUtil.getHome().getGetFontWeightsForm(); 7060 var command = CDI.current().select(GetFontWeightsCommand.class).get(); 7061 7062 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7063 if(totalEntities == null) { 7064 data = Connections.emptyConnection(); 7065 } else { 7066 try(var objectLimiter = new ObjectLimiter(env, FontWeightConstants.COMPONENT_VENDOR_NAME, FontWeightConstants.ENTITY_TYPE_NAME, totalEntities)) { 7067 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7068 7069 var fontWeights = entities.stream() 7070 .map(FontWeightObject::new) 7071 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7072 7073 data = new CountedObjects<>(objectLimiter, fontWeights); 7074 } 7075 } 7076 } catch (NamingException ex) { 7077 throw new RuntimeException(ex); 7078 } 7079 7080 return data; 7081 } 7082 7083 @GraphQLField 7084 @GraphQLName("textDecoration") 7085 static TextDecorationObject textDecoration(final DataFetchingEnvironment env, 7086 @GraphQLName("textDecorationName") final String textDecorationName, 7087 @GraphQLName("id") @GraphQLID final String id) { 7088 TextDecoration textDecoration; 7089 7090 try { 7091 var commandForm = CoreUtil.getHome().getGetTextDecorationForm(); 7092 7093 commandForm.setTextDecorationName(textDecorationName); 7094 commandForm.setUuid(id); 7095 7096 textDecoration = CDI.current().select(GetTextDecorationCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7097 } catch (NamingException ex) { 7098 throw new RuntimeException(ex); 7099 } 7100 7101 return textDecoration == null ? null : new TextDecorationObject(textDecoration); 7102 } 7103 7104 @GraphQLField 7105 @GraphQLName("textDecorations") 7106 @GraphQLNonNull 7107 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7108 static CountingPaginatedData<TextDecorationObject> textDecorations(final DataFetchingEnvironment env) { 7109 CountingPaginatedData<TextDecorationObject> data; 7110 7111 try { 7112 var commandForm = CoreUtil.getHome().getGetTextDecorationsForm(); 7113 var command = CDI.current().select(GetTextDecorationsCommand.class).get(); 7114 7115 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7116 if(totalEntities == null) { 7117 data = Connections.emptyConnection(); 7118 } else { 7119 try(var objectLimiter = new ObjectLimiter(env, TextDecorationConstants.COMPONENT_VENDOR_NAME, TextDecorationConstants.ENTITY_TYPE_NAME, totalEntities)) { 7120 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7121 7122 var textDecorations = entities.stream() 7123 .map(TextDecorationObject::new) 7124 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7125 7126 data = new CountedObjects<>(objectLimiter, textDecorations); 7127 } 7128 } 7129 } catch (NamingException ex) { 7130 throw new RuntimeException(ex); 7131 } 7132 7133 return data; 7134 } 7135 7136 @GraphQLField 7137 @GraphQLName("textTransformation") 7138 static TextTransformationObject textTransformation(final DataFetchingEnvironment env, 7139 @GraphQLName("textTransformationName") final String textTransformationName, 7140 @GraphQLName("id") @GraphQLID final String id) { 7141 TextTransformation textTransformation; 7142 7143 try { 7144 var commandForm = CoreUtil.getHome().getGetTextTransformationForm(); 7145 7146 commandForm.setTextTransformationName(textTransformationName); 7147 commandForm.setUuid(id); 7148 7149 textTransformation = CDI.current().select(GetTextTransformationCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7150 } catch (NamingException ex) { 7151 throw new RuntimeException(ex); 7152 } 7153 7154 return textTransformation == null ? null : new TextTransformationObject(textTransformation); 7155 } 7156 7157 @GraphQLField 7158 @GraphQLName("textTransformations") 7159 @GraphQLNonNull 7160 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7161 static CountingPaginatedData<TextTransformationObject> textTransformations(final DataFetchingEnvironment env) { 7162 CountingPaginatedData<TextTransformationObject> data; 7163 7164 try { 7165 var commandForm = CoreUtil.getHome().getGetTextTransformationsForm(); 7166 var command = CDI.current().select(GetTextTransformationsCommand.class).get(); 7167 7168 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7169 if(totalEntities == null) { 7170 data = Connections.emptyConnection(); 7171 } else { 7172 try(var objectLimiter = new ObjectLimiter(env, TextTransformationConstants.COMPONENT_VENDOR_NAME, TextTransformationConstants.ENTITY_TYPE_NAME, totalEntities)) { 7173 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7174 7175 var textTransformations = entities.stream() 7176 .map(TextTransformationObject::new) 7177 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7178 7179 data = new CountedObjects<>(objectLimiter, textTransformations); 7180 } 7181 } 7182 } catch (NamingException ex) { 7183 throw new RuntimeException(ex); 7184 } 7185 7186 return data; 7187 } 7188 7189 @GraphQLField 7190 @GraphQLName("userLogin") 7191 static UserLoginObject userLogin(final DataFetchingEnvironment env, 7192 @GraphQLName("username") final String username, 7193 @GraphQLName("id") @GraphQLID final String id) { 7194 UserLogin userLogin; 7195 7196 try { 7197 var commandForm = UserUtil.getHome().getGetUserLoginForm(); 7198 7199 commandForm.setUsername(username); 7200 commandForm.setUuid(id); 7201 7202 var getUserLoginCommand = CDI.current().select(GetUserLoginCommand.class).get(); 7203 userLogin = getUserLoginCommand.getEntityForGraphQl(getUserVisitPK(env), commandForm); 7204 } catch (NamingException ex) { 7205 throw new RuntimeException(ex); 7206 } 7207 7208 return userLogin == null ? null : new UserLoginObject(userLogin); 7209 } 7210 7211 @GraphQLField 7212 @GraphQLName("recoveryQuestion") 7213 static RecoveryQuestionObject recoveryQuestion(final DataFetchingEnvironment env, 7214 @GraphQLName("recoveryQuestionName") final String recoveryQuestionName, 7215 @GraphQLName("id") @GraphQLID final String id, 7216 @GraphQLName("username") final String username) { 7217 RecoveryQuestion recoveryQuestion; 7218 7219 try { 7220 var commandForm = UserUtil.getHome().getGetRecoveryQuestionForm(); 7221 7222 commandForm.setRecoveryQuestionName(recoveryQuestionName); 7223 commandForm.setUuid(id); 7224 commandForm.setUsername(username); 7225 7226 recoveryQuestion = CDI.current().select(GetRecoveryQuestionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7227 } catch (NamingException ex) { 7228 throw new RuntimeException(ex); 7229 } 7230 7231 return recoveryQuestion == null ? null : new RecoveryQuestionObject(recoveryQuestion); 7232 } 7233 7234 @GraphQLField 7235 @GraphQLName("recoveryQuestions") 7236 @GraphQLNonNull 7237 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7238 static CountingPaginatedData<RecoveryQuestionObject> recoveryQuestions(final DataFetchingEnvironment env) { 7239 CountingPaginatedData<RecoveryQuestionObject> data; 7240 7241 try { 7242 var commandForm = UserUtil.getHome().getGetRecoveryQuestionsForm(); 7243 var command = CDI.current().select(GetRecoveryQuestionsCommand.class).get(); 7244 7245 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7246 if(totalEntities == null) { 7247 data = Connections.emptyConnection(); 7248 } else { 7249 try(var objectLimiter = new ObjectLimiter(env, RecoveryQuestionConstants.COMPONENT_VENDOR_NAME, RecoveryQuestionConstants.ENTITY_TYPE_NAME, totalEntities)) { 7250 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7251 7252 var recoveryQuestions = entities.stream() 7253 .map(RecoveryQuestionObject::new) 7254 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7255 7256 data = new CountedObjects<>(objectLimiter, recoveryQuestions); 7257 } 7258 } 7259 } catch (NamingException ex) { 7260 throw new RuntimeException(ex); 7261 } 7262 7263 return data; 7264 } 7265 7266 @GraphQLField 7267 @GraphQLName("userSession") 7268 static UserSessionObject userSession(final DataFetchingEnvironment env) { 7269 var userSession = BaseGraphQl.getUserSession(env); 7270 7271 return userSession == null ? null : new UserSessionObject(userSession); 7272 } 7273 7274 @GraphQLField 7275 @GraphQLName("userVisitGroup") 7276 static UserVisitGroupObject userVisitGroup(final DataFetchingEnvironment env, 7277 @GraphQLName("userVisitGroupName") final String userVisitGroupName, 7278 @GraphQLName("id") @GraphQLID final String id) { 7279 UserVisitGroup userVisitGroup; 7280 7281 try { 7282 var commandForm = UserUtil.getHome().getGetUserVisitGroupForm(); 7283 7284 commandForm.setUserVisitGroupName(userVisitGroupName); 7285 commandForm.setUuid(id); 7286 7287 userVisitGroup = CDI.current().select(GetUserVisitGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7288 } catch (NamingException ex) { 7289 throw new RuntimeException(ex); 7290 } 7291 7292 return userVisitGroup == null ? null : new UserVisitGroupObject(userVisitGroup); 7293 } 7294 7295 @GraphQLField 7296 @GraphQLName("userVisitGroups") 7297 @GraphQLNonNull 7298 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7299 static CountingPaginatedData<UserVisitGroupObject> userVisitGroups(final DataFetchingEnvironment env) { 7300 CountingPaginatedData<UserVisitGroupObject> data; 7301 7302 try { 7303 var commandForm = UserUtil.getHome().getGetUserVisitGroupsForm(); 7304 var command = CDI.current().select(GetUserVisitGroupsCommand.class).get(); 7305 7306 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7307 if(totalEntities == null) { 7308 data = Connections.emptyConnection(); 7309 } else { 7310 try(var objectLimiter = new ObjectLimiter(env, UserVisitGroupConstants.COMPONENT_VENDOR_NAME, UserVisitGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 7311 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7312 7313 var userVisitGroups = entities.stream() 7314 .map(UserVisitGroupObject::new) 7315 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7316 7317 data = new CountedObjects<>(objectLimiter, userVisitGroups); 7318 } 7319 } 7320 } catch (NamingException ex) { 7321 throw new RuntimeException(ex); 7322 } 7323 7324 return data; 7325 } 7326 7327 @GraphQLField 7328 @GraphQLName("userVisit") 7329 static UserVisitObject userVisit(final DataFetchingEnvironment env) { 7330 var userVisit = BaseGraphQl.getUserVisit(env); 7331 7332 return userVisit == null ? null : new UserVisitObject(userVisit); 7333 } 7334 7335 @GraphQLField 7336 @GraphQLName("symbolPosition") 7337 static SymbolPositionObject symbolPosition(final DataFetchingEnvironment env, 7338 @GraphQLName("symbolPositionName") final String symbolPositionName, 7339 @GraphQLName("id") @GraphQLID final String id) { 7340 SymbolPosition symbolPosition; 7341 7342 try { 7343 var commandForm = AccountingUtil.getHome().getGetSymbolPositionForm(); 7344 7345 commandForm.setSymbolPositionName(symbolPositionName); 7346 commandForm.setUuid(id); 7347 7348 symbolPosition = CDI.current().select(GetSymbolPositionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7349 } catch (NamingException ex) { 7350 throw new RuntimeException(ex); 7351 } 7352 7353 return symbolPosition == null ? null : new SymbolPositionObject(symbolPosition); 7354 } 7355 7356 @GraphQLField 7357 @GraphQLName("symbolPositions") 7358 @GraphQLNonNull 7359 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7360 static CountingPaginatedData<SymbolPositionObject> symbolPositions(final DataFetchingEnvironment env) { 7361 CountingPaginatedData<SymbolPositionObject> data; 7362 7363 try { 7364 var commandForm = AccountingUtil.getHome().getGetSymbolPositionsForm(); 7365 var command = CDI.current().select(GetSymbolPositionsCommand.class).get(); 7366 7367 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7368 if(totalEntities == null) { 7369 data = Connections.emptyConnection(); 7370 } else { 7371 try(var objectLimiter = new ObjectLimiter(env, SymbolPositionConstants.COMPONENT_VENDOR_NAME, SymbolPositionConstants.ENTITY_TYPE_NAME, totalEntities)) { 7372 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7373 7374 var symbolPositions = entities.stream() 7375 .map(SymbolPositionObject::new) 7376 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7377 7378 data = new CountedObjects<>(objectLimiter, symbolPositions); 7379 } 7380 } 7381 } catch (NamingException ex) { 7382 throw new RuntimeException(ex); 7383 } 7384 7385 return data; 7386 } 7387 7388 @GraphQLField 7389 @GraphQLName("currency") 7390 static CurrencyObject currency(final DataFetchingEnvironment env, 7391 @GraphQLName("currencyIsoName") final String currencyIsoName, 7392 @GraphQLName("id") @GraphQLID final String id) { 7393 Currency currency; 7394 7395 try { 7396 var commandForm = AccountingUtil.getHome().getGetCurrencyForm(); 7397 7398 commandForm.setCurrencyIsoName(currencyIsoName); 7399 commandForm.setUuid(id); 7400 7401 currency = CDI.current().select(GetCurrencyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7402 } catch (NamingException ex) { 7403 throw new RuntimeException(ex); 7404 } 7405 7406 return currency == null ? null : new CurrencyObject(currency); 7407 } 7408 7409 @GraphQLField 7410 @GraphQLName("currencies") 7411 @GraphQLNonNull 7412 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7413 static CountingPaginatedData<CurrencyObject> currencies(final DataFetchingEnvironment env) { 7414 CountingPaginatedData<CurrencyObject> data; 7415 7416 try { 7417 var commandForm = AccountingUtil.getHome().getGetCurrenciesForm(); 7418 var command = CDI.current().select(GetCurrenciesCommand.class).get(); 7419 7420 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7421 if(totalEntities == null) { 7422 data = Connections.emptyConnection(); 7423 } else { 7424 try(var objectLimiter = new ObjectLimiter(env, CurrencyConstants.COMPONENT_VENDOR_NAME, CurrencyConstants.ENTITY_TYPE_NAME, totalEntities)) { 7425 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7426 7427 var currencies = entities.stream() 7428 .map(CurrencyObject::new) 7429 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7430 7431 data = new CountedObjects<>(objectLimiter, currencies); 7432 } 7433 } 7434 } catch (NamingException ex) { 7435 throw new RuntimeException(ex); 7436 } 7437 7438 return data; 7439 } 7440 7441 @GraphQLField 7442 @GraphQLName("language") 7443 static LanguageObject language(final DataFetchingEnvironment env, 7444 @GraphQLName("languageIsoName") final String languageIsoName, 7445 @GraphQLName("id") @GraphQLID final String id) { 7446 Language language; 7447 7448 try { 7449 var commandForm = PartyUtil.getHome().getGetLanguageForm(); 7450 7451 commandForm.setLanguageIsoName(languageIsoName); 7452 commandForm.setUuid(id); 7453 7454 language = CDI.current().select(GetLanguageCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7455 } catch (NamingException ex) { 7456 throw new RuntimeException(ex); 7457 } 7458 7459 return language == null ? null : new LanguageObject(language); 7460 } 7461 7462 @GraphQLField 7463 @GraphQLName("languages") 7464 @GraphQLNonNull 7465 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7466 static CountingPaginatedData<LanguageObject> languages(final DataFetchingEnvironment env) { 7467 CountingPaginatedData<LanguageObject> data; 7468 7469 try { 7470 var commandForm = PartyUtil.getHome().getGetLanguagesForm(); 7471 var command = CDI.current().select(GetLanguagesCommand.class).get(); 7472 7473 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7474 if(totalEntities == null) { 7475 data = Connections.emptyConnection(); 7476 } else { 7477 try(var objectLimiter = new ObjectLimiter(env, LanguageConstants.COMPONENT_VENDOR_NAME, LanguageConstants.ENTITY_TYPE_NAME, totalEntities)) { 7478 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7479 7480 var languages = entities.stream() 7481 .map(LanguageObject::new) 7482 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7483 7484 data = new CountedObjects<>(objectLimiter, languages); 7485 } 7486 } 7487 } catch (NamingException ex) { 7488 throw new RuntimeException(ex); 7489 } 7490 7491 return data; 7492 } 7493 7494 @GraphQLField 7495 @GraphQLName("dateTimeFormat") 7496 static DateTimeFormatObject dateTimeFormat(final DataFetchingEnvironment env, 7497 @GraphQLName("dateTimeFormatName") final String dateTimeFormatName, 7498 @GraphQLName("id") @GraphQLID final String id) { 7499 DateTimeFormat dateTimeFormat; 7500 7501 try { 7502 var commandForm = PartyUtil.getHome().getGetDateTimeFormatForm(); 7503 7504 commandForm.setDateTimeFormatName(dateTimeFormatName); 7505 commandForm.setUuid(id); 7506 7507 dateTimeFormat = CDI.current().select(GetDateTimeFormatCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7508 } catch (NamingException ex) { 7509 throw new RuntimeException(ex); 7510 } 7511 7512 return dateTimeFormat == null ? null : new DateTimeFormatObject(dateTimeFormat); 7513 } 7514 7515 @GraphQLField 7516 @GraphQLName("dateTimeFormats") 7517 @GraphQLNonNull 7518 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7519 static CountingPaginatedData<DateTimeFormatObject> dateTimeFormats(final DataFetchingEnvironment env) { 7520 CountingPaginatedData<DateTimeFormatObject> data; 7521 7522 try { 7523 var commandForm = PartyUtil.getHome().getGetDateTimeFormatsForm(); 7524 var command = CDI.current().select(GetDateTimeFormatsCommand.class).get(); 7525 7526 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7527 if(totalEntities == null) { 7528 data = Connections.emptyConnection(); 7529 } else { 7530 try(var objectLimiter = new ObjectLimiter(env, DateTimeFormatConstants.COMPONENT_VENDOR_NAME, DateTimeFormatConstants.ENTITY_TYPE_NAME, totalEntities)) { 7531 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7532 7533 var dateTimeFormats = entities.stream() 7534 .map(DateTimeFormatObject::new) 7535 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7536 7537 data = new CountedObjects<>(objectLimiter, dateTimeFormats); 7538 } 7539 } 7540 } catch (NamingException ex) { 7541 throw new RuntimeException(ex); 7542 } 7543 7544 return data; 7545 } 7546 7547 @GraphQLField 7548 @GraphQLName("timeZone") 7549 static TimeZoneObject timeZone(final DataFetchingEnvironment env, 7550 @GraphQLName("javaTimeZoneName") final String javaTimeZoneName, 7551 @GraphQLName("id") @GraphQLID final String id) { 7552 TimeZone timeZone; 7553 7554 try { 7555 var commandForm = PartyUtil.getHome().getGetTimeZoneForm(); 7556 7557 commandForm.setJavaTimeZoneName(javaTimeZoneName); 7558 commandForm.setUuid(id); 7559 7560 timeZone = CDI.current().select(GetTimeZoneCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7561 } catch (NamingException ex) { 7562 throw new RuntimeException(ex); 7563 } 7564 7565 return timeZone == null ? null : new TimeZoneObject(timeZone); 7566 } 7567 7568 @GraphQLField 7569 @GraphQLName("timeZones") 7570 @GraphQLNonNull 7571 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7572 static CountingPaginatedData<TimeZoneObject> timeZones(final DataFetchingEnvironment env) { 7573 CountingPaginatedData<TimeZoneObject> data; 7574 7575 try { 7576 var commandForm = PartyUtil.getHome().getGetTimeZonesForm(); 7577 var command = CDI.current().select(GetTimeZonesCommand.class).get(); 7578 7579 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7580 if(totalEntities == null) { 7581 data = Connections.emptyConnection(); 7582 } else { 7583 try(var objectLimiter = new ObjectLimiter(env, TimeZoneConstants.COMPONENT_VENDOR_NAME, TimeZoneConstants.ENTITY_TYPE_NAME, totalEntities)) { 7584 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7585 7586 var timeZones = entities.stream() 7587 .map(TimeZoneObject::new) 7588 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7589 7590 data = new CountedObjects<>(objectLimiter, timeZones); 7591 } 7592 } 7593 } catch (NamingException ex) { 7594 throw new RuntimeException(ex); 7595 } 7596 7597 return data; 7598 } 7599 7600 @GraphQLField 7601 @GraphQLName("customerType") 7602 static CustomerTypeObject customerType(final DataFetchingEnvironment env, 7603 @GraphQLName("customerTypeName") final String customerTypeName, 7604 @GraphQLName("id") @GraphQLID final String id) { 7605 CustomerType customerType; 7606 7607 try { 7608 var commandForm = CustomerUtil.getHome().getGetCustomerTypeForm(); 7609 7610 commandForm.setCustomerTypeName(customerTypeName); 7611 commandForm.setUuid(id); 7612 7613 customerType = CDI.current().select(GetCustomerTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7614 } catch (NamingException ex) { 7615 throw new RuntimeException(ex); 7616 } 7617 7618 return customerType == null ? null : new CustomerTypeObject(customerType); 7619 } 7620 7621 @GraphQLField 7622 @GraphQLName("customerTypes") 7623 @GraphQLNonNull 7624 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7625 static CountingPaginatedData<CustomerTypeObject> customerTypes(final DataFetchingEnvironment env) { 7626 CountingPaginatedData<CustomerTypeObject> data; 7627 7628 try { 7629 var commandForm = CustomerUtil.getHome().getGetCustomerTypesForm(); 7630 var command = CDI.current().select(GetCustomerTypesCommand.class).get(); 7631 7632 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7633 if(totalEntities == null) { 7634 data = Connections.emptyConnection(); 7635 } else { 7636 try(var objectLimiter = new ObjectLimiter(env, CustomerTypeConstants.COMPONENT_VENDOR_NAME, CustomerTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 7637 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7638 7639 var customerTypes = entities.stream() 7640 .map(CustomerTypeObject::new) 7641 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7642 7643 data = new CountedObjects<>(objectLimiter, customerTypes); 7644 } 7645 } 7646 } catch (NamingException ex) { 7647 throw new RuntimeException(ex); 7648 } 7649 7650 return data; 7651 } 7652 7653 @GraphQLField 7654 @GraphQLName("customer") 7655 static CustomerObject customer(final DataFetchingEnvironment env, 7656 @GraphQLName("customerName") final String customerName, 7657 @GraphQLName("partyName") final String partyName, 7658 @GraphQLName("id") @GraphQLID final String id) { 7659 Customer customer; 7660 7661 try { 7662 var commandForm = CustomerUtil.getHome().getGetCustomerForm(); 7663 7664 commandForm.setCustomerName(customerName); 7665 commandForm.setPartyName(partyName); 7666 commandForm.setUuid(id); 7667 7668 customer = CDI.current().select(GetCustomerCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7669 } catch (NamingException ex) { 7670 throw new RuntimeException(ex); 7671 } 7672 7673 return customer == null ? null : new CustomerObject(customer); 7674 } 7675 7676 @GraphQLField 7677 @GraphQLName("customers") 7678 @GraphQLNonNull 7679 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7680 static CountingPaginatedData<CustomerObject> customers(final DataFetchingEnvironment env) { 7681 CountingPaginatedData<CustomerObject> data; 7682 7683 try { 7684 var commandForm = CustomerUtil.getHome().getGetCustomersForm(); 7685 var command = CDI.current().select(GetCustomersCommand.class).get(); 7686 7687 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7688 if(totalEntities == null) { 7689 data = Connections.emptyConnection(); 7690 } else { 7691 try(var objectLimiter = new ObjectLimiter(env, CustomerConstants.COMPONENT_VENDOR_NAME, CustomerConstants.ENTITY_TYPE_NAME, totalEntities)) { 7692 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7693 7694 var customers = entities.stream() 7695 .map(CustomerObject::new) 7696 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7697 7698 data = new CountedObjects<>(objectLimiter, customers); 7699 } 7700 } 7701 } catch (NamingException ex) { 7702 throw new RuntimeException(ex); 7703 } 7704 7705 return data; 7706 } 7707 7708 @GraphQLField 7709 @GraphQLName("employee") 7710 static EmployeeObject employee(final DataFetchingEnvironment env, 7711 @GraphQLName("employeeName") final String employeeName, 7712 @GraphQLName("partyName") final String partyName, 7713 @GraphQLName("id") @GraphQLID final String id) { 7714 PartyEmployee partyEmployee; 7715 7716 try { 7717 var commandForm = EmployeeUtil.getHome().getGetEmployeeForm(); 7718 7719 commandForm.setEmployeeName(employeeName); 7720 commandForm.setPartyName(partyName); 7721 commandForm.setUuid(id); 7722 7723 partyEmployee = CDI.current().select(GetEmployeeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7724 } catch (NamingException ex) { 7725 throw new RuntimeException(ex); 7726 } 7727 7728 return partyEmployee == null ? null : new EmployeeObject(partyEmployee); 7729 } 7730 7731 @GraphQLField 7732 @GraphQLName("employees") 7733 @GraphQLNonNull 7734 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7735 static CountingPaginatedData<EmployeeObject> employees(final DataFetchingEnvironment env) { 7736 CountingPaginatedData<EmployeeObject> data; 7737 7738 try { 7739 var commandForm = EmployeeUtil.getHome().getGetEmployeesForm(); 7740 var command = CDI.current().select(GetEmployeesCommand.class).get(); 7741 7742 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7743 if(totalEntities == null) { 7744 data = Connections.emptyConnection(); 7745 } else { 7746 try(var objectLimiter = new ObjectLimiter(env, PartyEmployeeConstants.COMPONENT_VENDOR_NAME, PartyEmployeeConstants.ENTITY_TYPE_NAME, totalEntities)) { 7747 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7748 7749 var employees = entities.stream() 7750 .map(EmployeeObject::new) 7751 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7752 7753 data = new CountedObjects<>(objectLimiter, employees); 7754 } 7755 } 7756 } catch (NamingException ex) { 7757 throw new RuntimeException(ex); 7758 } 7759 7760 return data; 7761 } 7762 7763 @GraphQLField 7764 @GraphQLName("vendorType") 7765 static VendorTypeObject vendorType(final DataFetchingEnvironment env, 7766 @GraphQLName("vendorTypeName") final String vendorTypeName, 7767 @GraphQLName("id") @GraphQLID final String id) { 7768 VendorType vendorType; 7769 7770 try { 7771 var commandForm = VendorUtil.getHome().getGetVendorTypeForm(); 7772 7773 commandForm.setVendorTypeName(vendorTypeName); 7774 commandForm.setUuid(id); 7775 7776 vendorType = CDI.current().select(GetVendorTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7777 } catch (NamingException ex) { 7778 throw new RuntimeException(ex); 7779 } 7780 7781 return vendorType == null ? null : new VendorTypeObject(vendorType); 7782 } 7783 7784 @GraphQLField 7785 @GraphQLName("vendorTypes") 7786 @GraphQLNonNull 7787 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7788 static CountingPaginatedData<VendorTypeObject> vendorTypes(final DataFetchingEnvironment env) { 7789 CountingPaginatedData<VendorTypeObject> data; 7790 7791 try { 7792 var commandForm = VendorUtil.getHome().getGetVendorTypesForm(); 7793 var command = CDI.current().select(GetVendorTypesCommand.class).get(); 7794 7795 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7796 if(totalEntities == null) { 7797 data = Connections.emptyConnection(); 7798 } else { 7799 try(var objectLimiter = new ObjectLimiter(env, VendorTypeConstants.COMPONENT_VENDOR_NAME, VendorTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 7800 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7801 7802 var vendorTypes = entities.stream() 7803 .map(VendorTypeObject::new) 7804 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7805 7806 data = new CountedObjects<>(objectLimiter, vendorTypes); 7807 } 7808 } 7809 } catch (NamingException ex) { 7810 throw new RuntimeException(ex); 7811 } 7812 7813 return data; 7814 } 7815 7816 @GraphQLField 7817 @GraphQLName("vendor") 7818 static VendorObject vendor(final DataFetchingEnvironment env, 7819 @GraphQLName("vendorName") final String vendorName, 7820 @GraphQLName("partyName") final String partyName, 7821 @GraphQLName("id") @GraphQLID final String id) { 7822 Vendor vendor; 7823 7824 try { 7825 var commandForm = VendorUtil.getHome().getGetVendorForm(); 7826 7827 commandForm.setVendorName(vendorName); 7828 commandForm.setPartyName(partyName); 7829 commandForm.setUuid(id); 7830 7831 vendor = CDI.current().select(GetVendorCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7832 } catch (NamingException ex) { 7833 throw new RuntimeException(ex); 7834 } 7835 7836 return vendor == null ? null : new VendorObject(vendor); 7837 } 7838 7839 @GraphQLField 7840 @GraphQLName("vendors") 7841 @GraphQLNonNull 7842 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 7843 static CountingPaginatedData<VendorObject> vendors(final DataFetchingEnvironment env) { 7844 CountingPaginatedData<VendorObject> data; 7845 7846 try { 7847 var commandForm = VendorUtil.getHome().getGetVendorsForm(); 7848 var command = CDI.current().select(GetVendorsCommand.class).get(); 7849 7850 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7851 if(totalEntities == null) { 7852 data = Connections.emptyConnection(); 7853 } else { 7854 try(var objectLimiter = new ObjectLimiter(env, VendorConstants.COMPONENT_VENDOR_NAME, VendorConstants.ENTITY_TYPE_NAME, totalEntities)) { 7855 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7856 7857 var vendors = entities.stream() 7858 .map(VendorObject::new) 7859 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 7860 7861 data = new CountedObjects<>(objectLimiter, vendors); 7862 } 7863 } 7864 } catch (NamingException ex) { 7865 throw new RuntimeException(ex); 7866 } 7867 7868 return data; 7869 } 7870 7871 @GraphQLField 7872 @GraphQLName("vendorItem") 7873 static VendorItemObject vendorItem(final DataFetchingEnvironment env, 7874 @GraphQLName("vendorName") final String vendorName, 7875 @GraphQLName("partyName") final String partyName, 7876 @GraphQLName("vendorItemName") final String vendorItemName, 7877 @GraphQLName("id") @GraphQLID final String id) { 7878 VendorItem vendorItem; 7879 7880 try { 7881 var commandForm = VendorUtil.getHome().getGetVendorItemForm(); 7882 7883 commandForm.setVendorName(vendorName); 7884 commandForm.setPartyName(partyName); 7885 commandForm.setVendorItemName(vendorItemName); 7886 commandForm.setUuid(id); 7887 7888 vendorItem = CDI.current().select(GetVendorItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7889 } catch (NamingException ex) { 7890 throw new RuntimeException(ex); 7891 } 7892 7893 return vendorItem == null ? null : new VendorItemObject(vendorItem); 7894 } 7895 7896 @GraphQLField 7897 @GraphQLName("vendorItems") 7898 static Collection<VendorItemObject> vendorItems(final DataFetchingEnvironment env, 7899 @GraphQLName("vendorName") final String vendorName, 7900 @GraphQLName("itemName") final String itemName) { 7901 Collection<VendorItem> vendorItems; 7902 Collection<VendorItemObject> vendorItemObjects; 7903 7904 try { 7905 var commandForm = VendorUtil.getHome().getGetVendorItemsForm(); 7906 7907 commandForm.setVendorName(vendorName); 7908 commandForm.setItemName(itemName); 7909 7910 vendorItems = CDI.current().select(GetVendorItemsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7911 } catch (NamingException ex) { 7912 throw new RuntimeException(ex); 7913 } 7914 7915 if(vendorItems == null) { 7916 vendorItemObjects = emptyList(); 7917 } else { 7918 vendorItemObjects = new ArrayList<>(vendorItems.size()); 7919 7920 vendorItems.stream() 7921 .map(VendorItemObject::new) 7922 .forEachOrdered(vendorItemObjects::add); 7923 } 7924 7925 return vendorItemObjects; 7926 } 7927 7928 @GraphQLField 7929 @GraphQLName("vendorItemCost") 7930 static VendorItemCostObject vendorItemCost(final DataFetchingEnvironment env, 7931 @GraphQLName("vendorName") final String vendorName, 7932 @GraphQLName("partyName") final String partyName, 7933 @GraphQLName("vendorItemName") @GraphQLNonNull final String vendorItemName, 7934 @GraphQLName("inventoryConditionName") @GraphQLNonNull final String inventoryConditionName, 7935 @GraphQLName("unitOfMeasureTypeName") @GraphQLNonNull final String unitOfMeasureTypeName) { 7936 VendorItemCost vendorItemCost; 7937 7938 try { 7939 var commandForm = VendorUtil.getHome().getGetVendorItemCostForm(); 7940 7941 commandForm.setVendorName(vendorName); 7942 commandForm.setPartyName(partyName); 7943 commandForm.setVendorItemName(vendorItemName); 7944 commandForm.setInventoryConditionName(inventoryConditionName); 7945 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 7946 7947 vendorItemCost = CDI.current().select(GetVendorItemCostCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 7948 } catch (NamingException ex) { 7949 throw new RuntimeException(ex); 7950 } 7951 7952 return vendorItemCost == null ? null : new VendorItemCostObject(vendorItemCost); 7953 } 7954 7955 @GraphQLField 7956 @GraphQLName("vendorItemCosts") 7957 static Collection<VendorItemCostObject> vendorItemCosts(final DataFetchingEnvironment env, 7958 @GraphQLName("vendorName") @GraphQLNonNull final String vendorName, 7959 @GraphQLName("vendorItemName") @GraphQLNonNull final String vendorItemName) { 7960 Collection<VendorItemCost> vendorItemCosts; 7961 Collection<VendorItemCostObject> vendorItemCostObjects; 7962 7963 try { 7964 var commandForm = VendorUtil.getHome().getGetVendorItemCostsForm(); 7965 7966 commandForm.setVendorName(vendorName); 7967 commandForm.setVendorItemName(vendorItemName); 7968 7969 vendorItemCosts = CDI.current().select(GetVendorItemCostsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 7970 } catch (NamingException ex) { 7971 throw new RuntimeException(ex); 7972 } 7973 7974 if(vendorItemCosts == null) { 7975 vendorItemCostObjects = emptyList(); 7976 } else { 7977 vendorItemCostObjects = new ArrayList<>(vendorItemCosts.size()); 7978 7979 vendorItemCosts.stream() 7980 .map(VendorItemCostObject::new) 7981 .forEachOrdered(vendorItemCostObjects::add); 7982 } 7983 7984 return vendorItemCostObjects; 7985 } 7986 7987 @GraphQLField 7988 @GraphQLName("roleType") 7989 static RoleTypeObject roleType(final DataFetchingEnvironment env, 7990 @GraphQLName("roleTypeName") final String roleTypeName, 7991 @GraphQLName("id") @GraphQLID final String id) { 7992 RoleType roleType; 7993 7994 try { 7995 var commandForm = PartyUtil.getHome().getGetRoleTypeForm(); 7996 7997 commandForm.setRoleTypeName(roleTypeName); 7998 commandForm.setUuid(id); 7999 8000 roleType = CDI.current().select(GetRoleTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8001 } catch (NamingException ex) { 8002 throw new RuntimeException(ex); 8003 } 8004 8005 return roleType == null ? null : new RoleTypeObject(roleType); 8006 } 8007 8008 @GraphQLField 8009 @GraphQLName("roleTypes") 8010 @GraphQLNonNull 8011 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8012 static CountingPaginatedData<RoleTypeObject> roleTypes(final DataFetchingEnvironment env) { 8013 CountingPaginatedData<RoleTypeObject> data; 8014 8015 try { 8016 var commandForm = PartyUtil.getHome().getGetRoleTypesForm(); 8017 var command = CDI.current().select(GetRoleTypesCommand.class).get(); 8018 8019 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8020 if(totalEntities == null) { 8021 data = Connections.emptyConnection(); 8022 } else { 8023 try(var objectLimiter = new ObjectLimiter(env, RoleTypeConstants.COMPONENT_VENDOR_NAME, RoleTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8024 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8025 8026 var roleTypes = entities.stream() 8027 .map(RoleTypeObject::new) 8028 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8029 8030 data = new CountedObjects<>(objectLimiter, roleTypes); 8031 } 8032 } 8033 } catch (NamingException ex) { 8034 throw new RuntimeException(ex); 8035 } 8036 8037 return data; 8038 } 8039 8040 @GraphQLField 8041 @GraphQLName("partyType") 8042 static PartyTypeObject partyType(final DataFetchingEnvironment env, 8043 @GraphQLName("partyTypeName") final String partyTypeName, 8044 @GraphQLName("id") @GraphQLID final String id) { 8045 PartyType partyType; 8046 8047 try { 8048 var commandForm = PartyUtil.getHome().getGetPartyTypeForm(); 8049 8050 commandForm.setPartyTypeName(partyTypeName); 8051 commandForm.setUuid(id); 8052 8053 partyType = CDI.current().select(GetPartyTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8054 } catch (NamingException ex) { 8055 throw new RuntimeException(ex); 8056 } 8057 8058 return partyType == null ? null : new PartyTypeObject(partyType); 8059 } 8060 8061 @GraphQLField 8062 @GraphQLName("partyTypes") 8063 @GraphQLNonNull 8064 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8065 static CountingPaginatedData<PartyTypeObject> partyTypes(final DataFetchingEnvironment env) { 8066 CountingPaginatedData<PartyTypeObject> data; 8067 8068 try { 8069 var commandForm = PartyUtil.getHome().getGetPartyTypesForm(); 8070 var command = CDI.current().select(GetPartyTypesCommand.class).get(); 8071 8072 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8073 if(totalEntities == null) { 8074 data = Connections.emptyConnection(); 8075 } else { 8076 try(var objectLimiter = new ObjectLimiter(env, PartyTypeConstants.COMPONENT_VENDOR_NAME, PartyTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8077 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8078 8079 var partyTypes = entities.stream() 8080 .map(PartyTypeObject::new) 8081 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8082 8083 data = new CountedObjects<>(objectLimiter, partyTypes); 8084 } 8085 } 8086 } catch (NamingException ex) { 8087 throw new RuntimeException(ex); 8088 } 8089 8090 return data; 8091 } 8092 8093 @GraphQLField 8094 @GraphQLName("partyAliasType") 8095 static PartyAliasTypeObject partyAliasType(final DataFetchingEnvironment env, 8096 @GraphQLName("partyTypeName") final String partyTypeName, 8097 @GraphQLName("partyAliasTypeName") final String partyAliasTypeName, 8098 @GraphQLName("id") @GraphQLID final String id) { 8099 PartyAliasType partyAliasType; 8100 8101 try { 8102 var commandForm = PartyUtil.getHome().getGetPartyAliasTypeForm(); 8103 8104 commandForm.setPartyTypeName(partyTypeName); 8105 commandForm.setPartyAliasTypeName(partyAliasTypeName); 8106 commandForm.setUuid(id); 8107 8108 partyAliasType = CDI.current().select(GetPartyAliasTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8109 } catch (NamingException ex) { 8110 throw new RuntimeException(ex); 8111 } 8112 8113 return partyAliasType == null ? null : new PartyAliasTypeObject(partyAliasType); 8114 } 8115 8116 @GraphQLField 8117 @GraphQLName("partyAliasTypes") 8118 static Collection<PartyAliasTypeObject> partyAliasTypes(final DataFetchingEnvironment env, 8119 @GraphQLName("partyTypeName") @GraphQLNonNull final String partyTypeName) { 8120 Collection<PartyAliasType> partyAliasTypes; 8121 Collection<PartyAliasTypeObject> partyAliasTypeObjects; 8122 8123 try { 8124 var commandForm = PartyUtil.getHome().getGetPartyAliasTypesForm(); 8125 8126 commandForm.setPartyTypeName(partyTypeName); 8127 8128 partyAliasTypes = CDI.current().select(GetPartyAliasTypesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8129 } catch (NamingException ex) { 8130 throw new RuntimeException(ex); 8131 } 8132 8133 if(partyAliasTypes == null) { 8134 partyAliasTypeObjects = emptyList(); 8135 } else { 8136 partyAliasTypeObjects = new ArrayList<>(partyAliasTypes.size()); 8137 8138 partyAliasTypes.stream() 8139 .map(PartyAliasTypeObject::new) 8140 .forEachOrdered(partyAliasTypeObjects::add); 8141 } 8142 8143 return partyAliasTypeObjects; 8144 } 8145 8146 @GraphQLField 8147 @GraphQLName("partyAlias") 8148 static PartyAliasObject partyAlias(final DataFetchingEnvironment env, 8149 @GraphQLName("partyName") final String partyName, 8150 @GraphQLName("partyTypeName") final String partyTypeName, 8151 @GraphQLName("partyAliasTypeName") final String partyAliasTypeName, 8152 @GraphQLName("alias") final String alias) { 8153 PartyAlias partyAlias; 8154 8155 try { 8156 var commandForm = PartyUtil.getHome().getGetPartyAliasForm(); 8157 8158 commandForm.setPartyName(partyName); 8159 commandForm.setPartyTypeName(partyTypeName); 8160 commandForm.setPartyAliasTypeName(partyAliasTypeName); 8161 commandForm.setAlias(alias); 8162 8163 partyAlias = CDI.current().select(GetPartyAliasCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8164 } catch (NamingException ex) { 8165 throw new RuntimeException(ex); 8166 } 8167 8168 return partyAlias == null ? null : new PartyAliasObject(partyAlias); 8169 } 8170 8171 @GraphQLField 8172 @GraphQLName("partyAliases") 8173 static Collection<PartyAliasObject> partyAliases(final DataFetchingEnvironment env, 8174 @GraphQLName("partyName") final String partyName, 8175 @GraphQLName("partyTypeName") final String partyTypeName, 8176 @GraphQLName("partyAliasTypeName") final String partyAliasTypeName) { 8177 Collection<PartyAlias> partyAliases; 8178 Collection<PartyAliasObject> partyAliasObjects; 8179 8180 try { 8181 var commandForm = PartyUtil.getHome().getGetPartyAliasesForm(); 8182 8183 commandForm.setPartyName(partyName); 8184 commandForm.setPartyTypeName(partyTypeName); 8185 commandForm.setPartyAliasTypeName(partyAliasTypeName); 8186 8187 partyAliases = CDI.current().select(GetPartyAliasesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8188 } catch (NamingException ex) { 8189 throw new RuntimeException(ex); 8190 } 8191 8192 if(partyAliases == null) { 8193 partyAliasObjects = emptyList(); 8194 } else { 8195 partyAliasObjects = new ArrayList<>(partyAliases.size()); 8196 8197 partyAliases.stream() 8198 .map(PartyAliasObject::new) 8199 .forEachOrdered(partyAliasObjects::add); 8200 } 8201 8202 return partyAliasObjects; 8203 } 8204 8205 @GraphQLField 8206 @GraphQLName("party") 8207 static PartyObject party(final DataFetchingEnvironment env, 8208 @GraphQLName("partyName") final String partyName, 8209 @GraphQLName("id") @GraphQLID final String id) { 8210 Party party; 8211 8212 try { 8213 var commandForm = PartyUtil.getHome().getGetPartyForm(); 8214 8215 commandForm.setPartyName(partyName); 8216 commandForm.setUuid(id); 8217 8218 party = CDI.current().select(GetPartyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8219 } catch (NamingException ex) { 8220 throw new RuntimeException(ex); 8221 } 8222 8223 return party == null ? null : new PartyObject(party); 8224 } 8225 8226 @GraphQLField 8227 @GraphQLName("parties") 8228 @GraphQLNonNull 8229 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8230 static CountingPaginatedData<PartyObject> parties(final DataFetchingEnvironment env) { 8231 CountingPaginatedData<PartyObject> data; 8232 8233 try { 8234 var commandForm = PartyUtil.getHome().getGetPartiesForm(); 8235 var command = CDI.current().select(GetPartiesCommand.class).get(); 8236 8237 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8238 if(totalEntities == null) { 8239 data = Connections.emptyConnection(); 8240 } else { 8241 try(var objectLimiter = new ObjectLimiter(env, PartyConstants.COMPONENT_VENDOR_NAME, PartyConstants.ENTITY_TYPE_NAME, totalEntities)) { 8242 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8243 8244 var parties = entities.stream() 8245 .map(PartyObject::new) 8246 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8247 8248 data = new CountedObjects<>(objectLimiter, parties); 8249 } 8250 } 8251 } catch (NamingException ex) { 8252 throw new RuntimeException(ex); 8253 } 8254 8255 return data; 8256 } 8257 8258 @GraphQLField 8259 @GraphQLName("company") 8260 static CompanyObject company(final DataFetchingEnvironment env, 8261 @GraphQLName("companyName") final String companyName, 8262 @GraphQLName("partyName") final String partyName, 8263 @GraphQLName("id") @GraphQLID final String id) { 8264 PartyCompany company; 8265 8266 try { 8267 var commandForm = PartyUtil.getHome().getGetCompanyForm(); 8268 8269 commandForm.setCompanyName(companyName); 8270 commandForm.setPartyName(partyName); 8271 commandForm.setUuid(id); 8272 8273 company = CDI.current().select(GetCompanyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8274 } catch (NamingException ex) { 8275 throw new RuntimeException(ex); 8276 } 8277 8278 return company == null ? null : new CompanyObject(company); 8279 } 8280 8281 @GraphQLField 8282 @GraphQLName("companies") 8283 @GraphQLNonNull 8284 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8285 static CountingPaginatedData<CompanyObject> companies(final DataFetchingEnvironment env) { 8286 CountingPaginatedData<CompanyObject> data; 8287 8288 try { 8289 var commandForm = PartyUtil.getHome().getGetCompaniesForm(); 8290 var command = CDI.current().select(GetCompaniesCommand.class).get(); 8291 8292 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8293 if(totalEntities == null) { 8294 data = Connections.emptyConnection(); 8295 } else { 8296 try(var objectLimiter = new ObjectLimiter(env, PartyCompanyConstants.COMPONENT_VENDOR_NAME, PartyCompanyConstants.ENTITY_TYPE_NAME, totalEntities)) { 8297 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8298 8299 var companies = entities.stream() 8300 .map(CompanyObject::new) 8301 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8302 8303 data = new CountedObjects<>(objectLimiter, companies); 8304 } 8305 } 8306 } catch (NamingException ex) { 8307 throw new RuntimeException(ex); 8308 } 8309 8310 return data; 8311 } 8312 8313 @GraphQLField 8314 @GraphQLName("division") 8315 static DivisionObject division(final DataFetchingEnvironment env, 8316 @GraphQLName("companyName") final String companyName, 8317 @GraphQLName("divisionName") final String divisionName, 8318 @GraphQLName("partyName") final String partyName, 8319 @GraphQLName("id") @GraphQLID final String id) { 8320 PartyDivision division; 8321 8322 try { 8323 var commandForm = PartyUtil.getHome().getGetDivisionForm(); 8324 8325 commandForm.setCompanyName(companyName); 8326 commandForm.setDivisionName(divisionName); 8327 commandForm.setPartyName(partyName); 8328 commandForm.setUuid(id); 8329 8330 division = CDI.current().select(GetDivisionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8331 } catch (NamingException ex) { 8332 throw new RuntimeException(ex); 8333 } 8334 8335 return division == null ? null : new DivisionObject(division); 8336 } 8337 8338 @GraphQLField 8339 @GraphQLName("divisions") 8340 static Collection<DivisionObject> divisions(final DataFetchingEnvironment env, 8341 @GraphQLName("companyName") @GraphQLNonNull final String companyName) { 8342 Collection<PartyDivision> partyDivisions; 8343 Collection<DivisionObject> divisionObjects; 8344 8345 try { 8346 var commandForm = PartyUtil.getHome().getGetDivisionsForm(); 8347 8348 commandForm.setCompanyName(companyName); 8349 8350 partyDivisions = CDI.current().select(GetDivisionsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8351 } catch (NamingException ex) { 8352 throw new RuntimeException(ex); 8353 } 8354 8355 if(partyDivisions == null) { 8356 divisionObjects = emptyList(); 8357 } else { 8358 divisionObjects = new ArrayList<>(partyDivisions.size()); 8359 8360 partyDivisions.stream() 8361 .map(DivisionObject::new) 8362 .forEachOrdered(divisionObjects::add); 8363 } 8364 8365 return divisionObjects; 8366 } 8367 8368 @GraphQLField 8369 @GraphQLName("department") 8370 static DepartmentObject department(final DataFetchingEnvironment env, 8371 @GraphQLName("companyName") final String companyName, 8372 @GraphQLName("divisionName") final String divisionName, 8373 @GraphQLName("departmentName") final String departmentName, 8374 @GraphQLName("partyName") final String partyName, 8375 @GraphQLName("id") @GraphQLID final String id) { 8376 PartyDepartment department; 8377 8378 try { 8379 var commandForm = PartyUtil.getHome().getGetDepartmentForm(); 8380 8381 commandForm.setCompanyName(companyName); 8382 commandForm.setDivisionName(divisionName); 8383 commandForm.setDepartmentName(departmentName); 8384 commandForm.setPartyName(partyName); 8385 commandForm.setUuid(id); 8386 8387 department = CDI.current().select(GetDepartmentCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8388 } catch (NamingException ex) { 8389 throw new RuntimeException(ex); 8390 } 8391 8392 return department == null ? null : new DepartmentObject(department); 8393 } 8394 8395 @GraphQLField 8396 @GraphQLName("departments") 8397 static Collection<DepartmentObject> departments(final DataFetchingEnvironment env, 8398 @GraphQLName("companyName") @GraphQLNonNull final String companyName, 8399 @GraphQLName("divisionName") final String divisionName) { 8400 Collection<PartyDepartment> partyDepartments; 8401 Collection<DepartmentObject> departmentObjects; 8402 8403 try { 8404 var commandForm = PartyUtil.getHome().getGetDepartmentsForm(); 8405 8406 commandForm.setCompanyName(companyName); 8407 commandForm.setDivisionName(divisionName); 8408 8409 partyDepartments = CDI.current().select(GetDepartmentsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8410 } catch (NamingException ex) { 8411 throw new RuntimeException(ex); 8412 } 8413 8414 if(partyDepartments == null) { 8415 departmentObjects = emptyList(); 8416 } else { 8417 departmentObjects = new ArrayList<>(partyDepartments.size()); 8418 8419 partyDepartments.stream() 8420 .map(DepartmentObject::new) 8421 .forEachOrdered(departmentObjects::add); 8422 } 8423 8424 return departmentObjects; 8425 } 8426 8427 @GraphQLField 8428 @GraphQLName("warehouseType") 8429 static WarehouseTypeObject warehouseType(final DataFetchingEnvironment env, 8430 @GraphQLName("warehouseTypeName") final String warehouseTypeName, 8431 @GraphQLName("id") @GraphQLID final String id) { 8432 WarehouseType warehouseType; 8433 8434 try { 8435 var commandForm = WarehouseUtil.getHome().getGetWarehouseTypeForm(); 8436 8437 commandForm.setWarehouseTypeName(warehouseTypeName); 8438 commandForm.setUuid(id); 8439 8440 warehouseType = CDI.current().select(GetWarehouseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8441 } catch (NamingException ex) { 8442 throw new RuntimeException(ex); 8443 } 8444 8445 return warehouseType == null ? null : new WarehouseTypeObject(warehouseType); 8446 } 8447 8448 @GraphQLField 8449 @GraphQLName("warehouseTypes") 8450 @GraphQLNonNull 8451 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8452 static CountingPaginatedData<WarehouseTypeObject> warehouseTypes(final DataFetchingEnvironment env) { 8453 CountingPaginatedData<WarehouseTypeObject> data; 8454 8455 try { 8456 var commandForm = WarehouseUtil.getHome().getGetWarehouseTypesForm(); 8457 var command = CDI.current().select(GetWarehouseTypesCommand.class).get(); 8458 8459 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8460 if(totalEntities == null) { 8461 data = Connections.emptyConnection(); 8462 } else { 8463 try(var objectLimiter = new ObjectLimiter(env, WarehouseTypeConstants.COMPONENT_VENDOR_NAME, WarehouseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8464 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8465 8466 var warehouseTypes = entities.stream() 8467 .map(WarehouseTypeObject::new) 8468 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8469 8470 data = new CountedObjects<>(objectLimiter, warehouseTypes); 8471 } 8472 } 8473 } catch (NamingException ex) { 8474 throw new RuntimeException(ex); 8475 } 8476 8477 return data; 8478 } 8479 8480 @GraphQLField 8481 @GraphQLName("warehouse") 8482 static WarehouseObject warehouse(final DataFetchingEnvironment env, 8483 @GraphQLName("warehouseName") final String warehouseName, 8484 @GraphQLName("partyName") final String partyName, 8485 @GraphQLName("id") @GraphQLID final String id) { 8486 Warehouse warehouse; 8487 8488 try { 8489 var commandForm = WarehouseUtil.getHome().getGetWarehouseForm(); 8490 8491 commandForm.setWarehouseName(warehouseName); 8492 commandForm.setPartyName(partyName); 8493 commandForm.setUuid(id); 8494 8495 warehouse = CDI.current().select(GetWarehouseCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8496 } catch (NamingException ex) { 8497 throw new RuntimeException(ex); 8498 } 8499 8500 return warehouse == null ? null : new WarehouseObject(warehouse); 8501 } 8502 8503 @GraphQLField 8504 @GraphQLName("warehouses") 8505 @GraphQLNonNull 8506 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8507 static CountingPaginatedData<WarehouseObject> warehouses(final DataFetchingEnvironment env) { 8508 CountingPaginatedData<WarehouseObject> data; 8509 8510 try { 8511 var commandForm = WarehouseUtil.getHome().getGetWarehousesForm(); 8512 var command = CDI.current().select(GetWarehousesCommand.class).get(); 8513 8514 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8515 if(totalEntities == null) { 8516 data = Connections.emptyConnection(); 8517 } else { 8518 try(var objectLimiter = new ObjectLimiter(env, WarehouseConstants.COMPONENT_VENDOR_NAME, WarehouseConstants.ENTITY_TYPE_NAME, totalEntities)) { 8519 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8520 8521 var warehouses = entities.stream() 8522 .map(WarehouseObject::new) 8523 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8524 8525 data = new CountedObjects<>(objectLimiter, warehouses); 8526 } 8527 } 8528 } catch (NamingException ex) { 8529 throw new RuntimeException(ex); 8530 } 8531 8532 return data; 8533 } 8534 8535 @GraphQLField 8536 @GraphQLName("locationUseType") 8537 static LocationUseTypeObject locationUseType(final DataFetchingEnvironment env, 8538 @GraphQLName("locationUseTypeName") final String locationUseTypeName, 8539 @GraphQLName("id") @GraphQLID final String id) { 8540 LocationUseType locationUseType; 8541 8542 try { 8543 var commandForm = WarehouseUtil.getHome().getGetLocationUseTypeForm(); 8544 8545 commandForm.setLocationUseTypeName(locationUseTypeName); 8546 commandForm.setUuid(id); 8547 8548 locationUseType = CDI.current().select(GetLocationUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8549 } catch (NamingException ex) { 8550 throw new RuntimeException(ex); 8551 } 8552 8553 return locationUseType == null ? null : new LocationUseTypeObject(locationUseType); 8554 } 8555 8556 @GraphQLField 8557 @GraphQLName("locationUseTypes") 8558 @GraphQLNonNull 8559 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8560 static CountingPaginatedData<LocationUseTypeObject> locationUseTypes(final DataFetchingEnvironment env) { 8561 CountingPaginatedData<LocationUseTypeObject> data; 8562 8563 try { 8564 var commandForm = WarehouseUtil.getHome().getGetLocationUseTypesForm(); 8565 var command = CDI.current().select(GetLocationUseTypesCommand.class).get(); 8566 8567 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8568 if(totalEntities == null) { 8569 data = Connections.emptyConnection(); 8570 } else { 8571 try(var objectLimiter = new ObjectLimiter(env, LocationUseTypeConstants.COMPONENT_VENDOR_NAME, LocationUseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8572 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8573 8574 var locationUseTypes = entities.stream() 8575 .map(LocationUseTypeObject::new) 8576 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8577 8578 data = new CountedObjects<>(objectLimiter, locationUseTypes); 8579 } 8580 } 8581 } catch (NamingException ex) { 8582 throw new RuntimeException(ex); 8583 } 8584 8585 return data; 8586 } 8587 8588 @GraphQLField 8589 @GraphQLName("inventoryLocationGroup") 8590 static InventoryLocationGroupObject inventoryLocationGroup(final DataFetchingEnvironment env, 8591 @GraphQLName("warehouseName") final String warehouseName, 8592 @GraphQLName("inventoryLocationGroupName") final String inventoryLocationGroupName) { 8593 InventoryLocationGroup inventoryLocationGroup; 8594 8595 try { 8596 var commandForm = InventoryUtil.getHome().getGetInventoryLocationGroupForm(); 8597 8598 commandForm.setWarehouseName(warehouseName); 8599 commandForm.setInventoryLocationGroupName(inventoryLocationGroupName); 8600 8601 inventoryLocationGroup = CDI.current().select(GetInventoryLocationGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8602 } catch (NamingException ex) { 8603 throw new RuntimeException(ex); 8604 } 8605 8606 return inventoryLocationGroup == null ? null : new InventoryLocationGroupObject(inventoryLocationGroup); 8607 } 8608 8609 @GraphQLField 8610 @GraphQLName("inventoryLocationGroups") 8611 @GraphQLNonNull 8612 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8613 static CountingPaginatedData<InventoryLocationGroupObject> inventoryLocationGroups(final DataFetchingEnvironment env, 8614 @GraphQLName("warehouseName") final String warehouseName) { 8615 CountingPaginatedData<InventoryLocationGroupObject> data; 8616 8617 try { 8618 var commandForm = InventoryUtil.getHome().getGetInventoryLocationGroupsForm(); 8619 var command = CDI.current().select(GetInventoryLocationGroupsCommand.class).get(); 8620 8621 commandForm.setWarehouseName(warehouseName); 8622 8623 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8624 if(totalEntities == null) { 8625 data = Connections.emptyConnection(); 8626 } else { 8627 try(var objectLimiter = new ObjectLimiter(env, InventoryLocationGroupConstants.COMPONENT_VENDOR_NAME, InventoryLocationGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 8628 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8629 8630 var inventoryLocationGroups = entities.stream() 8631 .map(InventoryLocationGroupObject::new) 8632 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8633 8634 data = new CountedObjects<>(objectLimiter, inventoryLocationGroups); 8635 } 8636 } 8637 } catch (NamingException ex) { 8638 throw new RuntimeException(ex); 8639 } 8640 8641 return data; 8642 } 8643 8644 @GraphQLField 8645 @GraphQLName("locationType") 8646 static LocationTypeObject locationType(final DataFetchingEnvironment env, 8647 @GraphQLName("warehouseName") final String warehouseName, 8648 @GraphQLName("locationTypeName") final String locationTypeName) { 8649 LocationType locationType; 8650 8651 try { 8652 var commandForm = WarehouseUtil.getHome().getGetLocationTypeForm(); 8653 8654 commandForm.setWarehouseName(warehouseName); 8655 commandForm.setLocationTypeName(locationTypeName); 8656 8657 locationType = CDI.current().select(GetLocationTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8658 } catch (NamingException ex) { 8659 throw new RuntimeException(ex); 8660 } 8661 8662 return locationType == null ? null : new LocationTypeObject(locationType); 8663 } 8664 8665 @GraphQLField 8666 @GraphQLName("locationTypes") 8667 @GraphQLNonNull 8668 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8669 static CountingPaginatedData<LocationTypeObject> locationTypes(final DataFetchingEnvironment env, 8670 @GraphQLName("warehouseName") final String warehouseName) { 8671 CountingPaginatedData<LocationTypeObject> data; 8672 8673 try { 8674 var commandForm = WarehouseUtil.getHome().getGetLocationTypesForm(); 8675 var command = CDI.current().select(GetLocationTypesCommand.class).get(); 8676 8677 commandForm.setWarehouseName(warehouseName); 8678 8679 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8680 if(totalEntities == null) { 8681 data = Connections.emptyConnection(); 8682 } else { 8683 try(var objectLimiter = new ObjectLimiter(env, LocationTypeConstants.COMPONENT_VENDOR_NAME, LocationTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 8684 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8685 8686 var locationTypes = entities.stream() 8687 .map(LocationTypeObject::new) 8688 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8689 8690 data = new CountedObjects<>(objectLimiter, locationTypes); 8691 } 8692 } 8693 } catch (NamingException ex) { 8694 throw new RuntimeException(ex); 8695 } 8696 8697 return data; 8698 } 8699 8700 @GraphQLField 8701 @GraphQLName("locationNameElement") 8702 static LocationNameElementObject locationNameElement(final DataFetchingEnvironment env, 8703 @GraphQLName("warehouseName") final String warehouseName, 8704 @GraphQLName("locationTypeName") final String locationTypeName, 8705 @GraphQLName("locationNameElementName") final String locationNameElementName) { 8706 LocationNameElement locationNameElement; 8707 8708 try { 8709 var commandForm = WarehouseUtil.getHome().getGetLocationNameElementForm(); 8710 8711 commandForm.setWarehouseName(warehouseName); 8712 commandForm.setLocationTypeName(locationTypeName); 8713 commandForm.setLocationNameElementName(locationNameElementName); 8714 8715 locationNameElement = CDI.current().select(GetLocationNameElementCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8716 } catch (NamingException ex) { 8717 throw new RuntimeException(ex); 8718 } 8719 8720 return locationNameElement == null ? null : new LocationNameElementObject(locationNameElement); 8721 } 8722 8723 @GraphQLField 8724 @GraphQLName("locationNameElements") 8725 @GraphQLNonNull 8726 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8727 static CountingPaginatedData<LocationNameElementObject> locationNameElements(final DataFetchingEnvironment env, 8728 @GraphQLName("warehouseName") final String warehouseName, 8729 @GraphQLName("locationTypeName") final String locationTypeName) { 8730 CountingPaginatedData<LocationNameElementObject> data; 8731 8732 try { 8733 var commandForm = WarehouseUtil.getHome().getGetLocationNameElementsForm(); 8734 var command = CDI.current().select(GetLocationNameElementsCommand.class).get(); 8735 8736 commandForm.setWarehouseName(warehouseName); 8737 commandForm.setLocationTypeName(locationTypeName); 8738 8739 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8740 if(totalEntities == null) { 8741 data = Connections.emptyConnection(); 8742 } else { 8743 try(var objectLimiter = new ObjectLimiter(env, LocationNameElementConstants.COMPONENT_VENDOR_NAME, LocationNameElementConstants.ENTITY_TYPE_NAME, totalEntities)) { 8744 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8745 8746 var locationNameElements = entities.stream() 8747 .map(LocationNameElementObject::new) 8748 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8749 8750 data = new CountedObjects<>(objectLimiter, locationNameElements); 8751 } 8752 } 8753 } catch (NamingException ex) { 8754 throw new RuntimeException(ex); 8755 } 8756 8757 return data; 8758 } 8759 8760 @GraphQLField 8761 @GraphQLName("location") 8762 static LocationObject location(final DataFetchingEnvironment env, 8763 @GraphQLName("warehouseName") final String warehouseName, 8764 @GraphQLName("locationName") final String locationName) { 8765 Location location; 8766 8767 try { 8768 var commandForm = WarehouseUtil.getHome().getGetLocationForm(); 8769 8770 commandForm.setWarehouseName(warehouseName); 8771 commandForm.setLocationName(locationName); 8772 8773 location = CDI.current().select(GetLocationCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8774 } catch (NamingException ex) { 8775 throw new RuntimeException(ex); 8776 } 8777 8778 return location == null ? null : new LocationObject(location); 8779 } 8780 8781 @GraphQLField 8782 @GraphQLName("locations") 8783 @GraphQLNonNull 8784 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8785 static CountingPaginatedData<LocationObject> locations(final DataFetchingEnvironment env, 8786 @GraphQLName("warehouseName") final String warehouseName) { 8787 CountingPaginatedData<LocationObject> data; 8788 8789 try { 8790 var commandForm = WarehouseUtil.getHome().getGetLocationsForm(); 8791 var command = CDI.current().select(GetLocationsCommand.class).get(); 8792 8793 commandForm.setWarehouseName(warehouseName); 8794 8795 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8796 if(totalEntities == null) { 8797 data = Connections.emptyConnection(); 8798 } else { 8799 try(var objectLimiter = new ObjectLimiter(env, LocationConstants.COMPONENT_VENDOR_NAME, LocationConstants.ENTITY_TYPE_NAME, totalEntities)) { 8800 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8801 8802 var locations = entities.stream() 8803 .map(LocationObject::new) 8804 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8805 8806 data = new CountedObjects<>(objectLimiter, locations); 8807 } 8808 } 8809 } catch (NamingException ex) { 8810 throw new RuntimeException(ex); 8811 } 8812 8813 return data; 8814 } 8815 8816 @GraphQLField 8817 @GraphQLName("cancellationKind") 8818 static CancellationKindObject cancellationKind(final DataFetchingEnvironment env, 8819 @GraphQLName("cancellationKindName") final String cancellationKindName, 8820 @GraphQLName("id") @GraphQLID final String id) { 8821 CancellationKind cancellationKind; 8822 8823 try { 8824 var commandForm = CancellationPolicyUtil.getHome().getGetCancellationKindForm(); 8825 8826 commandForm.setCancellationKindName(cancellationKindName); 8827 commandForm.setUuid(id); 8828 8829 cancellationKind = CDI.current().select(GetCancellationKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8830 } catch (NamingException ex) { 8831 throw new RuntimeException(ex); 8832 } 8833 8834 return cancellationKind == null ? null : new CancellationKindObject(cancellationKind); 8835 } 8836 8837 @GraphQLField 8838 @GraphQLName("cancellationKinds") 8839 @GraphQLNonNull 8840 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8841 static CountingPaginatedData<CancellationKindObject> cancellationKinds(final DataFetchingEnvironment env) { 8842 CountingPaginatedData<CancellationKindObject> data; 8843 8844 try { 8845 var commandForm = CancellationPolicyUtil.getHome().getGetCancellationKindsForm(); 8846 var command = CDI.current().select(GetCancellationKindsCommand.class).get(); 8847 8848 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8849 if(totalEntities == null) { 8850 data = Connections.emptyConnection(); 8851 } else { 8852 try(var objectLimiter = new ObjectLimiter(env, CancellationKindConstants.COMPONENT_VENDOR_NAME, CancellationKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 8853 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8854 8855 var cancellationKinds = entities.stream() 8856 .map(CancellationKindObject::new) 8857 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8858 8859 data = new CountedObjects<>(objectLimiter, cancellationKinds); 8860 } 8861 } 8862 } catch (NamingException ex) { 8863 throw new RuntimeException(ex); 8864 } 8865 8866 return data; 8867 } 8868 8869 @GraphQLField 8870 @GraphQLName("cancellationPolicy") 8871 static CancellationPolicyObject cancellationPolicy(final DataFetchingEnvironment env, 8872 @GraphQLName("cancellationKindName") final String cancellationKindName, 8873 @GraphQLName("cancellationPolicyName") final String cancellationPolicyName, 8874 @GraphQLName("id") @GraphQLID final String id) { 8875 CancellationPolicy cancellationPolicy; 8876 8877 try { 8878 var commandForm = CancellationPolicyUtil.getHome().getGetCancellationPolicyForm(); 8879 8880 commandForm.setCancellationKindName(cancellationKindName); 8881 commandForm.setCancellationPolicyName(cancellationPolicyName); 8882 commandForm.setUuid(id); 8883 8884 cancellationPolicy = CDI.current().select(GetCancellationPolicyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8885 } catch (NamingException ex) { 8886 throw new RuntimeException(ex); 8887 } 8888 8889 return cancellationPolicy == null ? null : new CancellationPolicyObject(cancellationPolicy); 8890 } 8891 8892 @GraphQLField 8893 @GraphQLName("cancellationPolicies") 8894 @GraphQLNonNull 8895 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8896 static CountingPaginatedData<CancellationPolicyObject> cancellationPolicies(final DataFetchingEnvironment env, 8897 @GraphQLName("cancellationKindName") final String cancellationKindName) { 8898 CountingPaginatedData<CancellationPolicyObject> data; 8899 8900 try { 8901 var commandForm = CancellationPolicyUtil.getHome().getGetCancellationPoliciesForm(); 8902 var command = CDI.current().select(GetCancellationPoliciesCommand.class).get(); 8903 8904 commandForm.setCancellationKindName(cancellationKindName); 8905 8906 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8907 if(totalEntities == null) { 8908 data = Connections.emptyConnection(); 8909 } else { 8910 try(var objectLimiter = new ObjectLimiter(env, CancellationPolicyConstants.COMPONENT_VENDOR_NAME, CancellationPolicyConstants.ENTITY_TYPE_NAME, totalEntities)) { 8911 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8912 8913 var cancellationPolicies = entities.stream() 8914 .map(CancellationPolicyObject::new) 8915 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8916 8917 data = new CountedObjects<>(objectLimiter, cancellationPolicies); 8918 } 8919 } 8920 } catch (NamingException ex) { 8921 throw new RuntimeException(ex); 8922 } 8923 8924 return data; 8925 } 8926 8927 @GraphQLField 8928 @GraphQLName("returnKind") 8929 static ReturnKindObject returnKind(final DataFetchingEnvironment env, 8930 @GraphQLName("returnKindName") final String returnKindName, 8931 @GraphQLName("id") @GraphQLID final String id) { 8932 ReturnKind returnKind; 8933 8934 try { 8935 var commandForm = ReturnPolicyUtil.getHome().getGetReturnKindForm(); 8936 8937 commandForm.setReturnKindName(returnKindName); 8938 commandForm.setUuid(id); 8939 8940 returnKind = CDI.current().select(GetReturnKindCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8941 } catch (NamingException ex) { 8942 throw new RuntimeException(ex); 8943 } 8944 8945 return returnKind == null ? null : new ReturnKindObject(returnKind); 8946 } 8947 8948 @GraphQLField 8949 @GraphQLName("returnKinds") 8950 @GraphQLNonNull 8951 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 8952 static CountingPaginatedData<ReturnKindObject> returnKinds(final DataFetchingEnvironment env) { 8953 CountingPaginatedData<ReturnKindObject> data; 8954 8955 try { 8956 var commandForm = ReturnPolicyUtil.getHome().getGetReturnKindsForm(); 8957 var command = CDI.current().select(GetReturnKindsCommand.class).get(); 8958 8959 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8960 if(totalEntities == null) { 8961 data = Connections.emptyConnection(); 8962 } else { 8963 try(var objectLimiter = new ObjectLimiter(env, ReturnKindConstants.COMPONENT_VENDOR_NAME, ReturnKindConstants.ENTITY_TYPE_NAME, totalEntities)) { 8964 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 8965 8966 var returnKinds = entities.stream() 8967 .map(ReturnKindObject::new) 8968 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 8969 8970 data = new CountedObjects<>(objectLimiter, returnKinds); 8971 } 8972 } 8973 } catch (NamingException ex) { 8974 throw new RuntimeException(ex); 8975 } 8976 8977 return data; 8978 } 8979 8980 @GraphQLField 8981 @GraphQLName("returnPolicy") 8982 static ReturnPolicyObject returnPolicy(final DataFetchingEnvironment env, 8983 @GraphQLName("returnKindName") final String returnKindName, 8984 @GraphQLName("returnPolicyName") final String returnPolicyName, 8985 @GraphQLName("id") @GraphQLID final String id) { 8986 ReturnPolicy returnPolicy; 8987 8988 try { 8989 var commandForm = ReturnPolicyUtil.getHome().getGetReturnPolicyForm(); 8990 8991 commandForm.setReturnKindName(returnKindName); 8992 commandForm.setReturnPolicyName(returnPolicyName); 8993 commandForm.setUuid(id); 8994 8995 returnPolicy = CDI.current().select(GetReturnPolicyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 8996 } catch (NamingException ex) { 8997 throw new RuntimeException(ex); 8998 } 8999 9000 return returnPolicy == null ? null : new ReturnPolicyObject(returnPolicy); 9001 } 9002 9003 @GraphQLField 9004 @GraphQLName("returnPolicies") 9005 @GraphQLNonNull 9006 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9007 static CountingPaginatedData<ReturnPolicyObject> returnPolicies(final DataFetchingEnvironment env, 9008 @GraphQLName("returnKindName") final String returnKindName) { 9009 CountingPaginatedData<ReturnPolicyObject> data; 9010 9011 try { 9012 var commandForm = ReturnPolicyUtil.getHome().getGetReturnPoliciesForm(); 9013 var command = CDI.current().select(GetReturnPoliciesCommand.class).get(); 9014 9015 commandForm.setReturnKindName(returnKindName); 9016 9017 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9018 if(totalEntities == null) { 9019 data = Connections.emptyConnection(); 9020 } else { 9021 try(var objectLimiter = new ObjectLimiter(env, ReturnPolicyConstants.COMPONENT_VENDOR_NAME, ReturnPolicyConstants.ENTITY_TYPE_NAME, totalEntities)) { 9022 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9023 9024 var returnPolicies = entities.stream() 9025 .map(ReturnPolicyObject::new) 9026 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9027 9028 data = new CountedObjects<>(objectLimiter, returnPolicies); 9029 } 9030 } 9031 } catch(NamingException ex) { 9032 throw new RuntimeException(ex); 9033 } 9034 9035 return data; 9036 } 9037 9038 @GraphQLField 9039 @GraphQLName("item") 9040 static ItemObject item(final DataFetchingEnvironment env, 9041 @GraphQLName("itemName") final String itemName, 9042 @GraphQLName("itemNameOrAlias") final String itemNameOrAlias, 9043 @GraphQLName("id") @GraphQLID final String id) { 9044 Item item; 9045 9046 try { 9047 var commandForm = ItemUtil.getHome().getGetItemForm(); 9048 9049 commandForm.setItemName(itemName); 9050 commandForm.setItemNameOrAlias(itemNameOrAlias); 9051 commandForm.setUuid(id); 9052 9053 item = CDI.current().select(GetItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9054 } catch (NamingException ex) { 9055 throw new RuntimeException(ex); 9056 } 9057 9058 return item == null ? null : new ItemObject(item); 9059 } 9060 9061 @GraphQLField 9062 @GraphQLName("items") 9063 @GraphQLNonNull 9064 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9065 static CountingPaginatedData<ItemObject> items(final DataFetchingEnvironment env) { 9066 CountingPaginatedData<ItemObject> data; 9067 9068 try { 9069 var commandForm = ItemUtil.getHome().getGetItemsForm(); 9070 var command = CDI.current().select(GetItemsCommand.class).get(); 9071 9072 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9073 if(totalEntities == null) { 9074 data = Connections.emptyConnection(); 9075 } else { 9076 try(var objectLimiter = new ObjectLimiter(env, ItemConstants.COMPONENT_VENDOR_NAME, ItemConstants.ENTITY_TYPE_NAME, totalEntities)) { 9077 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9078 9079 var items = entities.stream() 9080 .map(ItemObject::new) 9081 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9082 9083 data = new CountedObjects<>(objectLimiter, items); 9084 } 9085 } 9086 } catch (NamingException ex) { 9087 throw new RuntimeException(ex); 9088 } 9089 9090 return data; 9091 } 9092 9093 @GraphQLField 9094 @GraphQLName("itemUnitOfMeasureType") 9095 static ItemUnitOfMeasureTypeObject itemUnitOfMeasureType(final DataFetchingEnvironment env, 9096 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 9097 @GraphQLName("unitOfMeasureTypeName") @GraphQLNonNull final String unitOfMeasureTypeName) { 9098 ItemUnitOfMeasureType itemUnitOfMeasureType; 9099 9100 try { 9101 var commandForm = ItemUtil.getHome().getGetItemUnitOfMeasureTypeForm(); 9102 9103 commandForm.setItemName(itemName); 9104 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 9105 9106 itemUnitOfMeasureType = CDI.current().select(GetItemUnitOfMeasureTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9107 } catch (NamingException ex) { 9108 throw new RuntimeException(ex); 9109 } 9110 9111 return itemUnitOfMeasureType == null ? null : new ItemUnitOfMeasureTypeObject(itemUnitOfMeasureType); 9112 } 9113 9114 @GraphQLField 9115 @GraphQLName("itemUnitOfMeasureTypes") 9116 @GraphQLNonNull 9117 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9118 static CountingPaginatedData<ItemUnitOfMeasureTypeObject> itemUnitOfMeasureTypes(final DataFetchingEnvironment env, 9119 @GraphQLName("itemName") @GraphQLNonNull final String itemName) { 9120 CountingPaginatedData<ItemUnitOfMeasureTypeObject> data; 9121 9122 try { 9123 var commandForm = ItemUtil.getHome().getGetItemUnitOfMeasureTypesForm(); 9124 var command = CDI.current().select(GetItemUnitOfMeasureTypesCommand.class).get(); 9125 9126 commandForm.setItemName(itemName); 9127 9128 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9129 if(totalEntities == null) { 9130 data = Connections.emptyConnection(); 9131 } else { 9132 try(var objectLimiter = new ObjectLimiter(env, ItemUnitOfMeasureTypeConstants.COMPONENT_VENDOR_NAME, ItemUnitOfMeasureTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9133 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9134 9135 var itemUnitOfMeasureTypeObjects = entities.stream() 9136 .map(ItemUnitOfMeasureTypeObject::new) 9137 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9138 9139 data = new CountedObjects<>(objectLimiter, itemUnitOfMeasureTypeObjects); 9140 } 9141 } 9142 } catch (NamingException ex) { 9143 throw new RuntimeException(ex); 9144 } 9145 9146 return data; 9147 } 9148 9149 9150 @GraphQLField 9151 @GraphQLName("itemDescription") 9152 static ItemDescriptionObject itemDescription(final DataFetchingEnvironment env, 9153 @GraphQLName("itemDescriptionTypeName") final String itemDescriptionTypeName, 9154 @GraphQLName("itemName") final String itemName, 9155 @GraphQLName("languageIsoName") final String languageIsoName, 9156 @GraphQLName("id") @GraphQLID final String id, 9157 @GraphQLName("referrer") final String referrer) { 9158 ItemDescription itemDescription; 9159 9160 try { 9161 var commandForm = ItemUtil.getHome().getGetItemDescriptionForm(); 9162 9163 commandForm.setItemDescriptionTypeName(itemDescriptionTypeName); 9164 commandForm.setItemName(itemName); 9165 commandForm.setLanguageIsoName(languageIsoName); 9166 commandForm.setUuid(id); 9167 commandForm.setReferrer(referrer); 9168 9169 itemDescription = CDI.current().select(GetItemDescriptionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9170 } catch (NamingException ex) { 9171 throw new RuntimeException(ex); 9172 } 9173 9174 return itemDescription == null ? null : new ItemDescriptionObject(itemDescription); 9175 } 9176 9177 @GraphQLField 9178 @GraphQLName("itemDescriptions") 9179 @GraphQLNonNull 9180 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9181 static CountingPaginatedData<ItemDescriptionObject> itemDescriptions(final DataFetchingEnvironment env, 9182 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 9183 @GraphQLName("itemDescriptionTypeUseTypeName") final String itemDescriptionTypeUseTypeName, 9184 @GraphQLName("languageIsoName") final String languageIsoName) { 9185 CountingPaginatedData<ItemDescriptionObject> data; 9186 9187 try { 9188 var commandForm = ItemUtil.getHome().getGetItemDescriptionsForm(); 9189 var command = CDI.current().select(GetItemDescriptionsCommand.class).get(); 9190 9191 commandForm.setItemName(itemName); 9192 commandForm.setItemDescriptionTypeUseTypeName(itemDescriptionTypeUseTypeName); 9193 commandForm.setLanguageIsoName(languageIsoName); 9194 9195 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9196 if(totalEntities == null) { 9197 data = Connections.emptyConnection(); 9198 } else { 9199 try(var objectLimiter = new ObjectLimiter(env, ItemDescriptionConstants.COMPONENT_VENDOR_NAME, ItemDescriptionConstants.ENTITY_TYPE_NAME, totalEntities)) { 9200 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9201 var limitOffset = objectLimiter.getLimitOffset(); 9202 var limitCount = objectLimiter.getLimitCount(); 9203 9204 Collection<ItemDescription> limitedEntities; 9205 if(itemDescriptionTypeUseTypeName != null) { 9206 // A Limit must be manually applied. 9207 limitedEntities = entities.stream() 9208 .skip(limitOffset) 9209 .limit(limitCount) 9210 .toList(); 9211 } else { 9212 // A Limit was applied in the SQL Query. 9213 limitedEntities = entities; 9214 } 9215 9216 var itemDescriptions = limitedEntities.stream() 9217 .skip(limitOffset) 9218 .limit(limitCount) 9219 .map(ItemDescriptionObject::new) 9220 .collect(Collectors.toCollection(() -> new ArrayList<>(limitedEntities.size()))); 9221 9222 data = new CountedObjects<>(objectLimiter, itemDescriptions); 9223 } 9224 } 9225 } catch (NamingException ex) { 9226 throw new RuntimeException(ex); 9227 } 9228 9229 return data; 9230 } 9231 9232 @GraphQLField 9233 @GraphQLName("itemType") 9234 static ItemTypeObject itemType(final DataFetchingEnvironment env, 9235 @GraphQLName("itemTypeName") final String itemTypeName, 9236 @GraphQLName("id") @GraphQLID final String id) { 9237 ItemType itemType; 9238 9239 try { 9240 var commandForm = ItemUtil.getHome().getGetItemTypeForm(); 9241 9242 commandForm.setItemTypeName(itemTypeName); 9243 commandForm.setUuid(id); 9244 9245 itemType = CDI.current().select(GetItemTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9246 } catch (NamingException ex) { 9247 throw new RuntimeException(ex); 9248 } 9249 9250 return itemType == null ? null : new ItemTypeObject(itemType); 9251 } 9252 9253 @GraphQLField 9254 @GraphQLName("itemTypes") 9255 @GraphQLNonNull 9256 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9257 static CountingPaginatedData<ItemTypeObject> itemTypes(final DataFetchingEnvironment env) { 9258 CountingPaginatedData<ItemTypeObject> data; 9259 9260 try { 9261 var commandForm = ItemUtil.getHome().getGetItemTypesForm(); 9262 var command = CDI.current().select(GetItemTypesCommand.class).get(); 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, ItemTypeConstants.COMPONENT_VENDOR_NAME, ItemTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9269 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9270 9271 var itemTypes = entities.stream() 9272 .map(ItemTypeObject::new) 9273 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9274 9275 data = new CountedObjects<>(objectLimiter, itemTypes); 9276 } 9277 } 9278 } catch (NamingException ex) { 9279 throw new RuntimeException(ex); 9280 } 9281 9282 return data; 9283 } 9284 9285 @GraphQLField 9286 @GraphQLName("itemUseType") 9287 static ItemUseTypeObject itemUseType(final DataFetchingEnvironment env, 9288 @GraphQLName("itemUseTypeName") final String itemUseTypeName, 9289 @GraphQLName("id") @GraphQLID final String id) { 9290 ItemUseType itemUseType; 9291 9292 try { 9293 var commandForm = ItemUtil.getHome().getGetItemUseTypeForm(); 9294 9295 commandForm.setItemUseTypeName(itemUseTypeName); 9296 commandForm.setUuid(id); 9297 9298 itemUseType = CDI.current().select(GetItemUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9299 } catch (NamingException ex) { 9300 throw new RuntimeException(ex); 9301 } 9302 9303 return itemUseType == null ? null : new ItemUseTypeObject(itemUseType); 9304 } 9305 9306 @GraphQLField 9307 @GraphQLName("itemUseTypes") 9308 @GraphQLNonNull 9309 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9310 static CountingPaginatedData<ItemUseTypeObject> itemUseTypes(final DataFetchingEnvironment env) { 9311 CountingPaginatedData<ItemUseTypeObject> data; 9312 9313 try { 9314 var commandForm = ItemUtil.getHome().getGetItemUseTypesForm(); 9315 var command = CDI.current().select(GetItemUseTypesCommand.class).get(); 9316 9317 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9318 if(totalEntities == null) { 9319 data = Connections.emptyConnection(); 9320 } else { 9321 try(var objectLimiter = new ObjectLimiter(env, ItemUseTypeConstants.COMPONENT_VENDOR_NAME, ItemUseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9322 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9323 9324 var itemUseTypes = entities.stream() 9325 .map(ItemUseTypeObject::new) 9326 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9327 9328 data = new CountedObjects<>(objectLimiter, itemUseTypes); 9329 } 9330 } 9331 } catch (NamingException ex) { 9332 throw new RuntimeException(ex); 9333 } 9334 9335 return data; 9336 } 9337 9338 @GraphQLField 9339 @GraphQLName("itemPriceType") 9340 static ItemPriceTypeObject itemPriceType(final DataFetchingEnvironment env, 9341 @GraphQLName("itemPriceTypeName") final String itemPriceTypeName, 9342 @GraphQLName("id") @GraphQLID final String id) { 9343 ItemPriceType itemPriceType; 9344 9345 try { 9346 var commandForm = ItemUtil.getHome().getGetItemPriceTypeForm(); 9347 9348 commandForm.setItemPriceTypeName(itemPriceTypeName); 9349 commandForm.setUuid(id); 9350 9351 itemPriceType = CDI.current().select(GetItemPriceTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9352 } catch (NamingException ex) { 9353 throw new RuntimeException(ex); 9354 } 9355 9356 return itemPriceType == null ? null : new ItemPriceTypeObject(itemPriceType); 9357 } 9358 9359 @GraphQLField 9360 @GraphQLName("itemPriceTypes") 9361 @GraphQLNonNull 9362 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9363 static CountingPaginatedData<ItemPriceTypeObject> itemPriceTypes(final DataFetchingEnvironment env) { 9364 CountingPaginatedData<ItemPriceTypeObject> data; 9365 9366 try { 9367 var commandForm = ItemUtil.getHome().getGetItemPriceTypesForm(); 9368 var command = CDI.current().select(GetItemPriceTypesCommand.class).get(); 9369 9370 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9371 if(totalEntities == null) { 9372 data = Connections.emptyConnection(); 9373 } else { 9374 try(var objectLimiter = new ObjectLimiter(env, ItemPriceTypeConstants.COMPONENT_VENDOR_NAME, ItemPriceTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9375 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9376 9377 var itemPriceTypes = entities.stream() 9378 .map(ItemPriceTypeObject::new) 9379 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9380 9381 data = new CountedObjects<>(objectLimiter, itemPriceTypes); 9382 } 9383 } 9384 } catch (NamingException ex) { 9385 throw new RuntimeException(ex); 9386 } 9387 9388 return data; 9389 } 9390 9391 @GraphQLField 9392 @GraphQLName("itemDeliveryType") 9393 static ItemDeliveryTypeObject itemDeliveryType(final DataFetchingEnvironment env, 9394 @GraphQLName("itemDeliveryTypeName") final String itemDeliveryTypeName, 9395 @GraphQLName("id") @GraphQLID final String id) { 9396 ItemDeliveryType itemDeliveryType; 9397 9398 try { 9399 var commandForm = ItemUtil.getHome().getGetItemDeliveryTypeForm(); 9400 9401 commandForm.setItemDeliveryTypeName(itemDeliveryTypeName); 9402 commandForm.setUuid(id); 9403 9404 itemDeliveryType = CDI.current().select(GetItemDeliveryTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9405 } catch (NamingException ex) { 9406 throw new RuntimeException(ex); 9407 } 9408 9409 return itemDeliveryType == null ? null : new ItemDeliveryTypeObject(itemDeliveryType); 9410 } 9411 9412 @GraphQLField 9413 @GraphQLName("itemDeliveryTypes") 9414 @GraphQLNonNull 9415 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9416 static CountingPaginatedData<ItemDeliveryTypeObject> itemDeliveryTypes(final DataFetchingEnvironment env) { 9417 CountingPaginatedData<ItemDeliveryTypeObject> data; 9418 9419 try { 9420 var commandForm = ItemUtil.getHome().getGetItemDeliveryTypesForm(); 9421 var command = CDI.current().select(GetItemDeliveryTypesCommand.class).get(); 9422 9423 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9424 if(totalEntities == null) { 9425 data = Connections.emptyConnection(); 9426 } else { 9427 try(var objectLimiter = new ObjectLimiter(env, ItemDeliveryTypeConstants.COMPONENT_VENDOR_NAME, ItemDeliveryTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9428 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9429 9430 var itemDeliveryTypes = entities.stream() 9431 .map(ItemDeliveryTypeObject::new) 9432 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9433 9434 data = new CountedObjects<>(objectLimiter, itemDeliveryTypes); 9435 } 9436 } 9437 } catch (NamingException ex) { 9438 throw new RuntimeException(ex); 9439 } 9440 9441 return data; 9442 } 9443 9444 @GraphQLField 9445 @GraphQLName("itemInventoryType") 9446 static ItemInventoryTypeObject itemInventoryType(final DataFetchingEnvironment env, 9447 @GraphQLName("itemInventoryTypeName") final String itemInventoryTypeName, 9448 @GraphQLName("id") @GraphQLID final String id) { 9449 ItemInventoryType itemInventoryType; 9450 9451 try { 9452 var commandForm = ItemUtil.getHome().getGetItemInventoryTypeForm(); 9453 9454 commandForm.setItemInventoryTypeName(itemInventoryTypeName); 9455 commandForm.setUuid(id); 9456 9457 itemInventoryType = CDI.current().select(GetItemInventoryTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9458 } catch (NamingException ex) { 9459 throw new RuntimeException(ex); 9460 } 9461 9462 return itemInventoryType == null ? null : new ItemInventoryTypeObject(itemInventoryType); 9463 } 9464 9465 @GraphQLField 9466 @GraphQLName("itemInventoryTypes") 9467 @GraphQLNonNull 9468 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9469 static CountingPaginatedData<ItemInventoryTypeObject> itemInventoryTypes(final DataFetchingEnvironment env) { 9470 CountingPaginatedData<ItemInventoryTypeObject> data; 9471 9472 try { 9473 var commandForm = ItemUtil.getHome().getGetItemInventoryTypesForm(); 9474 var command = CDI.current().select(GetItemInventoryTypesCommand.class).get(); 9475 9476 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9477 if(totalEntities == null) { 9478 data = Connections.emptyConnection(); 9479 } else { 9480 try(var objectLimiter = new ObjectLimiter(env, ItemInventoryTypeConstants.COMPONENT_VENDOR_NAME, ItemInventoryTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9481 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9482 9483 var itemInventoryTypes = entities.stream() 9484 .map(ItemInventoryTypeObject::new) 9485 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9486 9487 data = new CountedObjects<>(objectLimiter, itemInventoryTypes); 9488 } 9489 } 9490 } catch (NamingException ex) { 9491 throw new RuntimeException(ex); 9492 } 9493 9494 return data; 9495 } 9496 9497 @GraphQLField 9498 @GraphQLName("itemPrice") 9499 static ItemPriceObject itemPrice(final DataFetchingEnvironment env, 9500 @GraphQLName("itemName") @GraphQLNonNull final String itemName, 9501 @GraphQLName("inventoryConditionName") @GraphQLNonNull final String inventoryConditionName, 9502 @GraphQLName("unitOfMeasureTypeName") @GraphQLNonNull final String unitOfMeasureTypeName, 9503 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 9504 ItemPrice itemPrice; 9505 9506 try { 9507 var commandForm = ItemUtil.getHome().getGetItemPriceForm(); 9508 9509 commandForm.setItemName(itemName); 9510 commandForm.setInventoryConditionName(inventoryConditionName); 9511 commandForm.setUnitOfMeasureTypeName(unitOfMeasureTypeName); 9512 commandForm.setCurrencyIsoName(currencyIsoName); 9513 9514 itemPrice = CDI.current().select(GetItemPriceCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9515 } catch (NamingException ex) { 9516 throw new RuntimeException(ex); 9517 } 9518 9519 return itemPrice == null ? null : new ItemPriceObject(itemPrice); 9520 } 9521 9522 @GraphQLField 9523 @GraphQLName("itemPrices") 9524 @GraphQLNonNull 9525 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9526 static CountingPaginatedData<ItemPriceObject> itemPrices(final DataFetchingEnvironment env, 9527 @GraphQLName("itemName") @GraphQLNonNull final String itemName) { 9528 CountingPaginatedData<ItemPriceObject> data; 9529 9530 try { 9531 var commandForm = ItemUtil.getHome().getGetItemPricesForm(); 9532 var command = CDI.current().select(GetItemPricesCommand.class).get(); 9533 9534 commandForm.setItemName(itemName); 9535 9536 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9537 if(totalEntities == null) { 9538 data = Connections.emptyConnection(); 9539 } else { 9540 try(var objectLimiter = new ObjectLimiter(env, ItemPriceConstants.COMPONENT_VENDOR_NAME, ItemPriceConstants.ENTITY_TYPE_NAME, totalEntities)) { 9541 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9542 9543 var itemPriceObjects = entities.stream() 9544 .map(ItemPriceObject::new) 9545 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9546 9547 data = new CountedObjects<>(objectLimiter, itemPriceObjects); 9548 } 9549 } 9550 } catch (NamingException ex) { 9551 throw new RuntimeException(ex); 9552 } 9553 9554 return data; 9555 } 9556 9557 @GraphQLField 9558 @GraphQLName("itemAliasChecksumType") 9559 static ItemAliasChecksumTypeObject itemAliasChecksumType(final DataFetchingEnvironment env, 9560 @GraphQLName("itemAliasChecksumTypeName") final String itemAliasChecksumTypeName, 9561 @GraphQLName("id") @GraphQLID final String id) { 9562 ItemAliasChecksumType itemAliasChecksumType; 9563 9564 try { 9565 var commandForm = ItemUtil.getHome().getGetItemAliasChecksumTypeForm(); 9566 9567 commandForm.setItemAliasChecksumTypeName(itemAliasChecksumTypeName); 9568 commandForm.setUuid(id); 9569 9570 itemAliasChecksumType = CDI.current().select(GetItemAliasChecksumTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9571 } catch (NamingException ex) { 9572 throw new RuntimeException(ex); 9573 } 9574 9575 return itemAliasChecksumType == null ? null : new ItemAliasChecksumTypeObject(itemAliasChecksumType); 9576 } 9577 9578 @GraphQLField 9579 @GraphQLName("itemAliasChecksumTypes") 9580 @GraphQLNonNull 9581 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9582 static CountingPaginatedData<ItemAliasChecksumTypeObject> itemAliasChecksumTypes(final DataFetchingEnvironment env) { 9583 CountingPaginatedData<ItemAliasChecksumTypeObject> data; 9584 9585 try { 9586 var commandForm = ItemUtil.getHome().getGetItemAliasChecksumTypesForm(); 9587 var command = CDI.current().select(GetItemAliasChecksumTypesCommand.class).get(); 9588 9589 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9590 if(totalEntities == null) { 9591 data = Connections.emptyConnection(); 9592 } else { 9593 try(var objectLimiter = new ObjectLimiter(env, ItemAliasChecksumTypeConstants.COMPONENT_VENDOR_NAME, ItemAliasChecksumTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9594 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9595 9596 var itemAliasChecksumTypes = entities.stream() 9597 .map(ItemAliasChecksumTypeObject::new) 9598 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9599 9600 data = new CountedObjects<>(objectLimiter, itemAliasChecksumTypes); 9601 } 9602 } 9603 } catch (NamingException ex) { 9604 throw new RuntimeException(ex); 9605 } 9606 9607 return data; 9608 } 9609 9610 @GraphQLField 9611 @GraphQLName("itemAlias") 9612 static ItemAliasObject itemAlias(final DataFetchingEnvironment env, 9613 @GraphQLName("alias") @GraphQLNonNull final String alias) { 9614 ItemAlias itemAlias; 9615 9616 try { 9617 var commandForm = ItemUtil.getHome().getGetItemAliasForm(); 9618 9619 commandForm.setAlias(alias); 9620 9621 itemAlias = CDI.current().select(GetItemAliasCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9622 } catch (NamingException ex) { 9623 throw new RuntimeException(ex); 9624 } 9625 9626 return itemAlias == null ? null : new ItemAliasObject(itemAlias); 9627 } 9628 9629 @GraphQLField 9630 @GraphQLName("itemAliases") 9631 @GraphQLNonNull 9632 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9633 static CountingPaginatedData<ItemAliasObject> itemAliases(final DataFetchingEnvironment env, 9634 @GraphQLName("itemName") @GraphQLNonNull final String itemName) { 9635 CountingPaginatedData<ItemAliasObject> data; 9636 9637 try { 9638 var commandForm = ItemUtil.getHome().getGetItemAliasesForm(); 9639 var command = CDI.current().select(GetItemAliasesCommand.class).get(); 9640 9641 commandForm.setItemName(itemName); 9642 9643 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9644 if(totalEntities == null) { 9645 data = Connections.emptyConnection(); 9646 } else { 9647 try(var objectLimiter = new ObjectLimiter(env, ItemAliasConstants.COMPONENT_VENDOR_NAME, ItemAliasConstants.ENTITY_TYPE_NAME, totalEntities)) { 9648 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9649 9650 var itemAliasObjects = entities.stream() 9651 .map(ItemAliasObject::new) 9652 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9653 9654 data = new CountedObjects<>(objectLimiter, itemAliasObjects); 9655 } 9656 } 9657 } catch (NamingException ex) { 9658 throw new RuntimeException(ex); 9659 } 9660 9661 return data; 9662 } 9663 9664 @GraphQLField 9665 @GraphQLName("itemCategory") 9666 static ItemCategoryObject itemCategory(final DataFetchingEnvironment env, 9667 @GraphQLName("itemCategoryName") final String itemCategoryName, 9668 @GraphQLName("id") @GraphQLID final String id) { 9669 ItemCategory itemCategory; 9670 9671 try { 9672 var commandForm = ItemUtil.getHome().getGetItemCategoryForm(); 9673 9674 commandForm.setItemCategoryName(itemCategoryName); 9675 commandForm.setUuid(id); 9676 9677 itemCategory = CDI.current().select(GetItemCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9678 } catch (NamingException ex) { 9679 throw new RuntimeException(ex); 9680 } 9681 9682 return itemCategory == null ? null : new ItemCategoryObject(itemCategory); 9683 } 9684 9685 @GraphQLField 9686 @GraphQLName("itemCategories") 9687 @GraphQLNonNull 9688 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9689 static CountingPaginatedData<ItemCategoryObject> itemCategories(final DataFetchingEnvironment env, 9690 @GraphQLName("parentItemCategoryName") final String parentItemCategoryName) { 9691 CountingPaginatedData<ItemCategoryObject> data; 9692 9693 try { 9694 var commandForm = ItemUtil.getHome().getGetItemCategoriesForm(); 9695 var command = CDI.current().select(GetItemCategoriesCommand.class).get(); 9696 9697 commandForm.setParentItemCategoryName(parentItemCategoryName); 9698 9699 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9700 if(totalEntities == null) { 9701 data = Connections.emptyConnection(); 9702 } else { 9703 try(var objectLimiter = new ObjectLimiter(env, ItemCategoryConstants.COMPONENT_VENDOR_NAME, ItemCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 9704 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9705 9706 var itemCategories = entities.stream() 9707 .map(ItemCategoryObject::new) 9708 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9709 9710 data = new CountedObjects<>(objectLimiter, itemCategories); 9711 } 9712 } 9713 } catch (NamingException ex) { 9714 throw new RuntimeException(ex); 9715 } 9716 9717 return data; 9718 } 9719 9720 @GraphQLField 9721 @GraphQLName("itemAccountingCategory") 9722 static ItemAccountingCategoryObject itemAccountingCategory(final DataFetchingEnvironment env, 9723 @GraphQLName("itemAccountingCategoryName") final String itemAccountingCategoryName, 9724 @GraphQLName("id") @GraphQLID final String id) { 9725 ItemAccountingCategory itemAccountingCategory; 9726 9727 try { 9728 var commandForm = AccountingUtil.getHome().getGetItemAccountingCategoryForm(); 9729 9730 commandForm.setItemAccountingCategoryName(itemAccountingCategoryName); 9731 commandForm.setUuid(id); 9732 9733 itemAccountingCategory = CDI.current().select(GetItemAccountingCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9734 } catch (NamingException ex) { 9735 throw new RuntimeException(ex); 9736 } 9737 9738 return itemAccountingCategory == null ? null : new ItemAccountingCategoryObject(itemAccountingCategory); 9739 } 9740 9741 @GraphQLField 9742 @GraphQLName("itemAccountingCategories") 9743 @GraphQLNonNull 9744 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9745 static CountingPaginatedData<ItemAccountingCategoryObject> itemAccountingCategories(final DataFetchingEnvironment env) { 9746 CountingPaginatedData<ItemAccountingCategoryObject> data; 9747 9748 try { 9749 var commandForm = AccountingUtil.getHome().getGetItemAccountingCategoriesForm(); 9750 var command = CDI.current().select(GetItemAccountingCategoriesCommand.class).get(); 9751 9752 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9753 if(totalEntities == null) { 9754 data = Connections.emptyConnection(); 9755 } else { 9756 try(var objectLimiter = new ObjectLimiter(env, ItemAccountingCategoryConstants.COMPONENT_VENDOR_NAME, ItemAccountingCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 9757 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9758 9759 var itemAccountingCategories = entities.stream() 9760 .map(ItemAccountingCategoryObject::new) 9761 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9762 9763 data = new CountedObjects<>(objectLimiter, itemAccountingCategories); 9764 } 9765 } 9766 } catch (NamingException ex) { 9767 throw new RuntimeException(ex); 9768 } 9769 9770 return data; 9771 } 9772 9773 @GraphQLField 9774 @GraphQLName("glAccount") 9775 static GlAccountObject glAccount(final DataFetchingEnvironment env, 9776 @GraphQLName("glAccountName") final String glAccountName, 9777 @GraphQLName("id") @GraphQLID final String id) { 9778 GlAccount glAccount; 9779 9780 try { 9781 var commandForm = AccountingUtil.getHome().getGetGlAccountForm(); 9782 9783 commandForm.setGlAccountName(glAccountName); 9784 commandForm.setUuid(id); 9785 9786 glAccount = CDI.current().select(GetGlAccountCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9787 } catch (NamingException ex) { 9788 throw new RuntimeException(ex); 9789 } 9790 9791 return glAccount == null ? null : new GlAccountObject(glAccount); 9792 } 9793 9794 @GraphQLField 9795 @GraphQLName("glAccounts") 9796 @GraphQLNonNull 9797 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9798 static CountingPaginatedData<GlAccountObject> glAccounts(final DataFetchingEnvironment env, 9799 @GraphQLName("glAccountCategoryName") final String glAccountCategoryName) { 9800 CountingPaginatedData<GlAccountObject> data; 9801 9802 try { 9803 var commandForm = AccountingUtil.getHome().getGetGlAccountsForm(); 9804 var command = CDI.current().select(GetGlAccountsCommand.class).get(); 9805 9806 commandForm.setGlAccountCategoryName(glAccountCategoryName); 9807 9808 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9809 if(totalEntities == null) { 9810 data = Connections.emptyConnection(); 9811 } else { 9812 try(var objectLimiter = new ObjectLimiter(env, GlAccountConstants.COMPONENT_VENDOR_NAME, GlAccountConstants.ENTITY_TYPE_NAME, totalEntities)) { 9813 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9814 9815 var glAccounts = entities.stream() 9816 .map(GlAccountObject::new) 9817 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9818 9819 data = new CountedObjects<>(objectLimiter, glAccounts); 9820 } 9821 } 9822 } catch (NamingException ex) { 9823 throw new RuntimeException(ex); 9824 } 9825 9826 return data; 9827 } 9828 9829 @GraphQLField 9830 @GraphQLName("glAccountType") 9831 static GlAccountTypeObject glAccountType(final DataFetchingEnvironment env, 9832 @GraphQLName("glAccountTypeName") final String glAccountTypeName, 9833 @GraphQLName("id") @GraphQLID final String id) { 9834 GlAccountType glAccountType; 9835 9836 try { 9837 var commandForm = AccountingUtil.getHome().getGetGlAccountTypeForm(); 9838 9839 commandForm.setGlAccountTypeName(glAccountTypeName); 9840 commandForm.setUuid(id); 9841 9842 glAccountType = CDI.current().select(GetGlAccountTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9843 } catch (NamingException ex) { 9844 throw new RuntimeException(ex); 9845 } 9846 9847 return glAccountType == null ? null : new GlAccountTypeObject(glAccountType); 9848 } 9849 9850 @GraphQLField 9851 @GraphQLName("glAccountTypes") 9852 @GraphQLNonNull 9853 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9854 static CountingPaginatedData<GlAccountTypeObject> glAccountTypes(final DataFetchingEnvironment env) { 9855 CountingPaginatedData<GlAccountTypeObject> data; 9856 9857 try { 9858 var commandForm = AccountingUtil.getHome().getGetGlAccountTypesForm(); 9859 var command = CDI.current().select(GetGlAccountTypesCommand.class).get(); 9860 9861 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9862 if(totalEntities == null) { 9863 data = Connections.emptyConnection(); 9864 } else { 9865 try(var objectLimiter = new ObjectLimiter(env, GlAccountTypeConstants.COMPONENT_VENDOR_NAME, GlAccountTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 9866 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9867 9868 var glAccountTypes = entities.stream() 9869 .map(GlAccountTypeObject::new) 9870 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9871 9872 data = new CountedObjects<>(objectLimiter, glAccountTypes); 9873 } 9874 } 9875 } catch (NamingException ex) { 9876 throw new RuntimeException(ex); 9877 } 9878 9879 return data; 9880 } 9881 9882 @GraphQLField 9883 @GraphQLName("glAccountClass") 9884 static GlAccountClassObject glAccountClass(final DataFetchingEnvironment env, 9885 @GraphQLName("glAccountClassName") final String glAccountClassName, 9886 @GraphQLName("id") @GraphQLID final String id) { 9887 GlAccountClass glAccountClass; 9888 9889 try { 9890 var commandForm = AccountingUtil.getHome().getGetGlAccountClassForm(); 9891 9892 commandForm.setGlAccountClassName(glAccountClassName); 9893 commandForm.setUuid(id); 9894 9895 glAccountClass = CDI.current().select(GetGlAccountClassCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9896 } catch (NamingException ex) { 9897 throw new RuntimeException(ex); 9898 } 9899 9900 return glAccountClass == null ? null : new GlAccountClassObject(glAccountClass); 9901 } 9902 9903 @GraphQLField 9904 @GraphQLName("glAccountClasses") 9905 @GraphQLNonNull 9906 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9907 static CountingPaginatedData<GlAccountClassObject> glAccountClasses(final DataFetchingEnvironment env) { 9908 CountingPaginatedData<GlAccountClassObject> data; 9909 9910 try { 9911 var commandForm = AccountingUtil.getHome().getGetGlAccountClassesForm(); 9912 var command = CDI.current().select(GetGlAccountClassesCommand.class).get(); 9913 9914 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9915 if(totalEntities == null) { 9916 data = Connections.emptyConnection(); 9917 } else { 9918 try(var objectLimiter = new ObjectLimiter(env, GlAccountClassConstants.COMPONENT_VENDOR_NAME, GlAccountClassConstants.ENTITY_TYPE_NAME, totalEntities)) { 9919 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9920 9921 var glAccountClasses = entities.stream() 9922 .map(GlAccountClassObject::new) 9923 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9924 9925 data = new CountedObjects<>(objectLimiter, glAccountClasses); 9926 } 9927 } 9928 } catch (NamingException ex) { 9929 throw new RuntimeException(ex); 9930 } 9931 9932 return data; 9933 } 9934 9935 @GraphQLField 9936 @GraphQLName("glAccountCategory") 9937 static GlAccountCategoryObject glAccountCategory(final DataFetchingEnvironment env, 9938 @GraphQLName("glAccountCategoryName") final String glAccountCategoryName, 9939 @GraphQLName("id") @GraphQLID final String id) { 9940 GlAccountCategory glAccountCategory; 9941 9942 try { 9943 var commandForm = AccountingUtil.getHome().getGetGlAccountCategoryForm(); 9944 9945 commandForm.setGlAccountCategoryName(glAccountCategoryName); 9946 commandForm.setUuid(id); 9947 9948 glAccountCategory = CDI.current().select(GetGlAccountCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 9949 } catch (NamingException ex) { 9950 throw new RuntimeException(ex); 9951 } 9952 9953 return glAccountCategory == null ? null : new GlAccountCategoryObject(glAccountCategory); 9954 } 9955 9956 @GraphQLField 9957 @GraphQLName("glAccountCategories") 9958 @GraphQLNonNull 9959 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 9960 static CountingPaginatedData<GlAccountCategoryObject> glAccountCategories(final DataFetchingEnvironment env) { 9961 CountingPaginatedData<GlAccountCategoryObject> data; 9962 9963 try { 9964 var commandForm = AccountingUtil.getHome().getGetGlAccountCategoriesForm(); 9965 var command = CDI.current().select(GetGlAccountCategoriesCommand.class).get(); 9966 9967 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9968 if(totalEntities == null) { 9969 data = Connections.emptyConnection(); 9970 } else { 9971 try(var objectLimiter = new ObjectLimiter(env, GlAccountCategoryConstants.COMPONENT_VENDOR_NAME, GlAccountCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 9972 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 9973 9974 var glAccountCategories = entities.stream() 9975 .map(GlAccountCategoryObject::new) 9976 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 9977 9978 data = new CountedObjects<>(objectLimiter, glAccountCategories); 9979 } 9980 } 9981 } catch (NamingException ex) { 9982 throw new RuntimeException(ex); 9983 } 9984 9985 return data; 9986 } 9987 9988 @GraphQLField 9989 @GraphQLName("glResourceType") 9990 static GlResourceTypeObject glResourceType(final DataFetchingEnvironment env, 9991 @GraphQLName("glResourceTypeName") final String glResourceTypeName, 9992 @GraphQLName("id") @GraphQLID final String id) { 9993 GlResourceType glResourceType; 9994 9995 try { 9996 var commandForm = AccountingUtil.getHome().getGetGlResourceTypeForm(); 9997 9998 commandForm.setGlResourceTypeName(glResourceTypeName); 9999 commandForm.setUuid(id); 10000 10001 glResourceType = CDI.current().select(GetGlResourceTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10002 } catch (NamingException ex) { 10003 throw new RuntimeException(ex); 10004 } 10005 10006 return glResourceType == null ? null : new GlResourceTypeObject(glResourceType); 10007 } 10008 10009 @GraphQLField 10010 @GraphQLName("glResourceTypes") 10011 @GraphQLNonNull 10012 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10013 static CountingPaginatedData<GlResourceTypeObject> glResourceTypes(final DataFetchingEnvironment env) { 10014 CountingPaginatedData<GlResourceTypeObject> data; 10015 10016 try { 10017 var commandForm = AccountingUtil.getHome().getGetGlResourceTypesForm(); 10018 var command = CDI.current().select(GetGlResourceTypesCommand.class).get(); 10019 10020 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10021 if(totalEntities == null) { 10022 data = Connections.emptyConnection(); 10023 } else { 10024 try(var objectLimiter = new ObjectLimiter(env, GlResourceTypeConstants.COMPONENT_VENDOR_NAME, GlResourceTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10025 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10026 10027 var glResourceTypes = entities.stream() 10028 .map(GlResourceTypeObject::new) 10029 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10030 10031 data = new CountedObjects<>(objectLimiter, glResourceTypes); 10032 } 10033 } 10034 } catch (NamingException ex) { 10035 throw new RuntimeException(ex); 10036 } 10037 10038 return data; 10039 } 10040 10041 @GraphQLField 10042 @GraphQLName("itemPurchasingCategory") 10043 static ItemPurchasingCategoryObject itemPurchasingCategory(final DataFetchingEnvironment env, 10044 @GraphQLName("itemPurchasingCategoryName") final String itemPurchasingCategoryName, 10045 @GraphQLName("id") @GraphQLID final String id) { 10046 ItemPurchasingCategory itemPurchasingCategory; 10047 10048 try { 10049 var commandForm = VendorUtil.getHome().getGetItemPurchasingCategoryForm(); 10050 10051 commandForm.setItemPurchasingCategoryName(itemPurchasingCategoryName); 10052 commandForm.setUuid(id); 10053 10054 itemPurchasingCategory = CDI.current().select(GetItemPurchasingCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10055 } catch (NamingException ex) { 10056 throw new RuntimeException(ex); 10057 } 10058 10059 return itemPurchasingCategory == null ? null : new ItemPurchasingCategoryObject(itemPurchasingCategory); 10060 } 10061 10062 @GraphQLField 10063 @GraphQLName("itemPurchasingCategories") 10064 @GraphQLNonNull 10065 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10066 static CountingPaginatedData<ItemPurchasingCategoryObject> itemPurchasingCategories(final DataFetchingEnvironment env) { 10067 CountingPaginatedData<ItemPurchasingCategoryObject> data; 10068 10069 try { 10070 var commandForm = VendorUtil.getHome().getGetItemPurchasingCategoriesForm(); 10071 var command = CDI.current().select(GetItemPurchasingCategoriesCommand.class).get(); 10072 10073 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10074 if(totalEntities == null) { 10075 data = Connections.emptyConnection(); 10076 } else { 10077 try(var objectLimiter = new ObjectLimiter(env, ItemPurchasingCategoryConstants.COMPONENT_VENDOR_NAME, ItemPurchasingCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 10078 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10079 10080 var itemPurchasingCategories = entities.stream() 10081 .map(ItemPurchasingCategoryObject::new) 10082 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10083 10084 data = new CountedObjects<>(objectLimiter, itemPurchasingCategories); 10085 } 10086 } 10087 } catch (NamingException ex) { 10088 throw new RuntimeException(ex); 10089 } 10090 10091 return data; 10092 } 10093 10094 @GraphQLField 10095 @GraphQLName("itemDescriptionType") 10096 static ItemDescriptionTypeObject itemDescriptionType(final DataFetchingEnvironment env, 10097 @GraphQLName("itemDescriptionTypeName") final String itemDescriptionTypeName, 10098 @GraphQLName("id") @GraphQLID final String id) { 10099 ItemDescriptionType itemDescriptionType; 10100 10101 try { 10102 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypeForm(); 10103 10104 commandForm.setItemDescriptionTypeName(itemDescriptionTypeName); 10105 commandForm.setUuid(id); 10106 10107 itemDescriptionType = CDI.current().select(GetItemDescriptionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10108 } catch (NamingException ex) { 10109 throw new RuntimeException(ex); 10110 } 10111 10112 return itemDescriptionType == null ? null : new ItemDescriptionTypeObject(itemDescriptionType); 10113 } 10114 10115 @GraphQLField 10116 @GraphQLName("itemDescriptionTypes") 10117 @GraphQLNonNull 10118 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10119 static CountingPaginatedData<ItemDescriptionTypeObject> itemDescriptionTypes(final DataFetchingEnvironment env, 10120 @GraphQLName("parentItemDescriptionTypeName") final String parentItemDescriptionTypeName) { 10121 CountingPaginatedData<ItemDescriptionTypeObject> data; 10122 10123 try { 10124 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypesForm(); 10125 var command = CDI.current().select(GetItemDescriptionTypesCommand.class).get(); 10126 10127 commandForm.setParentItemDescriptionTypeName(parentItemDescriptionTypeName); 10128 10129 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10130 if(totalEntities == null) { 10131 data = Connections.emptyConnection(); 10132 } else { 10133 try(var objectLimiter = new ObjectLimiter(env, ItemDescriptionTypeConstants.COMPONENT_VENDOR_NAME, ItemDescriptionTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10134 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10135 10136 var itemDescriptionTypes = entities.stream() 10137 .map(ItemDescriptionTypeObject::new) 10138 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10139 10140 data = new CountedObjects<>(objectLimiter, itemDescriptionTypes); 10141 } 10142 } 10143 } catch (NamingException ex) { 10144 throw new RuntimeException(ex); 10145 } 10146 10147 return data; 10148 } 10149 10150 @GraphQLField 10151 @GraphQLName("itemImageType") 10152 static ItemImageTypeObject itemImageType(final DataFetchingEnvironment env, 10153 @GraphQLName("itemImageTypeName") final String itemImageTypeName, 10154 @GraphQLName("id") @GraphQLID final String id) { 10155 ItemImageType itemImageType; 10156 10157 try { 10158 var commandForm = ItemUtil.getHome().getGetItemImageTypeForm(); 10159 10160 commandForm.setItemImageTypeName(itemImageTypeName); 10161 commandForm.setUuid(id); 10162 10163 itemImageType = CDI.current().select(GetItemImageTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10164 } catch (NamingException ex) { 10165 throw new RuntimeException(ex); 10166 } 10167 10168 return itemImageType == null ? null : new ItemImageTypeObject(itemImageType); 10169 } 10170 10171 @GraphQLField 10172 @GraphQLName("itemImageTypes") 10173 @GraphQLNonNull 10174 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10175 static CountingPaginatedData<ItemImageTypeObject> itemImageTypes(final DataFetchingEnvironment env) { 10176 CountingPaginatedData<ItemImageTypeObject> data; 10177 10178 try { 10179 var commandForm = ItemUtil.getHome().getGetItemImageTypesForm(); 10180 var command = CDI.current().select(GetItemImageTypesCommand.class).get(); 10181 10182 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10183 if(totalEntities == null) { 10184 data = Connections.emptyConnection(); 10185 } else { 10186 try(var objectLimiter = new ObjectLimiter(env, ItemImageTypeConstants.COMPONENT_VENDOR_NAME, ItemImageTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10187 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10188 10189 var itemImageTypes = entities.stream() 10190 .map(ItemImageTypeObject::new) 10191 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10192 10193 data = new CountedObjects<>(objectLimiter, itemImageTypes); 10194 } 10195 } 10196 } catch (NamingException ex) { 10197 throw new RuntimeException(ex); 10198 } 10199 10200 return data; 10201 } 10202 10203 @GraphQLField 10204 @GraphQLName("itemDescriptionTypeUseType") 10205 static ItemDescriptionTypeUseTypeObject itemDescriptionTypeUseType(final DataFetchingEnvironment env, 10206 @GraphQLName("itemDescriptionTypeUseTypeName") final String itemDescriptionTypeUseTypeName, 10207 @GraphQLName("id") @GraphQLID final String id) { 10208 ItemDescriptionTypeUseType itemDescriptionTypeUseType; 10209 10210 try { 10211 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypeUseTypeForm(); 10212 10213 commandForm.setItemDescriptionTypeUseTypeName(itemDescriptionTypeUseTypeName); 10214 commandForm.setUuid(id); 10215 10216 itemDescriptionTypeUseType = CDI.current().select(GetItemDescriptionTypeUseTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10217 } catch (NamingException ex) { 10218 throw new RuntimeException(ex); 10219 } 10220 10221 return itemDescriptionTypeUseType == null ? null : new ItemDescriptionTypeUseTypeObject(itemDescriptionTypeUseType); 10222 } 10223 10224 @GraphQLField 10225 @GraphQLName("itemDescriptionTypeUseTypes") 10226 @GraphQLNonNull 10227 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10228 static CountingPaginatedData<ItemDescriptionTypeUseTypeObject> itemDescriptionTypeUseTypes(final DataFetchingEnvironment env) { 10229 CountingPaginatedData<ItemDescriptionTypeUseTypeObject> data; 10230 10231 try { 10232 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypeUseTypesForm(); 10233 var command = CDI.current().select(GetItemDescriptionTypeUseTypesCommand.class).get(); 10234 10235 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10236 if(totalEntities == null) { 10237 data = Connections.emptyConnection(); 10238 } else { 10239 try(var objectLimiter = new ObjectLimiter(env, ItemDescriptionTypeUseTypeConstants.COMPONENT_VENDOR_NAME, ItemDescriptionTypeUseTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10240 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10241 10242 var itemDescriptionTypeUseTypes = entities.stream() 10243 .map(ItemDescriptionTypeUseTypeObject::new) 10244 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10245 10246 data = new CountedObjects<>(objectLimiter, itemDescriptionTypeUseTypes); 10247 } 10248 } 10249 } catch (NamingException ex) { 10250 throw new RuntimeException(ex); 10251 } 10252 10253 return data; 10254 } 10255 10256 @GraphQLField 10257 @GraphQLName("itemDescriptionTypeUse") 10258 static ItemDescriptionTypeUseObject itemDescriptionTypeUse(final DataFetchingEnvironment env, 10259 @GraphQLName("itemDescriptionTypeUseTypeName") @GraphQLNonNull final String itemDescriptionTypeUseTypeName, 10260 @GraphQLName("itemDescriptionTypeName") @GraphQLNonNull final String itemDescriptionTypeName) { 10261 ItemDescriptionTypeUse itemDescriptionTypeUse; 10262 10263 try { 10264 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypeUseForm(); 10265 10266 commandForm.setItemDescriptionTypeUseTypeName(itemDescriptionTypeUseTypeName); 10267 commandForm.setItemDescriptionTypeName(itemDescriptionTypeName); 10268 10269 itemDescriptionTypeUse = CDI.current().select(GetItemDescriptionTypeUseCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10270 } catch (NamingException ex) { 10271 throw new RuntimeException(ex); 10272 } 10273 10274 return itemDescriptionTypeUse == null ? null : new ItemDescriptionTypeUseObject(itemDescriptionTypeUse); 10275 } 10276 10277 @GraphQLField 10278 @GraphQLName("itemDescriptionTypeUses") 10279 @GraphQLNonNull 10280 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10281 static CountingPaginatedData<ItemDescriptionTypeUseObject> itemDescriptionTypeUses(final DataFetchingEnvironment env, 10282 @GraphQLName("itemDescriptionTypeUseTypeName") final String itemDescriptionTypeUseTypeName, 10283 @GraphQLName("itemDescriptionTypeName") final String itemDescriptionTypeName) { 10284 CountingPaginatedData<ItemDescriptionTypeUseObject> data; 10285 10286 try { 10287 var commandForm = ItemUtil.getHome().getGetItemDescriptionTypeUsesForm(); 10288 var command = CDI.current().select(GetItemDescriptionTypeUsesCommand.class).get(); 10289 10290 commandForm.setItemDescriptionTypeUseTypeName(itemDescriptionTypeUseTypeName); 10291 commandForm.setItemDescriptionTypeName(itemDescriptionTypeName); 10292 10293 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10294 if(totalEntities == null) { 10295 data = Connections.emptyConnection(); 10296 } else { 10297 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)) { 10298 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10299 10300 var objects = entities.stream() 10301 .map(ItemDescriptionTypeUseObject::new) 10302 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10303 10304 data = new CountedObjects<>(objectLimiter, objects); 10305 } 10306 } 10307 } catch (NamingException ex) { 10308 throw new RuntimeException(ex); 10309 } 10310 10311 return data; 10312 } 10313 10314 @GraphQLField 10315 @GraphQLName("itemAliasType") 10316 static ItemAliasTypeObject itemAliasType(final DataFetchingEnvironment env, 10317 @GraphQLName("itemAliasTypeName") final String itemAliasTypeName, 10318 @GraphQLName("id") @GraphQLID final String id) { 10319 ItemAliasType itemAliasType; 10320 10321 try { 10322 var commandForm = ItemUtil.getHome().getGetItemAliasTypeForm(); 10323 10324 commandForm.setItemAliasTypeName(itemAliasTypeName); 10325 commandForm.setUuid(id); 10326 10327 itemAliasType = CDI.current().select(GetItemAliasTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10328 } catch (NamingException ex) { 10329 throw new RuntimeException(ex); 10330 } 10331 10332 return itemAliasType == null ? null : new ItemAliasTypeObject(itemAliasType); 10333 } 10334 10335 @GraphQLField 10336 @GraphQLName("itemAliasTypes") 10337 @GraphQLNonNull 10338 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10339 static CountingPaginatedData<ItemAliasTypeObject> itemAliasTypes(final DataFetchingEnvironment env) { 10340 CountingPaginatedData<ItemAliasTypeObject> data; 10341 10342 try { 10343 var commandForm = ItemUtil.getHome().getGetItemAliasTypesForm(); 10344 var command = CDI.current().select(GetItemAliasTypesCommand.class).get(); 10345 10346 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10347 if(totalEntities == null) { 10348 data = Connections.emptyConnection(); 10349 } else { 10350 try(var objectLimiter = new ObjectLimiter(env, ItemAliasTypeConstants.COMPONENT_VENDOR_NAME, ItemAliasTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10351 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10352 10353 var itemAliasTypes = entities.stream() 10354 .map(ItemAliasTypeObject::new) 10355 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10356 10357 data = new CountedObjects<>(objectLimiter, itemAliasTypes); 10358 } 10359 } 10360 } catch (NamingException ex) { 10361 throw new RuntimeException(ex); 10362 } 10363 10364 return data; 10365 } 10366 10367 @GraphQLField 10368 @GraphQLName("itemWeightType") 10369 static ItemWeightTypeObject itemWeightType(final DataFetchingEnvironment env, 10370 @GraphQLName("itemWeightTypeName") final String itemWeightTypeName, 10371 @GraphQLName("id") @GraphQLID final String id) { 10372 ItemWeightType itemWeightType; 10373 10374 try { 10375 var commandForm = ItemUtil.getHome().getGetItemWeightTypeForm(); 10376 10377 commandForm.setItemWeightTypeName(itemWeightTypeName); 10378 commandForm.setUuid(id); 10379 10380 itemWeightType = CDI.current().select(GetItemWeightTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10381 } catch (NamingException ex) { 10382 throw new RuntimeException(ex); 10383 } 10384 10385 return itemWeightType == null ? null : new ItemWeightTypeObject(itemWeightType); 10386 } 10387 10388 @GraphQLField 10389 @GraphQLName("itemWeightTypes") 10390 @GraphQLNonNull 10391 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10392 static CountingPaginatedData<ItemWeightTypeObject> itemWeightTypes(final DataFetchingEnvironment env) { 10393 CountingPaginatedData<ItemWeightTypeObject> data; 10394 10395 try { 10396 var commandForm = ItemUtil.getHome().getGetItemWeightTypesForm(); 10397 var command = CDI.current().select(GetItemWeightTypesCommand.class).get(); 10398 10399 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10400 if(totalEntities == null) { 10401 data = Connections.emptyConnection(); 10402 } else { 10403 try(var objectLimiter = new ObjectLimiter(env, ItemWeightTypeConstants.COMPONENT_VENDOR_NAME, ItemWeightTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10404 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10405 10406 var itemWeightTypes = entities.stream() 10407 .map(ItemWeightTypeObject::new) 10408 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10409 10410 data = new CountedObjects<>(objectLimiter, itemWeightTypes); 10411 } 10412 } 10413 } catch (NamingException ex) { 10414 throw new RuntimeException(ex); 10415 } 10416 10417 return data; 10418 } 10419 10420 @GraphQLField 10421 @GraphQLName("itemVolumeType") 10422 static ItemVolumeTypeObject itemVolumeType(final DataFetchingEnvironment env, 10423 @GraphQLName("itemVolumeTypeName") final String itemVolumeTypeName, 10424 @GraphQLName("id") @GraphQLID final String id) { 10425 ItemVolumeType itemVolumeType; 10426 10427 try { 10428 var commandForm = ItemUtil.getHome().getGetItemVolumeTypeForm(); 10429 10430 commandForm.setItemVolumeTypeName(itemVolumeTypeName); 10431 commandForm.setUuid(id); 10432 10433 itemVolumeType = CDI.current().select(GetItemVolumeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10434 } catch (NamingException ex) { 10435 throw new RuntimeException(ex); 10436 } 10437 10438 return itemVolumeType == null ? null : new ItemVolumeTypeObject(itemVolumeType); 10439 } 10440 10441 @GraphQLField 10442 @GraphQLName("itemVolumeTypes") 10443 @GraphQLNonNull 10444 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10445 static CountingPaginatedData<ItemVolumeTypeObject> itemVolumeTypes(final DataFetchingEnvironment env) { 10446 CountingPaginatedData<ItemVolumeTypeObject> data; 10447 10448 try { 10449 var commandForm = ItemUtil.getHome().getGetItemVolumeTypesForm(); 10450 var command = CDI.current().select(GetItemVolumeTypesCommand.class).get(); 10451 10452 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10453 if(totalEntities == null) { 10454 data = Connections.emptyConnection(); 10455 } else { 10456 try(var objectLimiter = new ObjectLimiter(env, ItemVolumeTypeConstants.COMPONENT_VENDOR_NAME, ItemVolumeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10457 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10458 10459 var itemVolumeTypes = entities.stream() 10460 .map(ItemVolumeTypeObject::new) 10461 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10462 10463 data = new CountedObjects<>(objectLimiter, itemVolumeTypes); 10464 } 10465 } 10466 } catch (NamingException ex) { 10467 throw new RuntimeException(ex); 10468 } 10469 10470 return data; 10471 } 10472 10473 @GraphQLField 10474 @GraphQLName("relatedItemType") 10475 static RelatedItemTypeObject relatedItemType(final DataFetchingEnvironment env, 10476 @GraphQLName("relatedItemTypeName") final String relatedItemTypeName, 10477 @GraphQLName("id") @GraphQLID final String id) { 10478 RelatedItemType relatedItemType; 10479 10480 try { 10481 var commandForm = ItemUtil.getHome().getGetRelatedItemTypeForm(); 10482 10483 commandForm.setRelatedItemTypeName(relatedItemTypeName); 10484 commandForm.setUuid(id); 10485 10486 relatedItemType = CDI.current().select(GetRelatedItemTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10487 } catch (NamingException ex) { 10488 throw new RuntimeException(ex); 10489 } 10490 10491 return relatedItemType == null ? null : new RelatedItemTypeObject(relatedItemType, null); 10492 } 10493 10494 @GraphQLField 10495 @GraphQLName("relatedItemTypes") 10496 @GraphQLNonNull 10497 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10498 static CountingPaginatedData<RelatedItemTypeObject> relatedItemTypes(final DataFetchingEnvironment env) { 10499 CountingPaginatedData<RelatedItemTypeObject> data; 10500 10501 try { 10502 var commandForm = ItemUtil.getHome().getGetRelatedItemTypesForm(); 10503 var command = CDI.current().select(GetRelatedItemTypesCommand.class).get(); 10504 10505 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10506 if(totalEntities == null) { 10507 data = Connections.emptyConnection(); 10508 } else { 10509 try(var objectLimiter = new ObjectLimiter(env, RelatedItemTypeConstants.COMPONENT_VENDOR_NAME, RelatedItemTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10510 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10511 10512 var relatedItemTypes = entities.stream() 10513 .map((RelatedItemType relatedItemType) -> new RelatedItemTypeObject(relatedItemType, null)) 10514 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10515 10516 data = new CountedObjects<>(objectLimiter, relatedItemTypes); 10517 } 10518 } 10519 } catch (NamingException ex) { 10520 throw new RuntimeException(ex); 10521 } 10522 10523 return data; 10524 } 10525 10526 @GraphQLField 10527 @GraphQLName("relatedItem") 10528 static RelatedItemObject relatedItem(final DataFetchingEnvironment env, 10529 @GraphQLName("relatedItemTypeName") @GraphQLNonNull final String relatedItemTypeName, 10530 @GraphQLName("fromItemName") @GraphQLNonNull final String fromItemName, 10531 @GraphQLName("toItemName") @GraphQLNonNull final String toItemName) { 10532 RelatedItem relatedItem; 10533 10534 try { 10535 var commandForm = ItemUtil.getHome().getGetRelatedItemForm(); 10536 10537 commandForm.setRelatedItemTypeName(relatedItemTypeName); 10538 commandForm.setFromItemName(fromItemName); 10539 commandForm.setToItemName(toItemName); 10540 10541 relatedItem = CDI.current().select(GetRelatedItemCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10542 } catch (NamingException ex) { 10543 throw new RuntimeException(ex); 10544 } 10545 10546 return relatedItem == null ? null : new RelatedItemObject(relatedItem); 10547 } 10548 10549 @GraphQLField 10550 @GraphQLName("relatedItems") 10551 @GraphQLNonNull 10552 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10553 static CountingPaginatedData<RelatedItemObject> relatedItems(final DataFetchingEnvironment env, 10554 @GraphQLName("relatedItemTypeName") final String relatedItemTypeName, 10555 @GraphQLName("fromItemName") final String fromItemName, 10556 @GraphQLName("toItemName") final String toItemName) { 10557 CountingPaginatedData<RelatedItemObject> data; 10558 10559 try { 10560 var commandForm = ItemUtil.getHome().getGetRelatedItemsForm(); 10561 var command = CDI.current().select(GetRelatedItemsCommand.class).get(); 10562 10563 commandForm.setRelatedItemTypeName(relatedItemTypeName); 10564 commandForm.setFromItemName(fromItemName); 10565 commandForm.setToItemName(toItemName); 10566 10567 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10568 if(totalEntities == null) { 10569 data = Connections.emptyConnection(); 10570 } else { 10571 try(var objectLimiter = new ObjectLimiter(env, RelatedItemConstants.COMPONENT_VENDOR_NAME, RelatedItemConstants.ENTITY_TYPE_NAME, totalEntities)) { 10572 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10573 10574 var relatedItemObjects = entities.stream() 10575 .map(RelatedItemObject::new) 10576 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10577 10578 data = new CountedObjects<>(objectLimiter, relatedItemObjects); 10579 } 10580 } 10581 } catch (NamingException ex) { 10582 throw new RuntimeException(ex); 10583 } 10584 10585 return data; 10586 } 10587 10588 @GraphQLField 10589 @GraphQLName("orderType") 10590 static OrderTypeObject orderType(final DataFetchingEnvironment env, 10591 @GraphQLName("orderTypeName") final String orderTypeName, 10592 @GraphQLName("id") @GraphQLID final String id) { 10593 OrderType orderType; 10594 10595 try { 10596 var commandForm = OrderUtil.getHome().getGetOrderTypeForm(); 10597 10598 commandForm.setOrderTypeName(orderTypeName); 10599 commandForm.setUuid(id); 10600 10601 orderType = CDI.current().select(GetOrderTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10602 } catch (NamingException ex) { 10603 throw new RuntimeException(ex); 10604 } 10605 10606 return orderType == null ? null : new OrderTypeObject(orderType); 10607 } 10608 10609 @GraphQLField 10610 @GraphQLName("orderTypes") 10611 @GraphQLNonNull 10612 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10613 static CountingPaginatedData<OrderTypeObject> orderTypes(final DataFetchingEnvironment env) { 10614 CountingPaginatedData<OrderTypeObject> data; 10615 10616 try { 10617 var commandForm = OrderUtil.getHome().getGetOrderTypesForm(); 10618 var command = CDI.current().select(GetOrderTypesCommand.class).get(); 10619 10620 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10621 if(totalEntities == null) { 10622 data = Connections.emptyConnection(); 10623 } else { 10624 try(var objectLimiter = new ObjectLimiter(env, OrderTypeConstants.COMPONENT_VENDOR_NAME, OrderTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10625 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10626 10627 var orderTypes = entities.stream() 10628 .map(OrderTypeObject::new) 10629 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10630 10631 data = new CountedObjects<>(objectLimiter, orderTypes); 10632 } 10633 } 10634 } catch (NamingException ex) { 10635 throw new RuntimeException(ex); 10636 } 10637 10638 return data; 10639 } 10640 10641 @GraphQLField 10642 @GraphQLName("orderPriority") 10643 static OrderPriorityObject orderPriority(final DataFetchingEnvironment env, 10644 @GraphQLName("orderTypeName") final String orderTypeName, 10645 @GraphQLName("orderPriorityName") final String orderPriorityName, 10646 @GraphQLName("id") @GraphQLID final String id) { 10647 OrderPriority orderPriority; 10648 10649 try { 10650 var commandForm = OrderUtil.getHome().getGetOrderPriorityForm(); 10651 10652 commandForm.setOrderTypeName(orderTypeName); 10653 commandForm.setOrderPriorityName(orderPriorityName); 10654 commandForm.setUuid(id); 10655 10656 orderPriority = CDI.current().select(GetOrderPriorityCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10657 } catch (NamingException ex) { 10658 throw new RuntimeException(ex); 10659 } 10660 10661 return orderPriority == null ? null : new OrderPriorityObject(orderPriority); 10662 } 10663 10664 @GraphQLField 10665 @GraphQLName("orderPriorities") 10666 @GraphQLNonNull 10667 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10668 static CountingPaginatedData<OrderPriorityObject> orderPriorities(final DataFetchingEnvironment env, 10669 @GraphQLName("orderTypeName") final String orderTypeName) { 10670 CountingPaginatedData<OrderPriorityObject> data; 10671 10672 try { 10673 var commandForm = OrderUtil.getHome().getGetOrderPrioritiesForm(); 10674 var command = CDI.current().select(GetOrderPrioritiesCommand.class).get(); 10675 10676 commandForm.setOrderTypeName(orderTypeName); 10677 10678 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10679 if(totalEntities == null) { 10680 data = Connections.emptyConnection(); 10681 } else { 10682 try(var objectLimiter = new ObjectLimiter(env, OrderPriorityConstants.COMPONENT_VENDOR_NAME, OrderPriorityConstants.ENTITY_TYPE_NAME, totalEntities)) { 10683 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10684 10685 var orderPriorities = entities.stream() 10686 .map(OrderPriorityObject::new) 10687 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10688 10689 data = new CountedObjects<>(objectLimiter, orderPriorities); 10690 } 10691 } 10692 } catch (NamingException ex) { 10693 throw new RuntimeException(ex); 10694 } 10695 10696 return data; 10697 } 10698 10699 @GraphQLField 10700 @GraphQLName("orderTimeType") 10701 static OrderTimeTypeObject orderTimeType(final DataFetchingEnvironment env, 10702 @GraphQLName("orderTypeName") final String orderTypeName, 10703 @GraphQLName("orderTimeTypeName") final String orderTimeTypeName, 10704 @GraphQLName("id") @GraphQLID final String id) { 10705 OrderTimeType orderTimeType; 10706 10707 try { 10708 var commandForm = OrderUtil.getHome().getGetOrderTimeTypeForm(); 10709 10710 commandForm.setOrderTypeName(orderTypeName); 10711 commandForm.setOrderTimeTypeName(orderTimeTypeName); 10712 commandForm.setUuid(id); 10713 10714 orderTimeType = CDI.current().select(GetOrderTimeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10715 } catch (NamingException ex) { 10716 throw new RuntimeException(ex); 10717 } 10718 10719 return orderTimeType == null ? null : new OrderTimeTypeObject(orderTimeType); 10720 } 10721 10722 @GraphQLField 10723 @GraphQLName("orderTimeTypes") 10724 @GraphQLNonNull 10725 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10726 static CountingPaginatedData<OrderTimeTypeObject> orderTimeTypes(final DataFetchingEnvironment env, 10727 @GraphQLName("orderTypeName") final String orderTypeName) { 10728 CountingPaginatedData<OrderTimeTypeObject> data; 10729 10730 try { 10731 var commandForm = OrderUtil.getHome().getGetOrderTimeTypesForm(); 10732 var command = CDI.current().select(GetOrderTimeTypesCommand.class).get(); 10733 10734 commandForm.setOrderTypeName(orderTypeName); 10735 10736 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10737 if(totalEntities == null) { 10738 data = Connections.emptyConnection(); 10739 } else { 10740 try(var objectLimiter = new ObjectLimiter(env, OrderTimeTypeConstants.COMPONENT_VENDOR_NAME, OrderTimeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10741 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10742 10743 var orderTimeTypes = entities.stream() 10744 .map(OrderTimeTypeObject::new) 10745 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10746 10747 data = new CountedObjects<>(objectLimiter, orderTimeTypes); 10748 } 10749 } 10750 } catch (NamingException ex) { 10751 throw new RuntimeException(ex); 10752 } 10753 10754 return data; 10755 } 10756 10757 @GraphQLField 10758 @GraphQLName("wishlistType") 10759 static WishlistTypeObject wishlistType(final DataFetchingEnvironment env, 10760 @GraphQLName("wishlistTypeName") final String wishlistTypeName, 10761 @GraphQLName("id") @GraphQLID final String id) { 10762 WishlistType wishlistType; 10763 10764 try { 10765 var commandForm = WishlistUtil.getHome().getGetWishlistTypeForm(); 10766 10767 commandForm.setWishlistTypeName(wishlistTypeName); 10768 commandForm.setUuid(id); 10769 10770 wishlistType = CDI.current().select(GetWishlistTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10771 } catch (NamingException ex) { 10772 throw new RuntimeException(ex); 10773 } 10774 10775 return wishlistType == null ? null : new WishlistTypeObject(wishlistType); 10776 } 10777 10778 @GraphQLField 10779 @GraphQLName("wishlistTypes") 10780 @GraphQLNonNull 10781 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10782 static CountingPaginatedData<WishlistTypeObject> wishlistTypes(final DataFetchingEnvironment env) { 10783 CountingPaginatedData<WishlistTypeObject> data; 10784 10785 try { 10786 var commandForm = WishlistUtil.getHome().getGetWishlistTypesForm(); 10787 var command = CDI.current().select(GetWishlistTypesCommand.class).get(); 10788 10789 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10790 if(totalEntities == null) { 10791 data = Connections.emptyConnection(); 10792 } else { 10793 try(var objectLimiter = new ObjectLimiter(env, WishlistTypeConstants.COMPONENT_VENDOR_NAME, WishlistTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10794 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10795 10796 var wishlistTypes = entities.stream() 10797 .map(WishlistTypeObject::new) 10798 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10799 10800 data = new CountedObjects<>(objectLimiter, wishlistTypes); 10801 } 10802 } 10803 } catch (NamingException ex) { 10804 throw new RuntimeException(ex); 10805 } 10806 10807 return data; 10808 } 10809 10810 @GraphQLField 10811 @GraphQLName("wishlistPriority") 10812 static WishlistPriorityObject wishlistPriority(final DataFetchingEnvironment env, 10813 @GraphQLName("wishlistTypeName") final String wishlistTypeName, 10814 @GraphQLName("wishlistPriorityName") final String wishlistPriorityName, 10815 @GraphQLName("id") @GraphQLID final String id) { 10816 WishlistPriority wishlistPriority; 10817 10818 try { 10819 var commandForm = WishlistUtil.getHome().getGetWishlistPriorityForm(); 10820 10821 commandForm.setWishlistTypeName(wishlistTypeName); 10822 commandForm.setWishlistPriorityName(wishlistPriorityName); 10823 commandForm.setUuid(id); 10824 10825 wishlistPriority = CDI.current().select(GetWishlistPriorityCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10826 } catch (NamingException ex) { 10827 throw new RuntimeException(ex); 10828 } 10829 10830 return wishlistPriority == null ? null : new WishlistPriorityObject(wishlistPriority); 10831 } 10832 10833 @GraphQLField 10834 @GraphQLName("wishlistPriorities") 10835 @GraphQLNonNull 10836 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10837 static CountingPaginatedData<WishlistPriorityObject> wishlistPriorities(final DataFetchingEnvironment env, 10838 @GraphQLName("wishlistTypeName") @GraphQLNonNull final String wishlistTypeName) { 10839 CountingPaginatedData<WishlistPriorityObject> data; 10840 10841 try { 10842 var commandForm = WishlistUtil.getHome().getGetWishlistPrioritiesForm(); 10843 var command = CDI.current().select(GetWishlistPrioritiesCommand.class).get(); 10844 10845 commandForm.setWishlistTypeName(wishlistTypeName); 10846 10847 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10848 if(totalEntities == null) { 10849 data = Connections.emptyConnection(); 10850 } else { 10851 try(var objectLimiter = new ObjectLimiter(env, WishlistPriorityConstants.COMPONENT_VENDOR_NAME, WishlistPriorityConstants.ENTITY_TYPE_NAME, totalEntities)) { 10852 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10853 10854 var wishlistPriorities = entities.stream() 10855 .map(WishlistPriorityObject::new) 10856 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10857 10858 data = new CountedObjects<>(objectLimiter, wishlistPriorities); 10859 } 10860 } 10861 } catch (NamingException ex) { 10862 throw new RuntimeException(ex); 10863 } 10864 10865 return data; 10866 } 10867 10868 @GraphQLField 10869 @GraphQLName("termType") 10870 static TermTypeObject termType(final DataFetchingEnvironment env, 10871 @GraphQLName("termTypeName") final String termTypeName, 10872 @GraphQLName("id") @GraphQLID final String id) { 10873 TermType termType; 10874 10875 try { 10876 var commandForm = TermUtil.getHome().getGetTermTypeForm(); 10877 10878 commandForm.setTermTypeName(termTypeName); 10879 commandForm.setUuid(id); 10880 10881 termType = CDI.current().select(GetTermTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10882 } catch (NamingException ex) { 10883 throw new RuntimeException(ex); 10884 } 10885 10886 return termType == null ? null : new TermTypeObject(termType); 10887 } 10888 10889 @GraphQLField 10890 @GraphQLName("termTypes") 10891 @GraphQLNonNull 10892 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10893 static CountingPaginatedData<TermTypeObject> termTypes(final DataFetchingEnvironment env) { 10894 CountingPaginatedData<TermTypeObject> data; 10895 10896 try { 10897 var commandForm = TermUtil.getHome().getGetTermTypesForm(); 10898 var command = CDI.current().select(GetTermTypesCommand.class).get(); 10899 10900 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10901 if(totalEntities == null) { 10902 data = Connections.emptyConnection(); 10903 } else { 10904 try(var objectLimiter = new ObjectLimiter(env, TermTypeConstants.COMPONENT_VENDOR_NAME, TermTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 10905 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10906 10907 var termTypes = entities.stream() 10908 .map(TermTypeObject::new) 10909 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10910 10911 data = new CountedObjects<>(objectLimiter, termTypes); 10912 } 10913 } 10914 } catch (NamingException ex) { 10915 throw new RuntimeException(ex); 10916 } 10917 10918 return data; 10919 } 10920 10921 @GraphQLField 10922 @GraphQLName("term") 10923 static TermObject term(final DataFetchingEnvironment env, 10924 @GraphQLName("termName") final String termName, 10925 @GraphQLName("id") @GraphQLID final String id) { 10926 Term term; 10927 10928 try { 10929 var commandForm = TermUtil.getHome().getGetTermForm(); 10930 10931 commandForm.setTermName(termName); 10932 commandForm.setUuid(id); 10933 10934 term = CDI.current().select(GetTermCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10935 } catch (NamingException ex) { 10936 throw new RuntimeException(ex); 10937 } 10938 10939 return term == null ? null : new TermObject(term); 10940 } 10941 10942 @GraphQLField 10943 @GraphQLName("terms") 10944 @GraphQLNonNull 10945 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10946 static CountingPaginatedData<TermObject> terms(final DataFetchingEnvironment env) { 10947 CountingPaginatedData<TermObject> data; 10948 10949 try { 10950 var commandForm = TermUtil.getHome().getGetTermsForm(); 10951 var command = CDI.current().select(GetTermsCommand.class).get(); 10952 10953 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10954 if(totalEntities == null) { 10955 data = Connections.emptyConnection(); 10956 } else { 10957 try(var objectLimiter = new ObjectLimiter(env, TermConstants.COMPONENT_VENDOR_NAME, TermConstants.ENTITY_TYPE_NAME, totalEntities)) { 10958 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 10959 10960 var terms = entities.stream() 10961 .map(TermObject::new) 10962 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 10963 10964 data = new CountedObjects<>(objectLimiter, terms); 10965 } 10966 } 10967 } catch (NamingException ex) { 10968 throw new RuntimeException(ex); 10969 } 10970 10971 return data; 10972 } 10973 10974 @GraphQLField 10975 @GraphQLName("securityRoleGroup") 10976 static SecurityRoleGroupObject securityRoleGroup(final DataFetchingEnvironment env, 10977 @GraphQLName("securityRoleGroupName") final String securityRoleGroupName, 10978 @GraphQLName("id") @GraphQLID final String id) { 10979 SecurityRoleGroup securityRoleGroup; 10980 10981 try { 10982 var commandForm = SecurityUtil.getHome().getGetSecurityRoleGroupForm(); 10983 10984 commandForm.setSecurityRoleGroupName(securityRoleGroupName); 10985 commandForm.setUuid(id); 10986 10987 securityRoleGroup = CDI.current().select(GetSecurityRoleGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 10988 } catch (NamingException ex) { 10989 throw new RuntimeException(ex); 10990 } 10991 10992 return securityRoleGroup == null ? null : new SecurityRoleGroupObject(securityRoleGroup); 10993 } 10994 10995 @GraphQLField 10996 @GraphQLName("securityRoleGroups") 10997 @GraphQLNonNull 10998 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 10999 static CountingPaginatedData<SecurityRoleGroupObject> securityRoleGroups(final DataFetchingEnvironment env, 11000 @GraphQLName("parentSecurityRoleGroupName") final String parentSecurityRoleGroupName) { 11001 CountingPaginatedData<SecurityRoleGroupObject> data; 11002 11003 try { 11004 var commandForm = SecurityUtil.getHome().getGetSecurityRoleGroupsForm(); 11005 var command = CDI.current().select(GetSecurityRoleGroupsCommand.class).get(); 11006 11007 commandForm.setParentSecurityRoleGroupName(parentSecurityRoleGroupName); 11008 11009 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11010 if(totalEntities == null) { 11011 data = Connections.emptyConnection(); 11012 } else { 11013 try(var objectLimiter = new ObjectLimiter(env, SecurityRoleGroupConstants.COMPONENT_VENDOR_NAME, SecurityRoleGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 11014 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11015 11016 var securityRoleGroups = entities.stream() 11017 .map(SecurityRoleGroupObject::new) 11018 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11019 11020 data = new CountedObjects<>(objectLimiter, securityRoleGroups); 11021 } 11022 } 11023 } catch (NamingException ex) { 11024 throw new RuntimeException(ex); 11025 } 11026 11027 return data; 11028 } 11029 11030 @GraphQLField 11031 @GraphQLName("securityRole") 11032 static SecurityRoleObject securityRole(final DataFetchingEnvironment env, 11033 @GraphQLName("securityRoleGroupName") final String securityRoleGroupName, 11034 @GraphQLName("securityRoleName") final String securityRoleName, 11035 @GraphQLName("id") @GraphQLID final String id) { 11036 SecurityRole securityRole; 11037 11038 try { 11039 var commandForm = SecurityUtil.getHome().getGetSecurityRoleForm(); 11040 11041 commandForm.setSecurityRoleGroupName(securityRoleGroupName); 11042 commandForm.setSecurityRoleName(securityRoleName); 11043 commandForm.setUuid(id); 11044 11045 securityRole = CDI.current().select(GetSecurityRoleCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11046 } catch (NamingException ex) { 11047 throw new RuntimeException(ex); 11048 } 11049 11050 return securityRole == null ? null : new SecurityRoleObject(securityRole); 11051 } 11052 11053 @GraphQLField 11054 @GraphQLName("securityRoles") 11055 @GraphQLNonNull 11056 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11057 static CountingPaginatedData<SecurityRoleObject> securityRoles(final DataFetchingEnvironment env, 11058 @GraphQLName("securityRoleGroupName") @GraphQLNonNull final String securityRoleGroupName) { 11059 CountingPaginatedData<SecurityRoleObject> data; 11060 11061 try { 11062 var commandForm = SecurityUtil.getHome().getGetSecurityRolesForm(); 11063 var command = CDI.current().select(GetSecurityRolesCommand.class).get(); 11064 11065 commandForm.setSecurityRoleGroupName(securityRoleGroupName); 11066 11067 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11068 if(totalEntities == null) { 11069 data = Connections.emptyConnection(); 11070 } else { 11071 try(var objectLimiter = new ObjectLimiter(env, SecurityRoleConstants.COMPONENT_VENDOR_NAME, SecurityRoleConstants.ENTITY_TYPE_NAME, totalEntities)) { 11072 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11073 11074 var securityRoles = entities.stream() 11075 .map(SecurityRoleObject::new) 11076 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11077 11078 data = new CountedObjects<>(objectLimiter, securityRoles); 11079 } 11080 } 11081 } catch (NamingException ex) { 11082 throw new RuntimeException(ex); 11083 } 11084 11085 return data; 11086 } 11087 11088 @GraphQLField 11089 @GraphQLName("personalTitles") 11090 @GraphQLNonNull 11091 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11092 static CountingPaginatedData<PersonalTitleObject> personalTitles(final DataFetchingEnvironment env) { 11093 CountingPaginatedData<PersonalTitleObject> data; 11094 11095 try { 11096 var commandForm = PartyUtil.getHome().getGetPersonalTitlesForm(); 11097 var command = CDI.current().select(GetPersonalTitlesCommand.class).get(); 11098 11099 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11100 if(totalEntities == null) { 11101 data = Connections.emptyConnection(); 11102 } else { 11103 try(var objectLimiter = new ObjectLimiter(env, PersonalTitleConstants.COMPONENT_VENDOR_NAME, PersonalTitleConstants.ENTITY_TYPE_NAME, totalEntities)) { 11104 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11105 11106 var personalTitles = entities.stream() 11107 .map(PersonalTitleObject::new) 11108 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11109 11110 data = new CountedObjects<>(objectLimiter, personalTitles); 11111 } 11112 } 11113 } catch (NamingException ex) { 11114 throw new RuntimeException(ex); 11115 } 11116 11117 return data; 11118 } 11119 11120 @GraphQLField 11121 @GraphQLName("nameSuffixes") 11122 @GraphQLNonNull 11123 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11124 static CountingPaginatedData<NameSuffixObject> nameSuffixes(final DataFetchingEnvironment env) { 11125 CountingPaginatedData<NameSuffixObject> data; 11126 11127 try { 11128 var commandForm = PartyUtil.getHome().getGetNameSuffixesForm(); 11129 var command = CDI.current().select(GetNameSuffixesCommand.class).get(); 11130 11131 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11132 if(totalEntities == null) { 11133 data = Connections.emptyConnection(); 11134 } else { 11135 try(var objectLimiter = new ObjectLimiter(env, NameSuffixConstants.COMPONENT_VENDOR_NAME, NameSuffixConstants.ENTITY_TYPE_NAME, totalEntities)) { 11136 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11137 11138 var nameSuffixes = entities.stream() 11139 .map(NameSuffixObject::new) 11140 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11141 11142 data = new CountedObjects<>(objectLimiter, nameSuffixes); 11143 } 11144 } 11145 } catch (NamingException ex) { 11146 throw new RuntimeException(ex); 11147 } 11148 11149 return data; 11150 } 11151 11152 @GraphQLField 11153 @GraphQLName("tagScope") 11154 static TagScopeObject tagScope(final DataFetchingEnvironment env, 11155 @GraphQLName("tagScopeName") final String tagScopeName, 11156 @GraphQLName("id") @GraphQLID final String id) { 11157 TagScope tagScope; 11158 11159 try { 11160 var commandForm = TagUtil.getHome().getGetTagScopeForm(); 11161 11162 commandForm.setTagScopeName(tagScopeName); 11163 commandForm.setUuid(id); 11164 11165 tagScope = CDI.current().select(GetTagScopeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11166 } catch (NamingException ex) { 11167 throw new RuntimeException(ex); 11168 } 11169 11170 return tagScope == null ? null : new TagScopeObject(tagScope, null); 11171 } 11172 11173 @GraphQLField 11174 @GraphQLName("tagScopes") 11175 @GraphQLNonNull 11176 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11177 static CountingPaginatedData<TagScopeObject> tagScopes(final DataFetchingEnvironment env) { 11178 CountingPaginatedData<TagScopeObject> data; 11179 11180 try { 11181 var commandForm = TagUtil.getHome().getGetTagScopesForm(); 11182 var command = CDI.current().select(GetTagScopesCommand.class).get(); 11183 11184 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11185 if(totalEntities == null) { 11186 data = Connections.emptyConnection(); 11187 } else { 11188 try(var objectLimiter = new ObjectLimiter(env, TagScopeConstants.COMPONENT_VENDOR_NAME, TagScopeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11189 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11190 11191 var tagScopes = entities.stream() 11192 .map(TagScopeObject::new) 11193 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11194 11195 data = new CountedObjects<>(objectLimiter, tagScopes); 11196 } 11197 } 11198 } catch (NamingException ex) { 11199 throw new RuntimeException(ex); 11200 } 11201 11202 return data; 11203 } 11204 11205 @GraphQLField 11206 @GraphQLName("tagScopeEntityType") 11207 static TagScopeEntityTypeObject tagScopeEntityType(final DataFetchingEnvironment env, 11208 @GraphQLName("tagScopeName") @GraphQLNonNull final String tagScopeName, 11209 @GraphQLName("componentVendorName") @GraphQLNonNull final String componentVendorName, 11210 @GraphQLName("entityTypeName") @GraphQLNonNull final String entityTypeName) { 11211 TagScopeEntityType tagScopeEntityType; 11212 11213 try { 11214 var commandForm = TagUtil.getHome().getGetTagScopeEntityTypeForm(); 11215 11216 commandForm.setTagScopeName(tagScopeName); 11217 commandForm.setComponentVendorName(componentVendorName); 11218 commandForm.setEntityTypeName(entityTypeName); 11219 11220 tagScopeEntityType = CDI.current().select(GetTagScopeEntityTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11221 } catch (NamingException ex) { 11222 throw new RuntimeException(ex); 11223 } 11224 11225 return tagScopeEntityType == null ? null : new TagScopeEntityTypeObject(tagScopeEntityType); 11226 } 11227 11228 @GraphQLField 11229 @GraphQLName("tagScopeEntityTypes") 11230 static Collection<TagScopeEntityTypeObject> tagScopeEntityTypes(final DataFetchingEnvironment env, 11231 @GraphQLName("tagScopeName") final String tagScopeName, 11232 @GraphQLName("componentVendorName") final String componentVendorName, 11233 @GraphQLName("entityTypeName") final String entityTypeName) { 11234 Collection<TagScopeEntityType> tagScopeEntityTypes; 11235 Collection<TagScopeEntityTypeObject> tagScopeEntityTypeObjects; 11236 11237 try { 11238 var commandForm = TagUtil.getHome().getGetTagScopeEntityTypesForm(); 11239 11240 commandForm.setTagScopeName(tagScopeName); 11241 commandForm.setComponentVendorName(componentVendorName); 11242 commandForm.setEntityTypeName(entityTypeName); 11243 11244 tagScopeEntityTypes = CDI.current().select(GetTagScopeEntityTypesCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11245 } catch (NamingException ex) { 11246 throw new RuntimeException(ex); 11247 } 11248 11249 if(tagScopeEntityTypes == null) { 11250 tagScopeEntityTypeObjects = emptyList(); 11251 } else { 11252 tagScopeEntityTypeObjects = new ArrayList<>(tagScopeEntityTypes.size()); 11253 11254 tagScopeEntityTypes.stream().map(TagScopeEntityTypeObject::new).forEachOrdered(tagScopeEntityTypeObjects::add); 11255 } 11256 11257 return tagScopeEntityTypeObjects; 11258 } 11259 11260 @GraphQLField 11261 @GraphQLName("tag") 11262 static TagObject tag(final DataFetchingEnvironment env, 11263 @GraphQLName("tagScopeName") final String tagScopeName, 11264 @GraphQLName("tagName") final String tagName, 11265 @GraphQLName("id") @GraphQLID final String id) { 11266 Tag tag; 11267 11268 try { 11269 var commandForm = TagUtil.getHome().getGetTagForm(); 11270 11271 commandForm.setTagScopeName(tagScopeName); 11272 commandForm.setTagName(tagName); 11273 commandForm.setUuid(id); 11274 11275 tag = CDI.current().select(GetTagCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11276 } catch (NamingException ex) { 11277 throw new RuntimeException(ex); 11278 } 11279 11280 return tag == null ? null : new TagObject(tag); 11281 } 11282 11283 @GraphQLField 11284 @GraphQLName("tags") 11285 @GraphQLNonNull 11286 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11287 static CountingPaginatedData<TagObject> tags(final DataFetchingEnvironment env, 11288 @GraphQLName("tagScopeName") @GraphQLNonNull final String tagScopeName) { 11289 CountingPaginatedData<TagObject> data; 11290 11291 try { 11292 var commandForm = TagUtil.getHome().getGetTagsForm(); 11293 var command = CDI.current().select(GetTagsCommand.class).get(); 11294 11295 commandForm.setTagScopeName(tagScopeName); 11296 11297 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11298 if(totalEntities == null) { 11299 data = Connections.emptyConnection(); 11300 } else { 11301 try(var objectLimiter = new ObjectLimiter(env, TagConstants.COMPONENT_VENDOR_NAME, TagConstants.ENTITY_TYPE_NAME, totalEntities)) { 11302 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11303 11304 var tagObjects = entities.stream() 11305 .map(TagObject::new) 11306 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11307 11308 data = new CountedObjects<>(objectLimiter, tagObjects); 11309 } 11310 } 11311 } catch (NamingException ex) { 11312 throw new RuntimeException(ex); 11313 } 11314 11315 return data; 11316 } 11317 11318 @GraphQLField 11319 @GraphQLName("entityTag") 11320 static EntityTagObject entityTag(final DataFetchingEnvironment env, 11321 @GraphQLName("id") @GraphQLNonNull final String id, 11322 @GraphQLName("tagScopeName") @GraphQLNonNull final String tagScopeName, 11323 @GraphQLName("tagName") @GraphQLNonNull final String tagName) { 11324 EntityTag entityTag; 11325 11326 try { 11327 var commandForm = TagUtil.getHome().getGetEntityTagForm(); 11328 11329 commandForm.setUuid(id); 11330 commandForm.setTagScopeName(tagScopeName); 11331 commandForm.setTagName(tagName); 11332 11333 entityTag = CDI.current().select(GetEntityTagCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11334 } catch (NamingException ex) { 11335 throw new RuntimeException(ex); 11336 } 11337 11338 return entityTag == null ? null : new EntityTagObject(entityTag); 11339 } 11340 11341 @GraphQLField 11342 @GraphQLName("entityTags") 11343 static Collection<EntityTagObject> entityTags(final DataFetchingEnvironment env, 11344 @GraphQLName("id") final String id, 11345 @GraphQLName("tagScopeName") final String tagScopeName, 11346 @GraphQLName("tagName") final String tagName) { 11347 Collection<EntityTag> entityTags; 11348 Collection<EntityTagObject> entityTagObjects; 11349 11350 try { 11351 var commandForm = TagUtil.getHome().getGetEntityTagsForm(); 11352 11353 commandForm.setUuid(id); 11354 commandForm.setTagScopeName(tagScopeName); 11355 commandForm.setTagName(tagName); 11356 11357 entityTags = CDI.current().select(GetEntityTagsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11358 } catch (NamingException ex) { 11359 throw new RuntimeException(ex); 11360 } 11361 11362 if(entityTags == null) { 11363 entityTagObjects = emptyList(); 11364 } else { 11365 entityTagObjects = new ArrayList<>(entityTags.size()); 11366 11367 entityTags.stream().map(EntityTagObject::new).forEachOrdered(entityTagObjects::add); 11368 } 11369 11370 return entityTagObjects; 11371 } 11372 11373 @GraphQLField 11374 @GraphQLName("geoCodeType") 11375 static GeoCodeTypeObject geoCodeType(final DataFetchingEnvironment env, 11376 @GraphQLName("geoCodeTypeName") final String geoCodeTypeName, 11377 @GraphQLName("id") @GraphQLID final String id) { 11378 GeoCodeType geoCodeType; 11379 11380 try { 11381 var commandForm = GeoUtil.getHome().getGetGeoCodeTypeForm(); 11382 11383 commandForm.setGeoCodeTypeName(geoCodeTypeName); 11384 commandForm.setUuid(id); 11385 11386 geoCodeType = CDI.current().select(GetGeoCodeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11387 } catch (NamingException ex) { 11388 throw new RuntimeException(ex); 11389 } 11390 11391 return geoCodeType == null ? null : new GeoCodeTypeObject(geoCodeType); 11392 } 11393 11394 @GraphQLField 11395 @GraphQLName("geoCodeTypes") 11396 @GraphQLNonNull 11397 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11398 static CountingPaginatedData<GeoCodeTypeObject> geoCodeTypes(final DataFetchingEnvironment env) { 11399 CountingPaginatedData<GeoCodeTypeObject> data; 11400 11401 try { 11402 var commandForm = GeoUtil.getHome().getGetGeoCodeTypesForm(); 11403 var command = CDI.current().select(GetGeoCodeTypesCommand.class).get(); 11404 11405 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11406 if(totalEntities == null) { 11407 data = Connections.emptyConnection(); 11408 } else { 11409 try(var objectLimiter = new ObjectLimiter(env, GeoCodeTypeConstants.COMPONENT_VENDOR_NAME, GeoCodeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11410 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11411 11412 var geoCodeTypes = entities.stream() 11413 .map(GeoCodeTypeObject::new) 11414 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11415 11416 data = new CountedObjects<>(objectLimiter, geoCodeTypes); 11417 } 11418 } 11419 } catch (NamingException ex) { 11420 throw new RuntimeException(ex); 11421 } 11422 11423 return data; 11424 } 11425 11426 @GraphQLField 11427 @GraphQLName("geoCodeAliasType") 11428 static GeoCodeAliasTypeObject geoCodeAliasType(final DataFetchingEnvironment env, 11429 @GraphQLName("geoCodeTypeName") @GraphQLNonNull final String geoCodeTypeName, 11430 @GraphQLName("geoCodeAliasTypeName") @GraphQLNonNull final String geoCodeAliasTypeName) { 11431 GeoCodeAliasType geoCodeAliasType; 11432 11433 try { 11434 var commandForm = GeoUtil.getHome().getGetGeoCodeAliasTypeForm(); 11435 11436 commandForm.setGeoCodeTypeName(geoCodeTypeName); 11437 commandForm.setGeoCodeAliasTypeName(geoCodeAliasTypeName); 11438 11439 geoCodeAliasType = CDI.current().select(GetGeoCodeAliasTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11440 } catch (NamingException ex) { 11441 throw new RuntimeException(ex); 11442 } 11443 11444 return geoCodeAliasType == null ? null : new GeoCodeAliasTypeObject(geoCodeAliasType); 11445 } 11446 11447 @GraphQLField 11448 @GraphQLName("geoCodeAliasTypes") 11449 @GraphQLNonNull 11450 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11451 static CountingPaginatedData<GeoCodeAliasTypeObject> geoCodeAliasTypes(final DataFetchingEnvironment env, 11452 @GraphQLName("geoCodeTypeName") @GraphQLNonNull final String geoCodeTypeName) { 11453 CountingPaginatedData<GeoCodeAliasTypeObject> data; 11454 11455 try { 11456 var commandForm = GeoUtil.getHome().getGetGeoCodeAliasTypesForm(); 11457 var command = CDI.current().select(GetGeoCodeAliasTypesCommand.class).get(); 11458 11459 commandForm.setGeoCodeTypeName(geoCodeTypeName); 11460 11461 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11462 if(totalEntities == null) { 11463 data = Connections.emptyConnection(); 11464 } else { 11465 try(var objectLimiter = new ObjectLimiter(env, GeoCodeAliasTypeConstants.COMPONENT_VENDOR_NAME, GeoCodeAliasTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11466 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11467 11468 var geoCodeAliasTypes = entities.stream() 11469 .map(GeoCodeAliasTypeObject::new) 11470 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11471 11472 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 11473 } 11474 } 11475 } catch (NamingException ex) { 11476 throw new RuntimeException(ex); 11477 } 11478 11479 return data; 11480 } 11481 11482 @GraphQLField 11483 @GraphQLName("geoCodeScope") 11484 static GeoCodeScopeObject geoCodeScope(final DataFetchingEnvironment env, 11485 @GraphQLName("geoCodeScopeName") final String geoCodeScopeName, 11486 @GraphQLName("id") @GraphQLID final String id) { 11487 GeoCodeScope geoCodeScope; 11488 11489 try { 11490 var commandForm = GeoUtil.getHome().getGetGeoCodeScopeForm(); 11491 11492 commandForm.setGeoCodeScopeName(geoCodeScopeName); 11493 commandForm.setUuid(id); 11494 11495 geoCodeScope = CDI.current().select(GetGeoCodeScopeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11496 } catch (NamingException ex) { 11497 throw new RuntimeException(ex); 11498 } 11499 11500 return geoCodeScope == null ? null : new GeoCodeScopeObject(geoCodeScope); 11501 } 11502 11503 @GraphQLField 11504 @GraphQLName("geoCodeScopes") 11505 @GraphQLNonNull 11506 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11507 static CountingPaginatedData<GeoCodeScopeObject> geoCodeScopes(final DataFetchingEnvironment env) { 11508 CountingPaginatedData<GeoCodeScopeObject> data; 11509 11510 try { 11511 var commandForm = GeoUtil.getHome().getGetGeoCodeScopesForm(); 11512 var command = CDI.current().select(GetGeoCodeScopesCommand.class).get(); 11513 11514 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11515 if(totalEntities == null) { 11516 data = Connections.emptyConnection(); 11517 } else { 11518 try(var objectLimiter = new ObjectLimiter(env, GeoCodeScopeConstants.COMPONENT_VENDOR_NAME, GeoCodeScopeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11519 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11520 11521 var geoCodeScopes = entities.stream() 11522 .map(GeoCodeScopeObject::new) 11523 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11524 11525 data = new CountedObjects<>(objectLimiter, geoCodeScopes); 11526 } 11527 } 11528 } catch (NamingException ex) { 11529 throw new RuntimeException(ex); 11530 } 11531 11532 return data; 11533 } 11534 11535 @GraphQLField 11536 @GraphQLName("geoCode") 11537 static GeoCodeObject geoCode(final DataFetchingEnvironment env, 11538 @GraphQLName("geoCodeName") final String geoCodeName, 11539 @GraphQLName("id") @GraphQLID final String id) { 11540 GeoCode geoCode; 11541 11542 try { 11543 var commandForm = GeoUtil.getHome().getGetGeoCodeForm(); 11544 11545 commandForm.setGeoCodeName(geoCodeName); 11546 commandForm.setUuid(id); 11547 11548 geoCode = CDI.current().select(GetGeoCodeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11549 } catch (NamingException ex) { 11550 throw new RuntimeException(ex); 11551 } 11552 11553 return geoCode == null ? null : new GeoCodeObject(geoCode); 11554 } 11555 11556 @GraphQLField 11557 @GraphQLName("geoCodeAlias") 11558 static GeoCodeAliasObject geoCodeAlias(final DataFetchingEnvironment env, 11559 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName, 11560 @GraphQLName("geoCodeAliasTypeName") @GraphQLNonNull final String geoCodeAliasTypeName) { 11561 GeoCodeAlias geoCodeAlias; 11562 11563 try { 11564 var commandForm = GeoUtil.getHome().getGetGeoCodeAliasForm(); 11565 11566 commandForm.setGeoCodeName(geoCodeName); 11567 commandForm.setGeoCodeAliasTypeName(geoCodeAliasTypeName); 11568 11569 geoCodeAlias = CDI.current().select(GetGeoCodeAliasCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11570 } catch (NamingException ex) { 11571 throw new RuntimeException(ex); 11572 } 11573 11574 return geoCodeAlias == null ? null : new GeoCodeAliasObject(geoCodeAlias); 11575 } 11576 11577 @GraphQLField 11578 @GraphQLName("geoCodeAliases") 11579 @GraphQLNonNull 11580 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11581 static CountingPaginatedData<GeoCodeAliasObject> geoCodeAliases(final DataFetchingEnvironment env, 11582 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName) { 11583 CountingPaginatedData<GeoCodeAliasObject> data; 11584 11585 try { 11586 var commandForm = GeoUtil.getHome().getGetGeoCodeAliasesForm(); 11587 var command = CDI.current().select(GetGeoCodeAliasesCommand.class).get(); 11588 11589 commandForm.setGeoCodeName(geoCodeName); 11590 11591 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11592 if(totalEntities == null) { 11593 data = Connections.emptyConnection(); 11594 } else { 11595 try(var objectLimiter = new ObjectLimiter(env, GeoCodeAliasConstants.COMPONENT_VENDOR_NAME, GeoCodeAliasConstants.ENTITY_TYPE_NAME, totalEntities)) { 11596 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11597 11598 var geoCodeAliass = entities.stream() 11599 .map(GeoCodeAliasObject::new) 11600 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11601 11602 data = new CountedObjects<>(objectLimiter, geoCodeAliass); 11603 } 11604 } 11605 } catch (NamingException ex) { 11606 throw new RuntimeException(ex); 11607 } 11608 11609 return data; 11610 } 11611 11612 @GraphQLField 11613 @GraphQLName("geoCodeLanguage") 11614 static GeoCodeLanguageObject geoCodeLanguage(final DataFetchingEnvironment env, 11615 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName, 11616 @GraphQLName("languageIsoName") @GraphQLNonNull final String languageIsoName) { 11617 GeoCodeLanguage geoCodeLanguage; 11618 11619 try { 11620 var commandForm = GeoUtil.getHome().getGetGeoCodeLanguageForm(); 11621 11622 commandForm.setGeoCodeName(geoCodeName); 11623 commandForm.setLanguageIsoName(languageIsoName); 11624 11625 geoCodeLanguage = CDI.current().select(GetGeoCodeLanguageCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11626 } catch (NamingException ex) { 11627 throw new RuntimeException(ex); 11628 } 11629 11630 return geoCodeLanguage == null ? null : new GeoCodeLanguageObject(geoCodeLanguage); 11631 } 11632 11633 @GraphQLField 11634 @GraphQLName("geoCodeLanguages") 11635 @GraphQLNonNull 11636 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11637 static CountingPaginatedData<GeoCodeLanguageObject> geoCodeLanguages(final DataFetchingEnvironment env, 11638 @GraphQLName("geoCodeName") final String geoCodeName, 11639 @GraphQLName("languageIsoName") final String languageIsoName) { 11640 CountingPaginatedData<GeoCodeLanguageObject> data; 11641 11642 try { 11643 var commandForm = GeoUtil.getHome().getGetGeoCodeLanguagesForm(); 11644 var command = CDI.current().select(GetGeoCodeLanguagesCommand.class).get(); 11645 11646 commandForm.setGeoCodeName(geoCodeName); 11647 commandForm.setLanguageIsoName(languageIsoName); 11648 11649 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11650 if(totalEntities == null) { 11651 data = Connections.emptyConnection(); 11652 } else { 11653 try(var objectLimiter = new ObjectLimiter(env, GeoCodeLanguageConstants.COMPONENT_VENDOR_NAME, GeoCodeLanguageConstants.ENTITY_TYPE_NAME, totalEntities)) { 11654 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11655 11656 var transactionTypes = entities.stream() 11657 .map(GeoCodeLanguageObject::new) 11658 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11659 11660 data = new CountedObjects<>(objectLimiter, transactionTypes); 11661 } 11662 } 11663 } catch (NamingException ex) { 11664 throw new RuntimeException(ex); 11665 } 11666 11667 return data; 11668 } 11669 11670 @GraphQLField 11671 @GraphQLName("geoCodeCurrency") 11672 static GeoCodeCurrencyObject geoCodeCurrency(final DataFetchingEnvironment env, 11673 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName, 11674 @GraphQLName("currencyIsoName") @GraphQLNonNull final String currencyIsoName) { 11675 GeoCodeCurrency geoCodeCurrency; 11676 11677 try { 11678 var commandForm = GeoUtil.getHome().getGetGeoCodeCurrencyForm(); 11679 11680 commandForm.setGeoCodeName(geoCodeName); 11681 commandForm.setCurrencyIsoName(currencyIsoName); 11682 11683 geoCodeCurrency = CDI.current().select(GetGeoCodeCurrencyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11684 } catch (NamingException ex) { 11685 throw new RuntimeException(ex); 11686 } 11687 11688 return geoCodeCurrency == null ? null : new GeoCodeCurrencyObject(geoCodeCurrency); 11689 } 11690 11691 @GraphQLField 11692 @GraphQLName("geoCodeCurrencies") 11693 @GraphQLNonNull 11694 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11695 static CountingPaginatedData<GeoCodeCurrencyObject> geoCodeCurrencies(final DataFetchingEnvironment env, 11696 @GraphQLName("geoCodeName") final String geoCodeName, 11697 @GraphQLName("currencyIsoName") final String currencyIsoName) { 11698 CountingPaginatedData<GeoCodeCurrencyObject> data; 11699 11700 try { 11701 var commandForm = GeoUtil.getHome().getGetGeoCodeCurrenciesForm(); 11702 var command = CDI.current().select(GetGeoCodeCurrenciesCommand.class).get(); 11703 11704 commandForm.setGeoCodeName(geoCodeName); 11705 commandForm.setCurrencyIsoName(currencyIsoName); 11706 11707 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11708 if(totalEntities == null) { 11709 data = Connections.emptyConnection(); 11710 } else { 11711 try(var objectLimiter = new ObjectLimiter(env, GeoCodeCurrencyConstants.COMPONENT_VENDOR_NAME, GeoCodeCurrencyConstants.ENTITY_TYPE_NAME, totalEntities)) { 11712 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11713 11714 var transactionTypes = entities.stream() 11715 .map(GeoCodeCurrencyObject::new) 11716 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11717 11718 data = new CountedObjects<>(objectLimiter, transactionTypes); 11719 } 11720 } 11721 } catch (NamingException ex) { 11722 throw new RuntimeException(ex); 11723 } 11724 11725 return data; 11726 } 11727 11728 @GraphQLField 11729 @GraphQLName("geoCodeTimeZone") 11730 static GeoCodeTimeZoneObject geoCodeTimeZone(final DataFetchingEnvironment env, 11731 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName, 11732 @GraphQLName("javaTimeZoneName") @GraphQLNonNull final String javaTimeZoneName) { 11733 GeoCodeTimeZone geoCodeTimeZone; 11734 11735 try { 11736 var commandForm = GeoUtil.getHome().getGetGeoCodeTimeZoneForm(); 11737 11738 commandForm.setGeoCodeName(geoCodeName); 11739 commandForm.setJavaTimeZoneName(javaTimeZoneName); 11740 11741 geoCodeTimeZone = CDI.current().select(GetGeoCodeTimeZoneCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11742 } catch (NamingException ex) { 11743 throw new RuntimeException(ex); 11744 } 11745 11746 return geoCodeTimeZone == null ? null : new GeoCodeTimeZoneObject(geoCodeTimeZone); 11747 } 11748 11749 @GraphQLField 11750 @GraphQLName("geoCodeTimeZones") 11751 @GraphQLNonNull 11752 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11753 static CountingPaginatedData<GeoCodeTimeZoneObject> geoCodeTimeZones(final DataFetchingEnvironment env, 11754 @GraphQLName("geoCodeName") final String geoCodeName, 11755 @GraphQLName("javaTimeZoneName") final String javaTimeZoneName) { 11756 CountingPaginatedData<GeoCodeTimeZoneObject> data; 11757 11758 try { 11759 var commandForm = GeoUtil.getHome().getGetGeoCodeTimeZonesForm(); 11760 var command = CDI.current().select(GetGeoCodeTimeZonesCommand.class).get(); 11761 11762 commandForm.setGeoCodeName(geoCodeName); 11763 commandForm.setJavaTimeZoneName(javaTimeZoneName); 11764 11765 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11766 if(totalEntities == null) { 11767 data = Connections.emptyConnection(); 11768 } else { 11769 try(var objectLimiter = new ObjectLimiter(env, GeoCodeTimeZoneConstants.COMPONENT_VENDOR_NAME, GeoCodeTimeZoneConstants.ENTITY_TYPE_NAME, totalEntities)) { 11770 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11771 11772 var transactionTypes = entities.stream() 11773 .map(GeoCodeTimeZoneObject::new) 11774 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11775 11776 data = new CountedObjects<>(objectLimiter, transactionTypes); 11777 } 11778 } 11779 } catch (NamingException ex) { 11780 throw new RuntimeException(ex); 11781 } 11782 11783 return data; 11784 } 11785 11786 @GraphQLField 11787 @GraphQLName("geoCodeDateTimeFormat") 11788 static GeoCodeDateTimeFormatObject geoCodeDateTimeFormat(final DataFetchingEnvironment env, 11789 @GraphQLName("geoCodeName") @GraphQLNonNull final String geoCodeName, 11790 @GraphQLName("dateTimeFormatName") @GraphQLNonNull final String dateTimeFormatName) { 11791 GeoCodeDateTimeFormat geoCodeDateTimeFormat; 11792 11793 try { 11794 var commandForm = GeoUtil.getHome().getGetGeoCodeDateTimeFormatForm(); 11795 11796 commandForm.setGeoCodeName(geoCodeName); 11797 commandForm.setDateTimeFormatName(dateTimeFormatName); 11798 11799 geoCodeDateTimeFormat = CDI.current().select(GetGeoCodeDateTimeFormatCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11800 } catch (NamingException ex) { 11801 throw new RuntimeException(ex); 11802 } 11803 11804 return geoCodeDateTimeFormat == null ? null : new GeoCodeDateTimeFormatObject(geoCodeDateTimeFormat); 11805 } 11806 11807 @GraphQLField 11808 @GraphQLName("geoCodeDateTimeFormats") 11809 @GraphQLNonNull 11810 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11811 static CountingPaginatedData<GeoCodeDateTimeFormatObject> geoCodeDateTimeFormats(final DataFetchingEnvironment env, 11812 @GraphQLName("geoCodeName") final String geoCodeName, 11813 @GraphQLName("dateTimeFormatName") final String dateTimeFormatName) { 11814 CountingPaginatedData<GeoCodeDateTimeFormatObject> data; 11815 11816 try { 11817 var commandForm = GeoUtil.getHome().getGetGeoCodeDateTimeFormatsForm(); 11818 var command = CDI.current().select(GetGeoCodeDateTimeFormatsCommand.class).get(); 11819 11820 commandForm.setGeoCodeName(geoCodeName); 11821 commandForm.setDateTimeFormatName(dateTimeFormatName); 11822 11823 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11824 if(totalEntities == null) { 11825 data = Connections.emptyConnection(); 11826 } else { 11827 try(var objectLimiter = new ObjectLimiter(env, GeoCodeDateTimeFormatConstants.COMPONENT_VENDOR_NAME, GeoCodeDateTimeFormatConstants.ENTITY_TYPE_NAME, totalEntities)) { 11828 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11829 11830 var transactionTypes = entities.stream() 11831 .map(GeoCodeDateTimeFormatObject::new) 11832 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11833 11834 data = new CountedObjects<>(objectLimiter, transactionTypes); 11835 } 11836 } 11837 } catch (NamingException ex) { 11838 throw new RuntimeException(ex); 11839 } 11840 11841 return data; 11842 } 11843 11844 @GraphQLField 11845 @GraphQLName("country") 11846 static GeoCodeObject country(final DataFetchingEnvironment env, 11847 @GraphQLName("geoCodeName") final String geoCodeName, 11848 @GraphQLName("countryName") final String countryName, 11849 @GraphQLName("iso3Number") final String iso3Number, 11850 @GraphQLName("iso3Letter") final String iso3Letter, 11851 @GraphQLName("iso2Letter") final String iso2Letter, 11852 @GraphQLName("alias") final String alias) { 11853 GeoCode geoCode; 11854 11855 try { 11856 var commandForm = GeoUtil.getHome().getGetCountryForm(); 11857 11858 commandForm.setGeoCodeName(geoCodeName); 11859 commandForm.setCountryName(countryName); 11860 commandForm.setIso3Number(iso3Number); 11861 commandForm.setIso3Letter(iso3Letter); 11862 commandForm.setIso2Letter(iso2Letter); 11863 commandForm.setAlias(alias); 11864 11865 geoCode = CDI.current().select(GetCountryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11866 } catch (NamingException ex) { 11867 throw new RuntimeException(ex); 11868 } 11869 11870 return geoCode == null ? null : new GeoCodeObject(geoCode); 11871 } 11872 11873 @GraphQLField 11874 @GraphQLName("countries") 11875 @GraphQLNonNull 11876 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11877 static CountingPaginatedData<GeoCodeObject> countries(final DataFetchingEnvironment env) { 11878 CountingPaginatedData<GeoCodeObject> data; 11879 11880 try { 11881 var commandForm = GeoUtil.getHome().getGetCountriesForm(); 11882 var command = CDI.current().select(GetCountriesCommand.class).get(); 11883 11884 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11885 if(totalEntities == null) { 11886 data = Connections.emptyConnection(); 11887 } else { 11888 try(var objectLimiter = new ObjectLimiter(env, GeoCodeConstants.COMPONENT_VENDOR_NAME, GeoCodeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11889 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11890 11891 var geoCodeAliasTypes = entities.stream() 11892 .map(GeoCodeObject::new) 11893 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11894 11895 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 11896 } 11897 } 11898 } catch (NamingException ex) { 11899 throw new RuntimeException(ex); 11900 } 11901 11902 return data; 11903 } 11904 11905 @GraphQLField 11906 @GraphQLName("zipCode") 11907 static GeoCodeObject zipCode(final DataFetchingEnvironment env, 11908 @GraphQLName("countryGeoCodeName") @GraphQLNonNull final String countryGeoCodeName, 11909 @GraphQLName("zipCodeName") @GraphQLNonNull final String zipCodeName) { 11910 GeoCode geoCode; 11911 11912 try { 11913 var commandForm = GeoUtil.getHome().getGetZipCodeForm(); 11914 11915 commandForm.setCountryGeoCodeName(countryGeoCodeName); 11916 commandForm.setZipCodeName(zipCodeName); 11917 11918 geoCode = CDI.current().select(GetZipCodeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11919 } catch (NamingException ex) { 11920 throw new RuntimeException(ex); 11921 } 11922 11923 return geoCode == null ? null : new GeoCodeObject(geoCode); 11924 } 11925 11926 @GraphQLField 11927 @GraphQLName("zipCodes") 11928 @GraphQLNonNull 11929 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11930 static CountingPaginatedData<GeoCodeObject> zipCodes(final DataFetchingEnvironment env, 11931 @GraphQLName("countryName") @GraphQLNonNull final String countryName) { 11932 CountingPaginatedData<GeoCodeObject> data; 11933 11934 try { 11935 var commandForm = GeoUtil.getHome().getGetZipCodesForm(); 11936 var command = CDI.current().select(GetZipCodesCommand.class).get(); 11937 11938 commandForm.setCountryName(countryName); 11939 11940 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11941 if(totalEntities == null) { 11942 data = Connections.emptyConnection(); 11943 } else { 11944 try(var objectLimiter = new ObjectLimiter(env, GeoCodeConstants.COMPONENT_VENDOR_NAME, GeoCodeConstants.ENTITY_TYPE_NAME, totalEntities)) { 11945 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11946 11947 var geoCodeAliasTypes = entities.stream() 11948 .map(GeoCodeObject::new) 11949 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 11950 11951 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 11952 } 11953 } 11954 } catch (NamingException ex) { 11955 throw new RuntimeException(ex); 11956 } 11957 11958 return data; 11959 } 11960 11961 @GraphQLField 11962 @GraphQLName("state") 11963 static GeoCodeObject state(final DataFetchingEnvironment env, 11964 @GraphQLName("countryGeoCodeName") @GraphQLNonNull final String countryGeoCodeName, 11965 @GraphQLName("stateName") final String stateName, 11966 @GraphQLName("postal2Letter") final String postal2Letter) { 11967 GeoCode geoCode; 11968 11969 try { 11970 var commandForm = GeoUtil.getHome().getGetStateForm(); 11971 11972 commandForm.setCountryGeoCodeName(countryGeoCodeName); 11973 commandForm.setStateName(stateName); 11974 commandForm.setPostal2Letter(postal2Letter); 11975 11976 geoCode = CDI.current().select(GetStateCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 11977 } catch (NamingException ex) { 11978 throw new RuntimeException(ex); 11979 } 11980 11981 return geoCode == null ? null : new GeoCodeObject(geoCode); 11982 } 11983 11984 @GraphQLField 11985 @GraphQLName("states") 11986 @GraphQLNonNull 11987 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 11988 static CountingPaginatedData<GeoCodeObject> states(final DataFetchingEnvironment env, 11989 @GraphQLName("countryName") @GraphQLNonNull final String countryName) { 11990 CountingPaginatedData<GeoCodeObject> data; 11991 11992 try { 11993 var commandForm = GeoUtil.getHome().getGetStatesForm(); 11994 var command = CDI.current().select(GetStatesCommand.class).get(); 11995 11996 commandForm.setCountryName(countryName); 11997 11998 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 11999 if(totalEntities == null) { 12000 data = Connections.emptyConnection(); 12001 } else { 12002 try(var objectLimiter = new ObjectLimiter(env, GeoCodeConstants.COMPONENT_VENDOR_NAME, GeoCodeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12003 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12004 12005 var geoCodeAliasTypes = entities.stream() 12006 .map(GeoCodeObject::new) 12007 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12008 12009 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 12010 } 12011 } 12012 } catch (NamingException ex) { 12013 throw new RuntimeException(ex); 12014 } 12015 12016 return data; 12017 } 12018 12019 @GraphQLField 12020 @GraphQLName("county") 12021 static GeoCodeObject county(final DataFetchingEnvironment env, 12022 @GraphQLName("stateGeoCodeName") @GraphQLNonNull final String stateGeoCodeName, 12023 @GraphQLName("countyName") final String countyName, 12024 @GraphQLName("countyNumber") final String countyNumber) { 12025 GeoCode geoCode; 12026 12027 try { 12028 var commandForm = GeoUtil.getHome().getGetCountyForm(); 12029 12030 commandForm.setStateGeoCodeName(stateGeoCodeName); 12031 commandForm.setCountyName(countyName); 12032 commandForm.setCountyNumber(countyNumber); 12033 12034 geoCode = CDI.current().select(GetCountyCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12035 } catch (NamingException ex) { 12036 throw new RuntimeException(ex); 12037 } 12038 12039 return geoCode == null ? null : new GeoCodeObject(geoCode); 12040 } 12041 12042 @GraphQLField 12043 @GraphQLName("counties") 12044 @GraphQLNonNull 12045 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12046 static CountingPaginatedData<GeoCodeObject> counties(final DataFetchingEnvironment env, 12047 @GraphQLName("countryName") @GraphQLNonNull final String countryName, 12048 @GraphQLName("stateName") @GraphQLNonNull final String stateName) { 12049 CountingPaginatedData<GeoCodeObject> data; 12050 12051 try { 12052 var commandForm = GeoUtil.getHome().getGetCountiesForm(); 12053 var command = CDI.current().select(GetCountiesCommand.class).get(); 12054 12055 commandForm.setCountryName(countryName); 12056 commandForm.setStateName(stateName); 12057 12058 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12059 if(totalEntities == null) { 12060 data = Connections.emptyConnection(); 12061 } else { 12062 try(var objectLimiter = new ObjectLimiter(env, GeoCodeConstants.COMPONENT_VENDOR_NAME, GeoCodeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12063 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12064 12065 var geoCodeAliasTypes = entities.stream() 12066 .map(GeoCodeObject::new) 12067 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12068 12069 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 12070 } 12071 } 12072 } catch (NamingException ex) { 12073 throw new RuntimeException(ex); 12074 } 12075 12076 return data; 12077 } 12078 12079 @GraphQLField 12080 @GraphQLName("city") 12081 static GeoCodeObject city(final DataFetchingEnvironment env, 12082 @GraphQLName("stateGeoCodeName") @GraphQLNonNull final String stateGeoCodeName, 12083 @GraphQLName("cityName") @GraphQLNonNull final String cityName) { 12084 GeoCode geoCode; 12085 12086 try { 12087 var commandForm = GeoUtil.getHome().getGetCityForm(); 12088 12089 commandForm.setStateGeoCodeName(stateGeoCodeName); 12090 commandForm.setCityName(cityName); 12091 12092 geoCode = CDI.current().select(GetCityCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12093 } catch (NamingException ex) { 12094 throw new RuntimeException(ex); 12095 } 12096 12097 return geoCode == null ? null : new GeoCodeObject(geoCode); 12098 } 12099 12100 @GraphQLField 12101 @GraphQLName("cities") 12102 @GraphQLNonNull 12103 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12104 static CountingPaginatedData<GeoCodeObject> cities(final DataFetchingEnvironment env, 12105 @GraphQLName("countryName") @GraphQLNonNull final String countryName, 12106 @GraphQLName("stateName") @GraphQLNonNull final String stateName) { 12107 CountingPaginatedData<GeoCodeObject> data; 12108 12109 try { 12110 var commandForm = GeoUtil.getHome().getGetCitiesForm(); 12111 var command = CDI.current().select(GetCitiesCommand.class).get(); 12112 12113 commandForm.setCountryName(countryName); 12114 commandForm.setStateName(stateName); 12115 12116 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12117 if(totalEntities == null) { 12118 data = Connections.emptyConnection(); 12119 } else { 12120 try(var objectLimiter = new ObjectLimiter(env, GeoCodeConstants.COMPONENT_VENDOR_NAME, GeoCodeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12121 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12122 12123 var geoCodeAliasTypes = entities.stream() 12124 .map(GeoCodeObject::new) 12125 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12126 12127 data = new CountedObjects<>(objectLimiter, geoCodeAliasTypes); 12128 } 12129 } 12130 } catch (NamingException ex) { 12131 throw new RuntimeException(ex); 12132 } 12133 12134 return data; 12135 } 12136 12137 @GraphQLField 12138 @GraphQLName("shippingMethod") 12139 static ShippingMethodObject shippingMethod(final DataFetchingEnvironment env, 12140 @GraphQLName("shippingMethodName") final String shippingMethodName, 12141 @GraphQLName("id") @GraphQLID final String id) { 12142 ShippingMethod shippingMethod; 12143 12144 try { 12145 var commandForm = ShippingUtil.getHome().getGetShippingMethodForm(); 12146 12147 commandForm.setShippingMethodName(shippingMethodName); 12148 commandForm.setUuid(id); 12149 12150 shippingMethod = CDI.current().select(GetShippingMethodCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12151 } catch (NamingException ex) { 12152 throw new RuntimeException(ex); 12153 } 12154 12155 return shippingMethod == null ? null : new ShippingMethodObject(shippingMethod); 12156 } 12157 12158 @GraphQLField 12159 @GraphQLName("shippingMethods") 12160 @GraphQLNonNull 12161 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12162 static CountingPaginatedData<ShippingMethodObject> shippingMethods(final DataFetchingEnvironment env) { 12163 CountingPaginatedData<ShippingMethodObject> data; 12164 12165 try { 12166 var shippingControl = Session.getModelController(ShippingControl.class); 12167 var totalCount = shippingControl.countShippingMethods(); 12168 12169 try(var objectLimiter = new ObjectLimiter(env, ShippingMethodConstants.COMPONENT_VENDOR_NAME, ShippingMethodConstants.ENTITY_TYPE_NAME, totalCount)) { 12170 var commandForm = ShippingUtil.getHome().getGetShippingMethodsForm(); 12171 var entities = CDI.current().select(GetShippingMethodsCommand.class).get().getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12172 12173 if(entities == null) { 12174 data = Connections.emptyConnection(); 12175 } else { 12176 var shippingMethods = entities.stream().map(ShippingMethodObject::new).collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12177 12178 data = new CountedObjects<>(objectLimiter, shippingMethods); 12179 } 12180 } 12181 } catch (NamingException ex) { 12182 throw new RuntimeException(ex); 12183 } 12184 12185 return data; 12186 } 12187 12188 @GraphQLField 12189 @GraphQLName("transactionTimeType") 12190 static TransactionTimeTypeObject transactionTimeType(final DataFetchingEnvironment env, 12191 @GraphQLName("transactionTimeTypeName") final String transactionTimeTypeName, 12192 @GraphQLName("id") @GraphQLID final String id) { 12193 TransactionTimeType transactionTimeType; 12194 12195 try { 12196 var commandForm = AccountingUtil.getHome().getGetTransactionTimeTypeForm(); 12197 12198 commandForm.setTransactionTimeTypeName(transactionTimeTypeName); 12199 commandForm.setUuid(id); 12200 12201 transactionTimeType = CDI.current().select(GetTransactionTimeTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12202 } catch (NamingException ex) { 12203 throw new RuntimeException(ex); 12204 } 12205 12206 return transactionTimeType == null ? null : new TransactionTimeTypeObject(transactionTimeType); 12207 } 12208 12209 @GraphQLField 12210 @GraphQLName("transactionTimeTypes") 12211 @GraphQLNonNull 12212 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12213 static CountingPaginatedData<TransactionTimeTypeObject> transactionTimeTypes(final DataFetchingEnvironment env) { 12214 CountingPaginatedData<TransactionTimeTypeObject> data; 12215 12216 try { 12217 var commandForm = AccountingUtil.getHome().getGetTransactionTimeTypesForm(); 12218 var command = CDI.current().select(GetTransactionTimeTypesCommand.class).get(); 12219 12220 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12221 if(totalEntities == null) { 12222 data = Connections.emptyConnection(); 12223 } else { 12224 try(var objectLimiter = new ObjectLimiter(env, TransactionTimeTypeConstants.COMPONENT_VENDOR_NAME, TransactionTimeTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12225 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12226 12227 var transactionTimeTypes = entities.stream() 12228 .map(TransactionTimeTypeObject::new) 12229 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12230 12231 data = new CountedObjects<>(objectLimiter, transactionTimeTypes); 12232 } 12233 } 12234 } catch (NamingException ex) { 12235 throw new RuntimeException(ex); 12236 } 12237 12238 return data; 12239 } 12240 12241 @GraphQLField 12242 @GraphQLName("transactionType") 12243 static TransactionTypeObject transactionType(final DataFetchingEnvironment env, 12244 @GraphQLName("transactionTypeName") final String transactionTypeName, 12245 @GraphQLName("id") @GraphQLID final String id) { 12246 TransactionType transactionType; 12247 12248 try { 12249 var commandForm = AccountingUtil.getHome().getGetTransactionTypeForm(); 12250 12251 commandForm.setTransactionTypeName(transactionTypeName); 12252 commandForm.setUuid(id); 12253 12254 transactionType = CDI.current().select(GetTransactionTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12255 } catch (NamingException ex) { 12256 throw new RuntimeException(ex); 12257 } 12258 12259 return transactionType == null ? null : new TransactionTypeObject(transactionType); 12260 } 12261 12262 @GraphQLField 12263 @GraphQLName("transactionTypes") 12264 @GraphQLNonNull 12265 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12266 static CountingPaginatedData<TransactionTypeObject> transactionTypes(final DataFetchingEnvironment env) { 12267 CountingPaginatedData<TransactionTypeObject> data; 12268 12269 try { 12270 var commandForm = AccountingUtil.getHome().getGetTransactionTypesForm(); 12271 var command = CDI.current().select(GetTransactionTypesCommand.class).get(); 12272 12273 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12274 if(totalEntities == null) { 12275 data = Connections.emptyConnection(); 12276 } else { 12277 try(var objectLimiter = new ObjectLimiter(env, TransactionTypeConstants.COMPONENT_VENDOR_NAME, TransactionTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12278 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12279 12280 var transactionTypes = entities.stream() 12281 .map(TransactionTypeObject::new) 12282 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12283 12284 data = new CountedObjects<>(objectLimiter, transactionTypes); 12285 } 12286 } 12287 } catch (NamingException ex) { 12288 throw new RuntimeException(ex); 12289 } 12290 12291 return data; 12292 } 12293 12294 @GraphQLField 12295 @GraphQLName("transactionGlAccountCategory") 12296 static TransactionGlAccountCategoryObject transactionGlAccountCategory(final DataFetchingEnvironment env, 12297 @GraphQLName("transactionTypeName") final String transactionTypeName, 12298 @GraphQLName("transactionGlAccountCategoryName") final String transactionGlAccountCategoryName, 12299 @GraphQLName("id") @GraphQLID final String id) { 12300 TransactionGlAccountCategory transactionGlAccountCategory; 12301 12302 try { 12303 var commandForm = AccountingUtil.getHome().getGetTransactionGlAccountCategoryForm(); 12304 12305 commandForm.setTransactionTypeName(transactionTypeName); 12306 commandForm.setTransactionGlAccountCategoryName(transactionGlAccountCategoryName); 12307 commandForm.setUuid(id); 12308 12309 transactionGlAccountCategory = CDI.current().select(GetTransactionGlAccountCategoryCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12310 } catch (NamingException ex) { 12311 throw new RuntimeException(ex); 12312 } 12313 12314 return transactionGlAccountCategory == null ? null : new TransactionGlAccountCategoryObject(transactionGlAccountCategory); 12315 } 12316 12317 @GraphQLField 12318 @GraphQLName("transactionGlAccountCategories") 12319 @GraphQLNonNull 12320 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12321 static CountingPaginatedData<TransactionGlAccountCategoryObject> transactionGlAccountCategories(final DataFetchingEnvironment env, 12322 @GraphQLName("transactionTypeName") final String transactionTypeName) { 12323 CountingPaginatedData<TransactionGlAccountCategoryObject> data; 12324 12325 try { 12326 var commandForm = AccountingUtil.getHome().getGetTransactionGlAccountCategoriesForm(); 12327 var command = CDI.current().select(GetTransactionGlAccountCategoriesCommand.class).get(); 12328 12329 commandForm.setTransactionTypeName(transactionTypeName); 12330 12331 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12332 if(totalEntities == null) { 12333 data = Connections.emptyConnection(); 12334 } else { 12335 try(var objectLimiter = new ObjectLimiter(env, TransactionGlAccountCategoryConstants.COMPONENT_VENDOR_NAME, TransactionGlAccountCategoryConstants.ENTITY_TYPE_NAME, totalEntities)) { 12336 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12337 12338 var transactionGlAccountCategories = entities.stream() 12339 .map(TransactionGlAccountCategoryObject::new) 12340 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12341 12342 data = new CountedObjects<>(objectLimiter, transactionGlAccountCategories); 12343 } 12344 } 12345 } catch (NamingException ex) { 12346 throw new RuntimeException(ex); 12347 } 12348 12349 return data; 12350 } 12351 12352 @GraphQLField 12353 @GraphQLName("transactionEntityRoleType") 12354 static TransactionEntityRoleTypeObject transactionEntityRoleType(final DataFetchingEnvironment env, 12355 @GraphQLName("transactionTypeName") final String transactionTypeName, 12356 @GraphQLName("transactionEntityRoleTypeName") final String transactionEntityRoleTypeName, 12357 @GraphQLName("id") @GraphQLID final String id) { 12358 TransactionEntityRoleType transactionEntityRoleType; 12359 12360 try { 12361 var commandForm = AccountingUtil.getHome().getGetTransactionEntityRoleTypeForm(); 12362 12363 commandForm.setTransactionTypeName(transactionTypeName); 12364 commandForm.setTransactionEntityRoleTypeName(transactionEntityRoleTypeName); 12365 commandForm.setUuid(id); 12366 12367 transactionEntityRoleType = CDI.current().select(GetTransactionEntityRoleTypeCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12368 } catch (NamingException ex) { 12369 throw new RuntimeException(ex); 12370 } 12371 12372 return transactionEntityRoleType == null ? null : new TransactionEntityRoleTypeObject(transactionEntityRoleType); 12373 } 12374 12375 @GraphQLField 12376 @GraphQLName("transactionEntityRoleTypes") 12377 @GraphQLNonNull 12378 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12379 static CountingPaginatedData<TransactionEntityRoleTypeObject> transactionEntityRoleTypes(final DataFetchingEnvironment env, 12380 @GraphQLName("transactionTypeName") final String transactionTypeName) { 12381 CountingPaginatedData<TransactionEntityRoleTypeObject> data; 12382 12383 try { 12384 var commandForm = AccountingUtil.getHome().getGetTransactionEntityRoleTypesForm(); 12385 var command = CDI.current().select(GetTransactionEntityRoleTypesCommand.class).get(); 12386 12387 commandForm.setTransactionTypeName(transactionTypeName); 12388 12389 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12390 if(totalEntities == null) { 12391 data = Connections.emptyConnection(); 12392 } else { 12393 try(var objectLimiter = new ObjectLimiter(env, TransactionEntityRoleTypeConstants.COMPONENT_VENDOR_NAME, TransactionEntityRoleTypeConstants.ENTITY_TYPE_NAME, totalEntities)) { 12394 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12395 12396 var transactionEntityRoleTypes = entities.stream() 12397 .map(TransactionEntityRoleTypeObject::new) 12398 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12399 12400 data = new CountedObjects<>(objectLimiter, transactionEntityRoleTypes); 12401 } 12402 } 12403 } catch (NamingException ex) { 12404 throw new RuntimeException(ex); 12405 } 12406 12407 return data; 12408 } 12409 12410 @GraphQLField 12411 @GraphQLName("transactionGroup") 12412 static TransactionGroupObject transactionGroup(final DataFetchingEnvironment env, 12413 @GraphQLName("transactionGroupName") final String transactionGroupName, 12414 @GraphQLName("id") @GraphQLID final String id) { 12415 TransactionGroup transactionGroup; 12416 12417 try { 12418 var commandForm = AccountingUtil.getHome().getGetTransactionGroupForm(); 12419 12420 commandForm.setTransactionGroupName(transactionGroupName); 12421 commandForm.setUuid(id); 12422 12423 transactionGroup = CDI.current().select(GetTransactionGroupCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12424 } catch (NamingException ex) { 12425 throw new RuntimeException(ex); 12426 } 12427 12428 return transactionGroup == null ? null : new TransactionGroupObject(transactionGroup); 12429 } 12430 12431 @GraphQLField 12432 @GraphQLName("transactionGroups") 12433 @GraphQLNonNull 12434 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12435 static CountingPaginatedData<TransactionGroupObject> transactionGroups(final DataFetchingEnvironment env) { 12436 CountingPaginatedData<TransactionGroupObject> data; 12437 12438 try { 12439 var commandForm = AccountingUtil.getHome().getGetTransactionGroupsForm(); 12440 var command = CDI.current().select(GetTransactionGroupsCommand.class).get(); 12441 12442 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12443 if(totalEntities == null) { 12444 data = Connections.emptyConnection(); 12445 } else { 12446 try(var objectLimiter = new ObjectLimiter(env, TransactionGroupConstants.COMPONENT_VENDOR_NAME, TransactionGroupConstants.ENTITY_TYPE_NAME, totalEntities)) { 12447 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12448 12449 var transactionGroups = entities.stream() 12450 .map(TransactionGroupObject::new) 12451 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12452 12453 data = new CountedObjects<>(objectLimiter, transactionGroups); 12454 } 12455 } 12456 } catch (NamingException ex) { 12457 throw new RuntimeException(ex); 12458 } 12459 12460 return data; 12461 } 12462 12463 @GraphQLField 12464 @GraphQLName("transaction") 12465 static TransactionObject transaction(final DataFetchingEnvironment env, 12466 @GraphQLName("transactionName") final String transactionName, 12467 @GraphQLName("id") @GraphQLID final String id) { 12468 Transaction transaction; 12469 12470 try { 12471 var commandForm = AccountingUtil.getHome().getGetTransactionForm(); 12472 12473 commandForm.setTransactionName(transactionName); 12474 commandForm.setUuid(id); 12475 12476 transaction = CDI.current().select(GetTransactionCommand.class).get().getEntityForGraphQl(getUserVisitPK(env), commandForm); 12477 } catch (NamingException ex) { 12478 throw new RuntimeException(ex); 12479 } 12480 12481 return transaction == null ? null : new TransactionObject(transaction); 12482 } 12483 12484 @GraphQLField 12485 @GraphQLName("transactions") 12486 @GraphQLNonNull 12487 @GraphQLConnection(connectionFetcher = CountingDataConnectionFetcher.class) 12488 static CountingPaginatedData<TransactionObject> transactions(final DataFetchingEnvironment env, 12489 @GraphQLName("transactionGroupName") final String transactionGroupName) { 12490 CountingPaginatedData<TransactionObject> data; 12491 12492 try { 12493 var commandForm = AccountingUtil.getHome().getGetTransactionsForm(); 12494 var command = CDI.current().select(GetTransactionsCommand.class).get(); 12495 12496 commandForm.setTransactionGroupName(transactionGroupName); 12497 12498 var totalEntities = command.getTotalEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12499 if(totalEntities == null) { 12500 data = Connections.emptyConnection(); 12501 } else { 12502 try(var objectLimiter = new ObjectLimiter(env, TransactionConstants.COMPONENT_VENDOR_NAME, TransactionConstants.ENTITY_TYPE_NAME, totalEntities)) { 12503 var entities = command.getEntitiesForGraphQl(getUserVisitPK(env), commandForm); 12504 12505 var transactions = entities.stream() 12506 .map(TransactionObject::new) 12507 .collect(Collectors.toCollection(() -> new ArrayList<>(entities.size()))); 12508 12509 data = new CountedObjects<>(objectLimiter, transactions); 12510 } 12511 } 12512 } catch (NamingException ex) { 12513 throw new RuntimeException(ex); 12514 } 12515 12516 return data; 12517 } 12518 12519}