Posts

Showing posts with the label SAP Hybris DB

Hybris flexible search query examples

Use of Enum in the query Find all running Solr Index jobs select {cj.code},{enum:code},{cj.startTime},{cj.endTime} from { SolrIndexerCronJob! as cj join EnumerationValue as enum on {cj.status}={enum.pk} } where {enum:code} = 'RUNNING' Compare Date in the flexiblesearch query Find all running Solr Index jobs from the given date select {cj.code},{enum:code},{cj.startTime},{cj.endTime} from { SolrIndexerCronJob! as cj join EnumerationValue as enum on {cj.status}={enum.pk} } where {enum:code} = 'RUNNING' and {cj.startTime} >= TO_DATE('2021/12/25','YYYY/MM/DD') Basic  JOIN  and  IN  query Get the most recent order for each customer using flexible search. select {o.code} as orderCode, {c.name} as name, {a.cellphone} as cellphone from {order as o join Customer as c on {c.pk} = {o.user} join Address as a on {o.deliveryaddress} = {a.pk} } where {o.code} in ({{select max({cod

How to configure MySQL Connector in SAP Hybris ?

Hybris OOTB shipped with  HSQL DB,  If you want to configure  MySQL  as Hybris DB then follow the below steps and you go!! Download  MySql connector  ( .jar ), as it is not shipped with Hybris OOTB suite Copy downloaded connector ( .jar ) file to  ${HYBRIS_BIN_DIR}/platform/lib/dbdriver directory Add below  properties  to your  local.properties  file db.url=jdbc:mysql://hostname:port/dbName?useConfigs=maxPerformance&characterEncoding=utf8&useSSL=false db.driver=com.mysql.jdbc.Driver db.username=root db.password=password Initialize the system ( ant initialize )