Adds the commerce user segment criterion to the database. Also notifies the appropriate model listeners.

@param commerceUserSegmentCriterion the commerce user segment criterion
@return the commerce user segment criterion that was added
436387
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceUserSegmentCriterion addCommerceUserSegmentCriterion(
		CommerceUserSegmentCriterion commerceUserSegmentCriterion) {
		commerceUserSegmentCriterion.setNew(true);

		return commerceUserSegmentCriterionPersistence.update(commerceUserSegmentCriterion);
	}
481222
public static List<CommerceUserSegmentCriterion> toModels(
		CommerceUserSegmentCriterionSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceUserSegmentCriterion> models = new ArrayList<CommerceUserSegmentCriterion>(soapModels.length);

		for (CommerceUserSegmentCriterionSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
1140180
public void setCommerceAccountUserRelLocalService(
		com.liferay.commerce.account.service.CommerceAccountUserRelLocalService commerceAccountUserRelLocalService) {
		this.commerceAccountUserRelLocalService = commerceAccountUserRelLocalService;
	}
1079753
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommercePriceEntry addCommercePriceEntry(
		CommercePriceEntry commercePriceEntry) {
		commercePriceEntry.setNew(true);

		return commercePriceEntryPersistence.update(commercePriceEntry);
	}
1261300
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceSubscriptionEntry addCommerceSubscriptionEntry(
		CommerceSubscriptionEntry commerceSubscriptionEntry) {
		commerceSubscriptionEntry.setNew(true);

		return commerceSubscriptionEntryPersistence.update(commerceSubscriptionEntry);
	}
931742
@Override
	public List<CommerceAccountUserRel> findByCommerceAccountId(
		long commerceAccountId) {
		return findByCommerceAccountId(commerceAccountId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
434613
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceDiscountUsageEntry addCommerceDiscountUsageEntry(
		CommerceDiscountUsageEntry commerceDiscountUsageEntry) {
		commerceDiscountUsageEntry.setNew(true);

		return commerceDiscountUsageEntryPersistence.update(commerceDiscountUsageEntry);
	}
327184
protected String createQueryFragmentForCriteria(Criteria part, @Nullable Class<?> domainType) {

		Criteria criteria = part;
		StringBuilder queryFragment = new StringBuilder();
		boolean singeEntryCriteria = (criteria.getPredicates().size() == 1);

		if (criteria instanceof QueryStringHolder) {
			return ((QueryStringHolder) criteria).getQueryString();
		}

		String fieldName = getNullsafeFieldName(criteria.getField(), domainType);
		if (criteria.isNegating()) {
			fieldName = NOT + fieldName;
		}
		if (!StringUtils.isEmpty(fieldName) && !containsFunctionCriteria(criteria.getPredicates())) {
			queryFragment.append(fieldName);
			queryFragment.append(DELIMINATOR);
		}

		// no criteria given is defaulted to not null
		if (criteria.getPredicates().isEmpty()) {
			queryFragment.append("[* TO *]");
			return queryFragment.toString();
		}

		if (!singeEntryCriteria) {
			queryFragment.append("(");
		}

		CriteriaQueryStringValueProvider valueProvider = new CriteriaQueryStringValueProvider(criteria, domainType);
		while (valueProvider.hasNext()) {
			queryFragment.append(valueProvider.next());
			if (valueProvider.hasNext()) {
				queryFragment.append(CRITERIA_VALUE_SEPERATOR);
			}
		}

		if (!singeEntryCriteria) {
			queryFragment.append(")");
		}
		if (!Float.isNaN(criteria.getBoost())) {
			queryFragment.append(BOOST).append(criteria.getBoost());
		}

		return queryFragment.toString();
	}
84503
@Override
	public CPRuleUserSegmentRel create(long CPRuleUserSegmentRelId) {
		CPRuleUserSegmentRel cpRuleUserSegmentRel = new CPRuleUserSegmentRelImpl();

		cpRuleUserSegmentRel.setNew(true);
		cpRuleUserSegmentRel.setPrimaryKey(CPRuleUserSegmentRelId);

		cpRuleUserSegmentRel.setCompanyId(companyProvider.getCompanyId());

		return cpRuleUserSegmentRel;
	}
643010
public static com.liferay.commerce.discount.model.CommerceDiscountUserSegmentRel deleteCommerceDiscountUserSegmentRel(
		com.liferay.commerce.discount.model.CommerceDiscountUserSegmentRel commerceDiscountUserSegmentRel) {
		return getService()
				   .deleteCommerceDiscountUserSegmentRel(commerceDiscountUserSegmentRel);
	}
349076
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceRegion updateCommerceRegion(CommerceRegion commerceRegion) {
		return commerceRegionPersistence.update(commerceRegion);
	}
1371068
@Override
	public List<CommerceAccountUserRel> findByCommerceAccountUserId(
		long commerceAccountUserId) {
		return findByCommerceAccountUserId(commerceAccountUserId,
			QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
997132
@Override
	public List<CommerceDiscountUserSegmentRel> findByCommerceDiscountId(
		long commerceDiscountId) {
		return findByCommerceDiscountId(commerceDiscountId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
1137557
@Override
	public void cacheResult(
		CommerceUserSegmentCriterion commerceUserSegmentCriterion) {
		entityCache.putResult(CommerceUserSegmentCriterionModelImpl.ENTITY_CACHE_ENABLED,
			CommerceUserSegmentCriterionImpl.class,
			commerceUserSegmentCriterion.getPrimaryKey(),
			commerceUserSegmentCriterion);

		commerceUserSegmentCriterion.resetOriginalValues();
	}
1061823
public void setCommerceAccountUserRelService(
		com.liferay.commerce.account.service.CommerceAccountUserRelService commerceAccountUserRelService) {
		this.commerceAccountUserRelService = commerceAccountUserRelService;
	}
918031
@Override
	public void removeByCommerceDiscountId(long commerceDiscountId) {
		for (CommerceDiscountUserSegmentRel commerceDiscountUserSegmentRel : findByCommerceDiscountId(
				commerceDiscountId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceDiscountUserSegmentRel);
		}
	}
1080572
public void setCommerceUserSegmentEntryService(
		com.liferay.commerce.user.segment.service.CommerceUserSegmentEntryService commerceUserSegmentEntryService) {
		this.commerceUserSegmentEntryService = commerceUserSegmentEntryService;
	}