SlideShare une entreprise Scribd logo
1  sur  20
Repository Query Language
Repository Queries
https://software-engineering-101.com/2016/07/12/atg-repository-queries/
RQL
generic language for formulating queries that map to
any repository implementation, such as SQL or LDAP.
Multi-Valued Property Queries
• interests INCLUDES "biking“
• interests INCLUDES ANY { "biking", "swimming" }
• interests INCLUDES ALL { "biking", "swimming" }
• addresses INCLUDES ITEM (zip = "48322" AND state = "MI")
RQL RANGE
• age > 30 RANGE +10
• age > 30 RANGE 10+
• age > 30 RANGE 40+10
atg.repository.QueryBuilder
defines the
available query
operations
build Query
objects
ComparisonQuery
RepositoryView userView = getRepository().getItemDescriptor(USER).getRepositoryView();
QueryBuilder userBuilder = userView.getQueryBuilder();
QueryExpression userType = userBuilder.createPropertyQueryExpression(USER_TYPE);
QueryExpression two = userBuilder.createConstantQueryExpression(USER_TYPE_2);
Query userTypeIsTwo = userBuilder.createComparisonQuery(userType, two,
QueryBuilder.EQUALS);
RepositoryItem[] answer = userView.executeQuery(userTypeIsTwo);
PatternMatchQuery
RepositoryView employeeView = getRepository().getView(USER);
QueryBuilder queryBuilder = employeeView.getQueryBuilder();
QueryExpression propertyExpression = queryBuilder.createPropertyQueryExpression(“login”);
QueryExpression valueExpression = queryBuilder.createConstantQueryExpression(“name”);
Query accountQuery = queryBuilder.createPatternMatchQuery(propertyExpression,
valueExpression, QueryBuilder.CONTAINS);
RepositoryItem[] repositoryItems = employeeView.executeQuery(accountQuery);
IncludesQuery
RepositoryView employeeView = getRepository().getView(USER);
QueryBuilder queryBuilder = employeeView.getQueryBuilder();
QueryExpression propertyExpression =
queryBuilder.createPropertyQueryExpression("user_id");
QueryExpression valueExpression = queryBuilder.createConstantQueryExpression(ids);
Query employeeQuery = queryBuilder.createIncludesQuery(valueExpression,
propertyExpression);
RepositoryItem[] repositoryItems = employeeView.executeQuery(employeeQuery);
Complex Query
RepositoryView userView = getRepository().getItemDescriptor(USER).getRepositoryView();
QueryBuilder userBuilder = userView.getQueryBuilder();
QueryExpression userType = userBuilder.createPropertyQueryExpression("userType");
QueryExpression two = userBuilder.createConstantQueryExpression(2);
Query userTypeLTTwo = userBuilder.createComparisonQuery(userType, two,
QueryBuilder.LESS_THAN);
QueryExpression login = userBuilder.createPropertyQueryExpression("login");
QueryExpression j = userBuilder.createConstantQueryExpression("j");
Query startsWithJ = userBuilder.createPatternMatchQuery(login, j, QueryBuilder.STARTS_WITH);
Query[] pieces = { userTypeLTTwo, startsWithJ };
Query andQuery = userBuilder.createAndQuery(pieces);
RepositoryItem[] answer = userView.executeQuery(andQuery);
atg.repository.QueryOptions
let you limit the size of the result set,
direct how the result set should be sorted,
precache specified properties
QueryOptions
RepositoryView view = getRepository().getView(USER);
Query query = view.getQueryBuilder().createUnconstrainedQuery();
String[] precachedPropertyNames = { "login", "password" };
SortDirectives sortDirectives = new SortDirectives();
sortDirectives.addDirective(new SortDirective( "login",
SortDirective.DIR_ASCENDING));
RepositoryItem[] items = view.executeQuery(query, new QueryOptions(0, 5,
sortDirectives, precachedPropertyNames));
atg.repository.rql.RqlStatement
RepositoryView view = getRepository().getView(USER);
RqlStatement statement = RqlStatement.parseRqlStatement("lastName
STARTS WITH ?0");
Object params[] = { new String("m") };
RepositoryItem items[] = statement.executeQuery(view, params);
Operation tags
<add-item>
<update-item>
<remove-item> to add or update or remove items
<export-items>
<import-items> to export and import items
<print-item> to print item
<transaction> to maintain transactions while adding or removing items.
Generate DDL
<print-ddl/>
• binstartSQLRepository -m <module-name> -
repository /atg/commerce/catalog/ProductCatalog
-outputSQLFile product_catalog.sql
startSQLRepository
To check what items are in cache
<dump-caches item-descriptors="skuSpecialPriceRules" dump-
type="both"/>
Querying using date or timestamp by
using RQL
date <query-items item-descriptor="order">
creationDate>
date("2011-10-10") and state="SUBMITTED"
</query-items>
Timestamp <query-items item-descriptor="order">
creationDate>
date("2011-10-10 10:00:00 EST") and
state="SUBMITTED"
</query-items>
How to get sysdate in RQL named query?
Repository filtering
• Use the <rql-filter> tag in the definition file for an item descriptor.
• Set the filterQuery property of the item descriptor to a Query object.
• Set the rqlFilterString property of the item descriptor to an RQL string, which is
compiled into the Query object that defines the filter.
<rql-filter>
<item-descriptor name="article">
<rql-filter>
<rql>name starts with ?0 or availabilityDate &lt; ?1</rql>
<param value="n"></param>
<param bean="/myApp.IssueDate"></param>
</rql-filter>
<table name="article" id-column-names="article_id">
<property name="name" />
<property name="date" />
</table>
</item-descriptor>
ATG Advanced RQL

Contenu connexe

Tendances

Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafThymeleaf
 
Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers Kate Semizhon
 
Oracle Endeca 101 Developer Introduction High Level Overview
Oracle Endeca 101 Developer Introduction High Level OverviewOracle Endeca 101 Developer Introduction High Level Overview
Oracle Endeca 101 Developer Introduction High Level OverviewGordon Kiser
 
Spring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesSpring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesVMware Tanzu
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesAshish Saxena
 
javascript objects
javascript objectsjavascript objects
javascript objectsVijay Kalyan
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's GuideKeyur Shah
 
Introdução a Bootstrap 3
Introdução a Bootstrap 3Introdução a Bootstrap 3
Introdução a Bootstrap 3Iago Effting
 
Javascript cheat-sheet-v1
Javascript cheat-sheet-v1Javascript cheat-sheet-v1
Javascript cheat-sheet-v1hccit
 
Implicit objects advance Java
Implicit objects advance JavaImplicit objects advance Java
Implicit objects advance JavaDarshit Metaliya
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentationManav Prasad
 

Tendances (20)

Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Web api
Web apiWeb api
Web api
 
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
 
Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers
 
Spring Data JPA
Spring Data JPASpring Data JPA
Spring Data JPA
 
Flask Basics
Flask BasicsFlask Basics
Flask Basics
 
JQuery UI
JQuery UIJQuery UI
JQuery UI
 
Oracle Endeca 101 Developer Introduction High Level Overview
Oracle Endeca 101 Developer Introduction High Level OverviewOracle Endeca 101 Developer Introduction High Level Overview
Oracle Endeca 101 Developer Introduction High Level Overview
 
Spring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesSpring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutes
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & Guidelines
 
javascript objects
javascript objectsjavascript objects
javascript objects
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's Guide
 
Introdução a Bootstrap 3
Introdução a Bootstrap 3Introdução a Bootstrap 3
Introdução a Bootstrap 3
 
Implicit object.pptx
Implicit object.pptxImplicit object.pptx
Implicit object.pptx
 
Javascript cheat-sheet-v1
Javascript cheat-sheet-v1Javascript cheat-sheet-v1
Javascript cheat-sheet-v1
 
Implicit objects advance Java
Implicit objects advance JavaImplicit objects advance Java
Implicit objects advance Java
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
Spring & hibernate
Spring & hibernateSpring & hibernate
Spring & hibernate
 
Java server pages
Java server pagesJava server pages
Java server pages
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
 

En vedette

ATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your FigertipsATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your FigertipsKeyur Shah
 
Oracle Commerce Using ATG & Endeca - Do It Yourself Series
Oracle Commerce Using ATG & Endeca - Do It Yourself SeriesOracle Commerce Using ATG & Endeca - Do It Yourself Series
Oracle Commerce Using ATG & Endeca - Do It Yourself SeriesKeyur Shah
 
Oracle endeca information discovery architecture
Oracle endeca information discovery architectureOracle endeca information discovery architecture
Oracle endeca information discovery architectureAorta business intelligence
 
ATG Advanced Profile Management
ATG Advanced Profile ManagementATG Advanced Profile Management
ATG Advanced Profile ManagementKate Semizhon
 
Common mistakes for ATG applications that affect performance
Common mistakes for ATG applications that affect performanceCommon mistakes for ATG applications that affect performance
Common mistakes for ATG applications that affect performanceKate Semizhon
 
ATG Commerce: Full Capabilities Overview
ATG Commerce: Full Capabilities OverviewATG Commerce: Full Capabilities Overview
ATG Commerce: Full Capabilities Overviewsobrien15
 
ATG Tutorials - Promotion.
ATG Tutorials - Promotion.ATG Tutorials - Promotion.
ATG Tutorials - Promotion.Sanju Thomas
 

En vedette (8)

ATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your FigertipsATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your Figertips
 
Oracle Commerce Using ATG & Endeca - Do It Yourself Series
Oracle Commerce Using ATG & Endeca - Do It Yourself SeriesOracle Commerce Using ATG & Endeca - Do It Yourself Series
Oracle Commerce Using ATG & Endeca - Do It Yourself Series
 
Oracle endeca information discovery architecture
Oracle endeca information discovery architectureOracle endeca information discovery architecture
Oracle endeca information discovery architecture
 
Endeca
EndecaEndeca
Endeca
 
ATG Advanced Profile Management
ATG Advanced Profile ManagementATG Advanced Profile Management
ATG Advanced Profile Management
 
Common mistakes for ATG applications that affect performance
Common mistakes for ATG applications that affect performanceCommon mistakes for ATG applications that affect performance
Common mistakes for ATG applications that affect performance
 
ATG Commerce: Full Capabilities Overview
ATG Commerce: Full Capabilities OverviewATG Commerce: Full Capabilities Overview
ATG Commerce: Full Capabilities Overview
 
ATG Tutorials - Promotion.
ATG Tutorials - Promotion.ATG Tutorials - Promotion.
ATG Tutorials - Promotion.
 

Similaire à ATG Advanced RQL

Android dev toolbox
Android dev toolboxAndroid dev toolbox
Android dev toolboxShem Magnezi
 
Тарас Олексин - Sculpt! Your! Tests!
Тарас Олексин  - Sculpt! Your! Tests!Тарас Олексин  - Sculpt! Your! Tests!
Тарас Олексин - Sculpt! Your! Tests!DataArt
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...mfrancis
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application DevelopmentChristian Baranowski
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejsNick Lee
 
Simple blog wall creation on Java
Simple blog wall creation on JavaSimple blog wall creation on Java
Simple blog wall creation on JavaMax Titov
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Rob Windsor
 
Architecture Components
Architecture ComponentsArchitecture Components
Architecture ComponentsSang Eel Kim
 
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-finalDavid Lapsley
 
Summer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and ScalaSummer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and Scalarostislav
 
Desenvolvendo Aplicativos Sociais com Rails 3
Desenvolvendo Aplicativos Sociais com Rails 3Desenvolvendo Aplicativos Sociais com Rails 3
Desenvolvendo Aplicativos Sociais com Rails 3Carlos Brando
 
Modularized Persistence - B Zsoldos
Modularized Persistence - B ZsoldosModularized Persistence - B Zsoldos
Modularized Persistence - B Zsoldosmfrancis
 
Web осень 2012 лекция 6
Web осень 2012 лекция 6Web осень 2012 лекция 6
Web осень 2012 лекция 6Technopark
 
Managing parallelism using coroutines
Managing parallelism using coroutinesManaging parallelism using coroutines
Managing parallelism using coroutinesFabio Collini
 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web appsIvano Malavolta
 
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...SPTechCon
 
Web весна 2013 лекция 6
Web весна 2013 лекция 6Web весна 2013 лекция 6
Web весна 2013 лекция 6Technopark
 
Testdrevet javautvikling på objektorienterte skinner
Testdrevet javautvikling på objektorienterte skinnerTestdrevet javautvikling på objektorienterte skinner
Testdrevet javautvikling på objektorienterte skinnerTruls Jørgensen
 

Similaire à ATG Advanced RQL (20)

Android dev toolbox
Android dev toolboxAndroid dev toolbox
Android dev toolbox
 
Requery overview
Requery overviewRequery overview
Requery overview
 
Тарас Олексин - Sculpt! Your! Tests!
Тарас Олексин  - Sculpt! Your! Tests!Тарас Олексин  - Sculpt! Your! Tests!
Тарас Олексин - Sculpt! Your! Tests!
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
Simple blog wall creation on Java
Simple blog wall creation on JavaSimple blog wall creation on Java
Simple blog wall creation on Java
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
 
Architecture Components
Architecture ComponentsArchitecture Components
Architecture Components
 
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final
 
Summer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and ScalaSummer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and Scala
 
Desenvolvendo Aplicativos Sociais com Rails 3
Desenvolvendo Aplicativos Sociais com Rails 3Desenvolvendo Aplicativos Sociais com Rails 3
Desenvolvendo Aplicativos Sociais com Rails 3
 
Modularized Persistence - B Zsoldos
Modularized Persistence - B ZsoldosModularized Persistence - B Zsoldos
Modularized Persistence - B Zsoldos
 
Web осень 2012 лекция 6
Web осень 2012 лекция 6Web осень 2012 лекция 6
Web осень 2012 лекция 6
 
Struts2 - 101
Struts2 - 101Struts2 - 101
Struts2 - 101
 
Managing parallelism using coroutines
Managing parallelism using coroutinesManaging parallelism using coroutines
Managing parallelism using coroutines
 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web apps
 
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
Web весна 2013 лекция 6
Web весна 2013 лекция 6Web весна 2013 лекция 6
Web весна 2013 лекция 6
 
Testdrevet javautvikling på objektorienterte skinner
Testdrevet javautvikling på objektorienterte skinnerTestdrevet javautvikling på objektorienterte skinner
Testdrevet javautvikling på objektorienterte skinner
 

Plus de Kate Semizhon

Seven Facts about Belarus
Seven Facts about BelarusSeven Facts about Belarus
Seven Facts about BelarusKate Semizhon
 
How to improve code quality for iOS apps?
How to improve code quality for iOS apps?How to improve code quality for iOS apps?
How to improve code quality for iOS apps?Kate Semizhon
 
Database Change Management
Database Change ManagementDatabase Change Management
Database Change ManagementKate Semizhon
 
How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase Kate Semizhon
 
Code Review Tool Evaluation
Code Review Tool EvaluationCode Review Tool Evaluation
Code Review Tool EvaluationKate Semizhon
 
SEO Instruments in ATG
SEO Instruments in ATGSEO Instruments in ATG
SEO Instruments in ATGKate Semizhon
 

Plus de Kate Semizhon (12)

Cracking 1-on-1s
Cracking 1-on-1sCracking 1-on-1s
Cracking 1-on-1s
 
Serverless Pitfalls
Serverless PitfallsServerless Pitfalls
Serverless Pitfalls
 
Seven Facts about Belarus
Seven Facts about BelarusSeven Facts about Belarus
Seven Facts about Belarus
 
Git 101
Git 101Git 101
Git 101
 
How to improve code quality for iOS apps?
How to improve code quality for iOS apps?How to improve code quality for iOS apps?
How to improve code quality for iOS apps?
 
Database Change Management
Database Change ManagementDatabase Change Management
Database Change Management
 
Ecommerce in 2018
Ecommerce in 2018Ecommerce in 2018
Ecommerce in 2018
 
How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase
 
Code Review Tool Evaluation
Code Review Tool EvaluationCode Review Tool Evaluation
Code Review Tool Evaluation
 
Sonar Review
Sonar ReviewSonar Review
Sonar Review
 
Unit tests benefits
Unit tests benefitsUnit tests benefits
Unit tests benefits
 
SEO Instruments in ATG
SEO Instruments in ATGSEO Instruments in ATG
SEO Instruments in ATG
 

Dernier

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Dernier (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

ATG Advanced RQL

  • 1. Repository Query Language Repository Queries https://software-engineering-101.com/2016/07/12/atg-repository-queries/
  • 2. RQL generic language for formulating queries that map to any repository implementation, such as SQL or LDAP.
  • 3. Multi-Valued Property Queries • interests INCLUDES "biking“ • interests INCLUDES ANY { "biking", "swimming" } • interests INCLUDES ALL { "biking", "swimming" } • addresses INCLUDES ITEM (zip = "48322" AND state = "MI")
  • 4. RQL RANGE • age > 30 RANGE +10 • age > 30 RANGE 10+ • age > 30 RANGE 40+10
  • 6. ComparisonQuery RepositoryView userView = getRepository().getItemDescriptor(USER).getRepositoryView(); QueryBuilder userBuilder = userView.getQueryBuilder(); QueryExpression userType = userBuilder.createPropertyQueryExpression(USER_TYPE); QueryExpression two = userBuilder.createConstantQueryExpression(USER_TYPE_2); Query userTypeIsTwo = userBuilder.createComparisonQuery(userType, two, QueryBuilder.EQUALS); RepositoryItem[] answer = userView.executeQuery(userTypeIsTwo);
  • 7. PatternMatchQuery RepositoryView employeeView = getRepository().getView(USER); QueryBuilder queryBuilder = employeeView.getQueryBuilder(); QueryExpression propertyExpression = queryBuilder.createPropertyQueryExpression(“login”); QueryExpression valueExpression = queryBuilder.createConstantQueryExpression(“name”); Query accountQuery = queryBuilder.createPatternMatchQuery(propertyExpression, valueExpression, QueryBuilder.CONTAINS); RepositoryItem[] repositoryItems = employeeView.executeQuery(accountQuery);
  • 8. IncludesQuery RepositoryView employeeView = getRepository().getView(USER); QueryBuilder queryBuilder = employeeView.getQueryBuilder(); QueryExpression propertyExpression = queryBuilder.createPropertyQueryExpression("user_id"); QueryExpression valueExpression = queryBuilder.createConstantQueryExpression(ids); Query employeeQuery = queryBuilder.createIncludesQuery(valueExpression, propertyExpression); RepositoryItem[] repositoryItems = employeeView.executeQuery(employeeQuery);
  • 9. Complex Query RepositoryView userView = getRepository().getItemDescriptor(USER).getRepositoryView(); QueryBuilder userBuilder = userView.getQueryBuilder(); QueryExpression userType = userBuilder.createPropertyQueryExpression("userType"); QueryExpression two = userBuilder.createConstantQueryExpression(2); Query userTypeLTTwo = userBuilder.createComparisonQuery(userType, two, QueryBuilder.LESS_THAN); QueryExpression login = userBuilder.createPropertyQueryExpression("login"); QueryExpression j = userBuilder.createConstantQueryExpression("j"); Query startsWithJ = userBuilder.createPatternMatchQuery(login, j, QueryBuilder.STARTS_WITH); Query[] pieces = { userTypeLTTwo, startsWithJ }; Query andQuery = userBuilder.createAndQuery(pieces); RepositoryItem[] answer = userView.executeQuery(andQuery);
  • 10. atg.repository.QueryOptions let you limit the size of the result set, direct how the result set should be sorted, precache specified properties
  • 11. QueryOptions RepositoryView view = getRepository().getView(USER); Query query = view.getQueryBuilder().createUnconstrainedQuery(); String[] precachedPropertyNames = { "login", "password" }; SortDirectives sortDirectives = new SortDirectives(); sortDirectives.addDirective(new SortDirective( "login", SortDirective.DIR_ASCENDING)); RepositoryItem[] items = view.executeQuery(query, new QueryOptions(0, 5, sortDirectives, precachedPropertyNames));
  • 12. atg.repository.rql.RqlStatement RepositoryView view = getRepository().getView(USER); RqlStatement statement = RqlStatement.parseRqlStatement("lastName STARTS WITH ?0"); Object params[] = { new String("m") }; RepositoryItem items[] = statement.executeQuery(view, params);
  • 13. Operation tags <add-item> <update-item> <remove-item> to add or update or remove items <export-items> <import-items> to export and import items <print-item> to print item <transaction> to maintain transactions while adding or removing items.
  • 14. Generate DDL <print-ddl/> • binstartSQLRepository -m <module-name> - repository /atg/commerce/catalog/ProductCatalog -outputSQLFile product_catalog.sql startSQLRepository
  • 15. To check what items are in cache <dump-caches item-descriptors="skuSpecialPriceRules" dump- type="both"/>
  • 16. Querying using date or timestamp by using RQL date <query-items item-descriptor="order"> creationDate> date("2011-10-10") and state="SUBMITTED" </query-items> Timestamp <query-items item-descriptor="order"> creationDate> date("2011-10-10 10:00:00 EST") and state="SUBMITTED" </query-items>
  • 17. How to get sysdate in RQL named query?
  • 18. Repository filtering • Use the <rql-filter> tag in the definition file for an item descriptor. • Set the filterQuery property of the item descriptor to a Query object. • Set the rqlFilterString property of the item descriptor to an RQL string, which is compiled into the Query object that defines the filter.
  • 19. <rql-filter> <item-descriptor name="article"> <rql-filter> <rql>name starts with ?0 or availabilityDate &lt; ?1</rql> <param value="n"></param> <param bean="/myApp.IssueDate"></param> </rql-filter> <table name="article" id-column-names="article_id"> <property name="name" /> <property name="date" /> </table> </item-descriptor>

Notes de l'éditeur

  1. Logical operators and the MATCH and MATCHES operators (described in the later section Full Text Search Queries) should only be applied to scalar properties. Another set of queries can be applied to arrays or collections of scalar values—for example, properties of type int[], or Set of Strings. <query-items item-descriptor="user">secondaryAddresses INCLUDES "se-980040"</query-items> <query-items item-descriptor="user">secondaryAddresses INCLUDES ITEM (postalCode= "02631" AND country= "US")</query-items>
  2. age > 30 RANGE 10+ This causes the first 10 results to be skipped, and the remaining results to be returned.
  3. http://atgkid.blogspot.com/2011/10/using-atg-development-operation-tags.html If you have created a new repository or new item-descriptor in reposiotry in your module. To generate ddl,just start the instance (ignore table missing errors). Once instance is up, go to that particular repository in dynamo component browser (/dyn/admin/) In "Run XML Operation Tags on the Repository"
  4. Set the filterQuery property of the item descriptor to a Query created by the same repository. Do this by creating a Query object and calling GSAItemDescriptor.setFilterQuery() on it. Set the item descriptor’s rqlFilterString to an RQL string that expresses the query. If the filterQuery property of the item descriptor is null, the SQL repository tries to use the rqlFilterString and compile it into the filter query. If both properties are null, filtering is disabled.