Introduction
Development
Core
Entity Definitions
The definitions in this module have id discriminators in the range 300-310. |
The AddressCountryTargetingEntityDefinition extends the CustomerTargetingEntityDefinition, going further to the TargetingEntityDefinition and the AbstractEntityDefinition:

The AddressCountryTargetingEntityDefinition
checks if the default address of the customer is the same as the one specified. The defined here property is country. As an instance of CountryEntityDefinition
, it stores the country of the targeting.
The AddressPostalcodeTargetingEntityDefinition extends the CustomerTargetingEntityDefinition, going further to the TargetingEntityDefinition and the AbstractEntityDefinition:

The AddressPostalcodeTargetingEntityDefinition
checks if the default address of the customer is the same as the one specified. The defined here property is postalCode. It stores the postalcode of the targeting.
The CartTargetingEntityDefinition extends the TargetingEntityDefinition, going further to the AbstractEntityDefinition:

The CustomerNumberOfOrdersInSpacetimeEntityDefinition extends the CustomerTargetingEntityDefinition going further to the TargetingEntityDefinition and the AbstractEntityDefinition:

The CustomerNumberOfOrdersInSpacetimeEntityDefinition
defines a targeting rule for when a given customer has certain amount of orders in a given spacetime (within 2 hours, 5 days, 3 weeks, etc). Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:
Property | Description |
---|---|
numberOfOrders |
stores the number of orders we need to have in order to activate the targeting |
numberOfDays |
stores the duration (in number of days) in which orders must be placed to activate the targeting |
The EachLastOrderTotalValueTargetingEntityDefinition extends the CustomerTargetingEntityDefinition and the AbstractExpensableEntityDefinition. The inheritance goes further to the TargetingEntityDefinition and the AbstractEntityDefinition:

The TargetableAddressEntityDefinition extends the AddressEntityDefinition, going further to the AbstractEntityDefinition and the AbstractUserableEntityDefinition:

The TargetableCustomerEntityDefinition extends the CustomerEntityDefinition. The inheritance goes further to the UserEntityDefinition, the PrincipalEntityDefinition and the AbstractEntityDefinition:

the TargetingEntityDefinition extends the AbstractEntityDefinition and the AbstractActivatableEntityDefinition. This is the base definition for all targetings:

Property | Description |
---|---|
priority |
stores the the priority of the targeting; keep in mind that targeting with lower priority is evaluated before targeting with higher priority |
rule |
stores the rule for the targeting |
The TargetingGroupEntityDefinition adds targeting-attributes to the AbstractEntityDefinition:

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:
Property | Description |
---|---|
userGroup |
stores the customer group the customer will be moved to in case all of the targetings are fired |
targetings |
stores a set of targetings for the given targeting group |
The TargetingResultEntityDefinition extends the AbstractEntityDefinition and the AbstractUserableEntityDefinition:

The defined here property is targeting - it stores the result of which targeting this targeting result is.
The TotalSumOfCartTargetingEntityDefinition extends the CartTargetingEntityDefinition, going further to the TargetingEntityDefinition, the AbstractEntityDefinition and the AbstractActivatableEntityDefinition:

Spring Data JPA Repositories
The TargetingRepository extends the BaseEntityRepository
and the ActivatableRepository. This is the corresponding Spring Data JPA repository for the TargetingEntityDefinition

Business Services
The TargetingService defines a helper method for adding active targeting rules to the session.