Class DefaultOrderNoteService<P extends OrderNote>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.order.service.DefaultOrderNoteService<P>
Type Parameters:
P - The projection domain type, a subtype of OrderNote
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>, OrderNoteService<P>

public class DefaultOrderNoteService<P extends OrderNote> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P> implements OrderNoteService<P>
Default implementation of OrderNoteService
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultOrderNoteService(OrderNoteRepository<com.broadleafcommerce.data.tracking.core.Trackable> orderNoteRepository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(P orderNote, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
    protected OrderNoteRepository<com.broadleafcommerce.data.tracking.core.Trackable>
     
    org.springframework.data.domain.Page<P>
    readAllByOrderId(@NonNull String orderId, @NonNull cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Retrieve notes for the given order ID.
    org.springframework.data.domain.Page<P>
    readAllByOrderIdAndMatchingTenant(@NonNull String orderId, @NonNull cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Retrieve notes for the given order ID and the tenant from ContextInfo.
    readByContextIdAndMatchingTenant(@NonNull String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Retrieves the order note matching the provided ID and the tenant from ContextInfo if present.
    protected void
    setAuditInformation(P orderNote, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Sets audit information for the order note for creation.

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService

    getRsqlHelper, readAll, readAll, readAll, readAll

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService

    convertFromPersistentDomain, convertToPersistentDomain, createAll, createAllAllowingPartialSuccess, delete, getHelper, getRepository, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService

    createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService

    readAll, readAll, readAll, readAll
  • Constructor Details

    • DefaultOrderNoteService

      public DefaultOrderNoteService(OrderNoteRepository<com.broadleafcommerce.data.tracking.core.Trackable> orderNoteRepository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
  • Method Details

    • readAllByOrderId

      public org.springframework.data.domain.Page<P> readAllByOrderId(@NonNull @NonNull String orderId, @NonNull @NonNull cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderNoteService
      Retrieve notes for the given order ID.
      Specified by:
      readAllByOrderId in interface OrderNoteService<P extends OrderNote>
      Parameters:
      orderId - the ID of the order to search for
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      page - the requested page of results from the database
      contextInfo - context information around sandbox and multitenant state
      Returns:
      a page of the notes associated with the given order ID
    • readAllByOrderIdAndMatchingTenant

      public org.springframework.data.domain.Page<P> readAllByOrderIdAndMatchingTenant(@NonNull @NonNull String orderId, @NonNull @NonNull cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderNoteService
      Retrieve notes for the given order ID and the tenant from ContextInfo.

      Differs from the standard narrowing behavior of OrderNoteRepository.findAllByOrderContextId(String, Node, Pageable, ContextInfo), which only returns tenant-level (non-application-associated) records when fetching from a tenant context. This implementation finds all records within the tenant regardless of whether they're associated to an application.

      Specified by:
      readAllByOrderIdAndMatchingTenant in interface OrderNoteService<P extends OrderNote>
      Parameters:
      orderId - the ID of the order to search for
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      page - the requested page of results from the database
      contextInfo - context information around sandbox and multitenant state
      Returns:
      a page of the notes associated with the given order ID and tenant
    • readByContextIdAndMatchingTenant

      public P readByContextIdAndMatchingTenant(@NonNull @NonNull String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: OrderNoteService
      Retrieves the order note matching the provided ID and the tenant from ContextInfo if present.

      Differs from the standard narrowing behavior of TrackableRepository.findByContextId(String, ContextInfo), which only returns tenant-level (non-application-associated) records when fetching from a tenant context. This implementation finds all records within the tenant regardless of whether they're associated to an application.

      Specified by:
      readByContextIdAndMatchingTenant in interface OrderNoteService<P extends OrderNote>
      Parameters:
      id - the id of the order note to find
      context - context information surrounding multitenant state.
      Returns:
      the requested order note if found within the tenant
    • create

      public P create(@NonNull P orderNote, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      create in interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends OrderNote>
      Overrides:
      create in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends OrderNote>
    • setAuditInformation

      protected void setAuditInformation(P orderNote, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Sets audit information for the order note for creation.
      Parameters:
      orderNote - the note to which to assign audit information
      contextInfo - context information about multitenant state
    • getOrderNoteRepository

      protected OrderNoteRepository<com.broadleafcommerce.data.tracking.core.Trackable> getOrderNoteRepository()