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