SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Specificity and CSS Selectors
Specificity and CSS SelectorsSpecificity and CSS Selectors
Specificity and CSS Selectors
 
Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introduction
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
 
Logging, Serilog, Structured Logging, Seq
Logging, Serilog, Structured Logging, SeqLogging, Serilog, Structured Logging, Seq
Logging, Serilog, Structured Logging, Seq
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'ts
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Swagger - make your API accessible
Swagger - make your API accessibleSwagger - make your API accessible
Swagger - make your API accessible
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
 
Understanding JWT Exploitation
Understanding JWT ExploitationUnderstanding JWT Exploitation
Understanding JWT Exploitation
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top Ten
 
jQuery
jQueryjQuery
jQuery
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 
Microservices Security
Microservices SecurityMicroservices Security
Microservices Security
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
Ajax Presentation
Ajax PresentationAjax Presentation
Ajax Presentation
 

Destaque

Destaque (10)

Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers
 
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
 
Oracle eCommerce (ATG) Database Best Practices
Oracle eCommerce (ATG) Database  Best Practices Oracle eCommerce (ATG) Database  Best Practices
Oracle eCommerce (ATG) Database Best Practices
 
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.
 

Semelhante a ATG Advanced RQL

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
 
Simple blog wall creation on Java
Simple blog wall creation on JavaSimple blog wall creation on Java
Simple blog wall creation on Java
Max Titov
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
Rob Windsor
 
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final
David Lapsley
 
Modularized Persistence - B Zsoldos
Modularized Persistence - B ZsoldosModularized Persistence - B Zsoldos
Modularized Persistence - B Zsoldos
mfrancis
 
Web осень 2012 лекция 6
Web осень 2012 лекция 6Web осень 2012 лекция 6
Web осень 2012 лекция 6
Technopark
 
Web весна 2013 лекция 6
Web весна 2013 лекция 6Web весна 2013 лекция 6
Web весна 2013 лекция 6
Technopark
 
Testdrevet javautvikling på objektorienterte skinner
Testdrevet javautvikling på objektorienterte skinnerTestdrevet javautvikling på objektorienterte skinner
Testdrevet javautvikling på objektorienterte skinner
Truls Jørgensen
 

Semelhante a 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
 

Mais de Kate Semizhon

Mais 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
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

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>

Notas do Editor

  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.