@Entity
@Table(name = "BLC_PRODUCT", indexes = {...})
@Inheritance(strategy = InheritanceType.JOINED)
@Data
@EqualsAndHashCode(exclude = {"_id", "options", "includedProducts", "fulfillmentFlatRates"})
@EntityListeners(TrackingListener.class) # (1)
@TrackableExtension({TrackableBehavior.SANDBOX, TrackableBehavior.CATALOG}) # (2)
public class JpaProduct
implements CatalogTrackable<CatalogJpaTracking> # (3)
, ModelMapperMappable # (4)
, BusinessTypeAware # (5)
, Serializable, CurrencyProvider, CurrencyConsumer,
Translatable, ActiveAware, Indexable {
...
@Id
@GeneratedValue(generator = "blcid")
@GenericGenerator(name = "blcid", strategy = "blcid")
@Type(type = "com.broadleafcommerce.data.tracking.jpa.hibernate.ULidType")
@Column(name = "ID", nullable = false, length = CONTEXT_ID_LENGTH)
private String _id; # (6)
@Column(name = "CONTEXT_ID", length = CONTEXT_ID_LENGTH)
@Convert(converter = UlidConverter.class)
private String contextId; # (7)
@Embedded
private CatalogJpaTracking tracking; # (8)
...
@Override
@NonNull
public ModelMapper fromMe() { # (9)
final ModelMapper mapper = new ModelMapper();
mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
...
return mapper;
}
@Override
@NonNull
public ModelMapper toMe() {
ModelMapper mapper = new ModelMapper();
mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
...
return mapper;
}
...
@Override
public Class<?> getBusinessDomainType() { # (10)
return Product.class;
}
...