SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Modularized Persistence 
Balázs Zsoldos
History of NoSQL by Mark Madse n, Picture published by Edd Dumbill
Blueprint 
+ 
JPA 
+ 
JSF 
Declarative 
Services 
+ 
Modularized 
Persistence 
+ 
JSF 
ECM 
+ 
Modularized 
Persistence 
+ 
JSF 
ECM 
+ 
Modularized 
Persistence 
+ 
Modularized 
Web 
Declarative 
Services 
+ 
JPA 
+ 
JSF
Stefan Seifert – Apache Sling & Friends Tech Meetup, Berlin 2012
JDBC Driver 
(DataSourceFactory)
DSF Component 
(XADataSource) 
JDBC Driver 
(DataSourceFactory)
DBCP Component 
(DataSource) 
DSF Component 
(XADataSource) 
JDBC Driver 
(DataSourceFactory)
??? 
DBCP Component 
(DataSource) 
DSF Component 
(XADataSource) 
JDBC Driver 
(DataSourceFactory)
Liquibase DataSource Component 
(DataSource) 
DBCP Component 
(DataSource) 
DSF Component 
(XADataSource) 
JDBC Driver 
(DataSourceFactory)
<databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" 
logicalFilePath="org.everit.osgi.resource.ri.schema" 
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog 
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd"> 
<changeSet id="1.0.0" author="everit"> 
<createTable tableName="res_resource"> 
<column name="resource_id" type="bigint" autoIncrement="true"> 
<constraints primaryKeyName="pk_res_resource" primaryKey="true" 
nullable="false" /> 
</column> 
</createTable> 
</changeSet> 
</databaseChangeLog>
Provide-Capability: liquibase.schema;name="org.everit.osgi.resource.ri"; 
resource="/META-INF/liquibase/resource.ri.liquibase.xml" 
Provide-Capability: 
liquibase.schema; 
name="org.everit.osgi.resource.ri"; 
resource="/META-INF/liquibase/resource.ri.liquibase.xml";
Business Component Business Component Business Component 
Querydsl Querydsl Querydsl 
Liquibase DataSource Component 
(DataSource) 
DBCP Component 
(DataSource) 
DSF Component 
(XADataSource) 
JDBC Driver 
(DataSourceFactory)
Examples from http://querydsl.com
Write Liquibase changelog 
Write LQMG file 
Add LQMG to the Capability 
Add inclusions 
Generate Querydsl Metadata
<lqmg xmlns="http://everit.org/lqmg" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
defaultPackage="org.everit.osgi.resource.ri.schema.qdsl"> 
<namingRules> 
<classNameRule> 
<entity>res_resource</entity> 
<class>Resource</class> 
<propertyMappings> 
<primaryKey> 
<name>pk_res_resource</name> 
<property>resourcePk</property> 
</primaryKey> 
</propertyMappings> 
</classNameRule> 
</namingRules> 
</lqmg>
Write Liquibase changelog 
Write LQMG file 
Add LQMG to the Capability 
Add inclusions 
Generate Querydsl Metadata
Provide-Capability: liquibase.schema;name="org.everit.osgi.resource.ri"; 
resource="/META-INF/liquibase/resource.ri.liquibase.xml" 
Provide-Capability: 
liquibase.schema; 
name="org.everit.osgi.resource.ri"; 
resource="/META-INF/liquibase/resource.ri.liquibase.xml";
Provide-Capability: liquibase.schema;name="org.everit.osgi.resource.ri"; 
resource="/META-INF/liquibase/resource.ri.liquibase.xml";lqmg.config.re 
source="/META-INF/liquibase/resource.ri.lqmg.xml" 
Provide-Capability: 
liquibase.schema; 
name="org.everit.osgi.resource.ri"; 
resource="/META-INF/liquibase/resource.ri.liquibase.xml"; 
lqmg.config.resource="/META-INF/liquibase/resource.ri.lqmg.xml"
Write Liquibase changelog 
Write LQMG file 
Add LQMG to the Capability 
Add inclusions 
Generate Querydsl Metadata
<databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" logicalFilePath="org.everit.osgi.authorization.ri.schema" 
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" 
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd 
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"> 
<include file="eosgi:org.everit.osgi.resource.ri" /> 
<include file="eosgi:org.everit.osgi.props.ri" /> 
<include file="eosgi:org.everit.osgi.resource.ri" /> 
include file="eosgi:org.everit.osgi.props.ri" /> 
<changeSet id="1.0.0" author="everit"> 
<createTable tableName="authr_permission"> 
<column name="authorized_resource_id" type="bigint"> 
<constraints nullable="false" foreignKeyName="fk_res_r_authr_p_a" referencedTableName="res_resource" 
referencedColumnNames="resource_id" /> 
</column> 
<column name="target_resource_id" type="bigint"> 
<constraints nullable="false" foreignKeyName="fk_res_r_authr_p_t" referencedTableName="res_resource" 
referencedColumnNames="resource_id" /> 
</column> 
<column name="action_" type="varchar(255)"> 
<constraints nullable="false" /> 
</column> 
</createTable> 
<addPrimaryKey constraintName="pk_authr_perm" tableName="authr_permission" 
columnNames="authorized_resource_id,target_resource_id,action_" /> 
<createTable tableName="authr_permission_inheritance"> 
<column name="parent_resource_id" type="bigint"> 
<constraints nullable="false" foreignKeyName="fk_res_r_authr_pi_p" referencedTableName="res_resource" 
referencedColumnNames="resource_id" /> 
</column> 
<column name="child_resource_id" type="bigint"> 
<constraints nullable="false" foreignKeyName="fk_res_r_authr_pi_c" referencedTableName="res_resource" 
referencedColumnNames="resource_id" /> 
</column> 
</createTable> 
<addPrimaryKey constraintName="pk_authr_perm_inheritance" tableName="authr_permission_inheritance" 
columnNames="parent_resource_id,child_resource_id" /> 
</changeSet> 
</databaseChangeLog>
Resource 
Authorization 
Provide-Capability: 
liquibase.schema; 
name="org.everit.osgi.resource.ri"; ... 
Require-Capability: 
liquibase.schema; 
filter:=(name=org.everit.osgi.resource.ri) 
<databaseChangeLog ...> 
<include file="eosgi:org.everit.osgi.resource.ri" /> 
... 
</databaseChangeLog>
Write Liquibase changelog 
Write LQMG file 
Add LQMG to the Capability 
Add inclusions 
Generate Querydsl Metadata
LQMG 
Start embedded 
OSGi container 
Deploy modules 
Start embedded 
H2 database 
Initialize database 
schema 
Generate Querydsl 
Metadata 
Evil magic here!!! 
If Capability is not found after 
deployments, unsatisfied 
bundles are enhanced in the 
way that unsatisfied 
requirements are marked to be 
optional.
Use-cases???
Monoholitic 
Portal 
(v5.1.2) 
Authorization 
Authentication 
User 
Documents 
Articles 
SiteMap 
Blog 
Modularized 
Portal 
Authorization (v1.1.0) 
Authentication (v2.0.0) 
User (v1.3.2) 
Documents (v1.0.1) 
Articles (v3.0.14) 
SiteMap (v1.0.3) 
Blog (v2.11.0)
User 
User Address 
User Address Country 
User Address Country 
Company
REAL PROJECT!!!
Authorization
Permission 
Resource 
● resource_id 
● authorized_resource_id 
● action 
● target_resource_id 
Permission Inheritance 
● parent_resource_id 
● child_resource_id
SELECT ... 
FROM document d 
JOIN document.attachment a 
WHERE … 
LIMIT 10 OFFSET 1000; 
EXISTS(SELECT 1 FROM permission p 
WHERE p.authorized_resource_id IN (?, …, ?) 
AND p.target_resource_id = d.resource_id 
AND action = ?) 
SELECT ... 
FROM document d 
JOIN document.attachment a 
WHERE EXISTS(SELECT 1 FROM permission p 
WHERE p.authorized_resource_id IN (?, …, ?) 
AND p.target_resource_id = d.resource_id 
AND action = ?) 
AND … 
LIMIT 10 OFFSET 1000;
@Override 
public BooleanExpression authorizationPredicate(final long authorizedResourceId, 
final Expression<Long> targetResourceId, final String... actions) { 
if (authorizedResourceId == systemResourceId) { 
return BooleanTemplate.TRUE; 
} 
Objects.requireNonNull(targetResourceId, "Parameter targetResourceId must not be null"); 
validateActionsParameter(actions); 
long[] authorizationScope = getAuthorizationScope(authorizedResourceId); 
SQLSubQuery subQuery = new SQLSubQuery(); 
QPermission permission = QPermission.permission; 
BooleanExpression authorizedResourceIdPredicate; 
if (authorizationScope.length == 1) { 
authorizedResourceIdPredicate = permission.authorizedResourceId.eq(authorizationScope[0]); 
} else { 
// More than one as the scope contains at least one value (other branch) 
Long[] authorizationScopeLongArray = new Long[authorizationScope.length]; 
for (int i = 0, n = authorizationScope.length; i < n; i++) { 
if (authorizationScope[i] == systemResourceId) { 
return BooleanTemplate.TRUE; 
} 
authorizationScopeLongArray[i] = authorizationScope[i]; 
} 
authorizedResourceIdPredicate = permission.authorizedResourceId.in(authorizationScopeLongArray); 
} 
BooleanExpression actionPredicate = null; 
if (actions.length == 1) { 
actionPredicate = permission.action.eq(actions[0]); 
} else { 
actionPredicate = permission.action.in(actions); 
} 
return subQuery.from(permission) 
.where(permission.targetResourceId.eq(targetResourceId).and( 
actionPredicate.and(authorizedResourceIdPredicate))) 
.exists(); 
}
SQLQuery query = new SQLQuery(connection, configuration); 
QDocument document = new QDocument("d"); 
BooleanExpression permissionCheckPredicate = authorizationQdslUtil 
.authorizationPredicate(userId, document.resourceId, actions); 
List<Long> list = query.from(document).where(permissionCheckPredicate) 
.list(document.documentId);
Business Component Business Component Business Component 
Querydsl Querydsl Querydsl 
Liquibase DataSource Component 
(DataSource) 
DBCP Component 
(DataSource) 
DSF Component 
(XADataSource) 
JDBC Driver 
(DataSourceFactory) 
QuerydslSupport 
Querydsl 
Configuration 
Querydsl 
SQLTemplates
@Reference(name = "querydslSupport", bind = "setQdsl") 
private QuerydslSupport qdsl; 
public void setQdsl(QuerydslSupport qdsl) { 
public List<Long> listDocumentIds() { 
return qdsl.execute((connection, configuration) -> { 
SQLQuery query = new SQLQuery(connection, configuration); 
QDocument document = new QDocument("d"); 
BooleanExpression permissionCheckPredicate = authorizationQdslUtil 
.authorizationPredicate(a1, document.resourceId, actions); 
List<Long> list = query.from(document).where(permissionCheckPredicate) 
.list(document.documentId); 
} 
} 
this.qdsl = qdsl; 
}
Business Component Business Component Business Component 
Querydsl Querydsl Querydsl 
Liquibase DataSource Component 
(DataSource) 
DBCP Component 
(DataSource) 
DSF Component 
(XADataSource) 
JDBC Driver 
(DataSourceFactory) 
QuerydslSupport 
Querydsl 
Configuration 
Querydsl 
SQLTemplates 
Transaction Helper
public long saveUser(String firstName, String lastName) { 
Objects.requireNonNull(firstName); 
Objects.requireNonNull(lastName); 
return transactionHelper.required(() -> { 
// Logic that should be implemented 
return 0l; 
}); 
}
Caching 
● Available Cache modules: cache-api, cache-infinispan, 
cache-noop 
● Caching should be done in the persistent module 
by the programmer, who knows the business logic 
● Caching and table updates should be done within 
the same component 
● In case bulk update is done in another module, 
cache must be cleared
OpenSource modules 
● Resource 
● Authorization 
● Authentication 
● Property Manager 
● Blobstore (Before review) 
● Audit (Before review)
Roadmap
HTML Output 
LQMG / Maven 
H2 
Liquibase schema 
(Bundle-Capability) 
HTML
Manual Schema update 
LQMG / Maven 
Database 
Liquibase schema 
(Bundle-Capability) 
Generate Schema
Manual Schema generation 
Webconsole plugin 
DataSource 
(OSGi service) 
Liquibase schema 
(Bundle-Capability) 
Generate Schema 
Custom User / Password
Dump SQL file 
Webconsole plugin 
DataSource 
(OSGi service) 
Liquibase schema 
(Bundle-Capability) 
SQL
LQMG extension in changelog.xml 
<databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" 
logicalFilePath="org.everit.osgi.resource.ri.schema" 
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" 
xmlns:lqmg="http://everit.org/xml/ns/lqmg" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog 
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd"> 
<changeSet id="1.0.0" author="everit"> 
<createTable tableName="res_resource" lqmg:class="QResource"> 
<column name="resource_id" type="bigint" autoIncrement="true" 
lqmg:property="resourceId"> 
<constraints primaryKeyName="pk_res_resource" primaryKey="true" 
nullable="false" /> 
</column> 
</createTable> 
</changeSet> 
</databaseChangeLog>
Full Text Search 
● Analize the different solutions 
– H2 → Lucene 
– MySQL → Sphinx 
– PostgreSQL → TSearch2 
– SQL Server →??? 
– Oracle → Oracle Text 
● Create a common API for Querydsl based query 
extension 
● Create a module for each database engine
Querydsl: http://www.querydsl.com/ 
Liquibase: http://www.liquibase.org/ 
Liquibase OSGi Bundle: https://github.com/everit-org/osgi-liquibase-bundle 
LQMG: https://github.com/everit-org/osgi-lqmg 
LQMG Maven Plugin: http://www.everit.org/lqmg-maven-plugin/ 
Liquibase DataSource: https://github.com/everit-org/osgi-liquibase-datasource 
Querydsl SQLTemplates Component: https://github.com/everit-org/osgi-querydsl-templates 
Querydsl Configuration Component: https://github.com/everit-org/osgi-querydsl-configuration 
Querydsl Support Component: https://github.com/everit-org/osgi-querydsl-support 
Cookbook chapter: http://cookbook.everit.org/persistence/index.html 
Download from Maven central 
Resource: https://github.com/everit-org/resource-ri 
Authorization: https://github.com/everit-org/authorization-ri 
Authentication: https://github.com/everit-org/authentication-simple 
Property Manager: https://github.com/everit-org/property-manager-ri 
Twitter: @EveritOrg

Weitere ähnliche Inhalte

Was ist angesagt?

Symfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMSymfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODM
Jonathan Wage
 
ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODM
Jonathan Wage
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf Conference
 
Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)
nyccamp
 
Jpa queries
Jpa queriesJpa queries
Jpa queries
gedoplan
 

Was ist angesagt? (20)

Temporary Cache Assistance (Transients API): WordCamp Phoenix 2014
Temporary Cache Assistance (Transients API): WordCamp Phoenix 2014Temporary Cache Assistance (Transients API): WordCamp Phoenix 2014
Temporary Cache Assistance (Transients API): WordCamp Phoenix 2014
 
Symfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMSymfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODM
 
Doctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperDoctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document Mapper
 
Recent Changes to jQuery's Internals
Recent Changes to jQuery's InternalsRecent Changes to jQuery's Internals
Recent Changes to jQuery's Internals
 
ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODM
 
HTML5 - Pedro Rosa
HTML5 - Pedro RosaHTML5 - Pedro Rosa
HTML5 - Pedro Rosa
 
CakePHP workshop
CakePHP workshopCakePHP workshop
CakePHP workshop
 
Jquery examples
Jquery examplesJquery examples
Jquery examples
 
Temporary Cache Assistance (Transients API): WordCamp Birmingham 2014
Temporary Cache Assistance (Transients API): WordCamp Birmingham 2014Temporary Cache Assistance (Transients API): WordCamp Birmingham 2014
Temporary Cache Assistance (Transients API): WordCamp Birmingham 2014
 
Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0
 
PHPUnit elevato alla Symfony2
PHPUnit elevato alla Symfony2PHPUnit elevato alla Symfony2
PHPUnit elevato alla Symfony2
 
JavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New WorldJavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New World
 
PHP Data Objects
PHP Data ObjectsPHP Data Objects
PHP Data Objects
 
Securing Java EE apps using WildFly Elytron
Securing Java EE apps using WildFly ElytronSecuring Java EE apps using WildFly Elytron
Securing Java EE apps using WildFly Elytron
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
What's new in Java EE 7
What's new in Java EE 7What's new in Java EE 7
What's new in Java EE 7
 
Advance MySQL Docstore Features
Advance MySQL Docstore FeaturesAdvance MySQL Docstore Features
Advance MySQL Docstore Features
 
Managing a shared mysql farm dpc11
Managing a shared mysql farm dpc11Managing a shared mysql farm dpc11
Managing a shared mysql farm dpc11
 
Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)
 
Jpa queries
Jpa queriesJpa queries
Jpa queries
 

Ähnlich wie Modularized Persistence - B Zsoldos

After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
yangdj
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver
yangdj
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
 
Django Class-based views (Slovenian)
Django Class-based views (Slovenian)Django Class-based views (Slovenian)
Django Class-based views (Slovenian)
Luka Zakrajšek
 

Ähnlich wie Modularized Persistence - B Zsoldos (20)

Spring data iii
Spring data iiiSpring data iii
Spring data iii
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
Client-side Rendering with AngularJS
Client-side Rendering with AngularJSClient-side Rendering with AngularJS
Client-side Rendering with AngularJS
 
Asynchronous Interfaces
Asynchronous InterfacesAsynchronous Interfaces
Asynchronous Interfaces
 
jQuery
jQueryjQuery
jQuery
 
Rails is not just Ruby
Rails is not just RubyRails is not just Ruby
Rails is not just Ruby
 
How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF
 
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
 
How te bring common UI patterns to ADF
How te bring common UI patterns to ADFHow te bring common UI patterns to ADF
How te bring common UI patterns to ADF
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and Performance
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
JS-05-Handlebars.ppt
JS-05-Handlebars.pptJS-05-Handlebars.ppt
JS-05-Handlebars.ppt
 
Create a res tful services api in php.
Create a res tful services api in php.Create a res tful services api in php.
Create a res tful services api in php.
 
Flask and Angular: An approach to build robust platforms
Flask and Angular:  An approach to build robust platformsFlask and Angular:  An approach to build robust platforms
Flask and Angular: An approach to build robust platforms
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
Django Class-based views (Slovenian)
Django Class-based views (Slovenian)Django Class-based views (Slovenian)
Django Class-based views (Slovenian)
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in Swift
 

Mehr von mfrancis

Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
mfrancis
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
mfrancis
 

Mehr von mfrancis (20)

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)
 

Kürzlich hochgeladen

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
 

Kürzlich hochgeladen (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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 🐘
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
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
 
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
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 

Modularized Persistence - B Zsoldos

  • 2. History of NoSQL by Mark Madse n, Picture published by Edd Dumbill
  • 3. Blueprint + JPA + JSF Declarative Services + Modularized Persistence + JSF ECM + Modularized Persistence + JSF ECM + Modularized Persistence + Modularized Web Declarative Services + JPA + JSF
  • 4. Stefan Seifert – Apache Sling & Friends Tech Meetup, Berlin 2012
  • 6. DSF Component (XADataSource) JDBC Driver (DataSourceFactory)
  • 7.
  • 8. DBCP Component (DataSource) DSF Component (XADataSource) JDBC Driver (DataSourceFactory)
  • 9.
  • 10. ??? DBCP Component (DataSource) DSF Component (XADataSource) JDBC Driver (DataSourceFactory)
  • 11. Liquibase DataSource Component (DataSource) DBCP Component (DataSource) DSF Component (XADataSource) JDBC Driver (DataSourceFactory)
  • 12.
  • 13. <databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" logicalFilePath="org.everit.osgi.resource.ri.schema" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd"> <changeSet id="1.0.0" author="everit"> <createTable tableName="res_resource"> <column name="resource_id" type="bigint" autoIncrement="true"> <constraints primaryKeyName="pk_res_resource" primaryKey="true" nullable="false" /> </column> </createTable> </changeSet> </databaseChangeLog>
  • 14. Provide-Capability: liquibase.schema;name="org.everit.osgi.resource.ri"; resource="/META-INF/liquibase/resource.ri.liquibase.xml" Provide-Capability: liquibase.schema; name="org.everit.osgi.resource.ri"; resource="/META-INF/liquibase/resource.ri.liquibase.xml";
  • 15. Business Component Business Component Business Component Querydsl Querydsl Querydsl Liquibase DataSource Component (DataSource) DBCP Component (DataSource) DSF Component (XADataSource) JDBC Driver (DataSourceFactory)
  • 17. Write Liquibase changelog Write LQMG file Add LQMG to the Capability Add inclusions Generate Querydsl Metadata
  • 18. <lqmg xmlns="http://everit.org/lqmg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" defaultPackage="org.everit.osgi.resource.ri.schema.qdsl"> <namingRules> <classNameRule> <entity>res_resource</entity> <class>Resource</class> <propertyMappings> <primaryKey> <name>pk_res_resource</name> <property>resourcePk</property> </primaryKey> </propertyMappings> </classNameRule> </namingRules> </lqmg>
  • 19. Write Liquibase changelog Write LQMG file Add LQMG to the Capability Add inclusions Generate Querydsl Metadata
  • 20. Provide-Capability: liquibase.schema;name="org.everit.osgi.resource.ri"; resource="/META-INF/liquibase/resource.ri.liquibase.xml" Provide-Capability: liquibase.schema; name="org.everit.osgi.resource.ri"; resource="/META-INF/liquibase/resource.ri.liquibase.xml";
  • 21. Provide-Capability: liquibase.schema;name="org.everit.osgi.resource.ri"; resource="/META-INF/liquibase/resource.ri.liquibase.xml";lqmg.config.re source="/META-INF/liquibase/resource.ri.lqmg.xml" Provide-Capability: liquibase.schema; name="org.everit.osgi.resource.ri"; resource="/META-INF/liquibase/resource.ri.liquibase.xml"; lqmg.config.resource="/META-INF/liquibase/resource.ri.lqmg.xml"
  • 22. Write Liquibase changelog Write LQMG file Add LQMG to the Capability Add inclusions Generate Querydsl Metadata
  • 23. <databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" logicalFilePath="org.everit.osgi.authorization.ri.schema" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"> <include file="eosgi:org.everit.osgi.resource.ri" /> <include file="eosgi:org.everit.osgi.props.ri" /> <include file="eosgi:org.everit.osgi.resource.ri" /> include file="eosgi:org.everit.osgi.props.ri" /> <changeSet id="1.0.0" author="everit"> <createTable tableName="authr_permission"> <column name="authorized_resource_id" type="bigint"> <constraints nullable="false" foreignKeyName="fk_res_r_authr_p_a" referencedTableName="res_resource" referencedColumnNames="resource_id" /> </column> <column name="target_resource_id" type="bigint"> <constraints nullable="false" foreignKeyName="fk_res_r_authr_p_t" referencedTableName="res_resource" referencedColumnNames="resource_id" /> </column> <column name="action_" type="varchar(255)"> <constraints nullable="false" /> </column> </createTable> <addPrimaryKey constraintName="pk_authr_perm" tableName="authr_permission" columnNames="authorized_resource_id,target_resource_id,action_" /> <createTable tableName="authr_permission_inheritance"> <column name="parent_resource_id" type="bigint"> <constraints nullable="false" foreignKeyName="fk_res_r_authr_pi_p" referencedTableName="res_resource" referencedColumnNames="resource_id" /> </column> <column name="child_resource_id" type="bigint"> <constraints nullable="false" foreignKeyName="fk_res_r_authr_pi_c" referencedTableName="res_resource" referencedColumnNames="resource_id" /> </column> </createTable> <addPrimaryKey constraintName="pk_authr_perm_inheritance" tableName="authr_permission_inheritance" columnNames="parent_resource_id,child_resource_id" /> </changeSet> </databaseChangeLog>
  • 24. Resource Authorization Provide-Capability: liquibase.schema; name="org.everit.osgi.resource.ri"; ... Require-Capability: liquibase.schema; filter:=(name=org.everit.osgi.resource.ri) <databaseChangeLog ...> <include file="eosgi:org.everit.osgi.resource.ri" /> ... </databaseChangeLog>
  • 25. Write Liquibase changelog Write LQMG file Add LQMG to the Capability Add inclusions Generate Querydsl Metadata
  • 26. LQMG Start embedded OSGi container Deploy modules Start embedded H2 database Initialize database schema Generate Querydsl Metadata Evil magic here!!! If Capability is not found after deployments, unsatisfied bundles are enhanced in the way that unsatisfied requirements are marked to be optional.
  • 28. Monoholitic Portal (v5.1.2) Authorization Authentication User Documents Articles SiteMap Blog Modularized Portal Authorization (v1.1.0) Authentication (v2.0.0) User (v1.3.2) Documents (v1.0.1) Articles (v3.0.14) SiteMap (v1.0.3) Blog (v2.11.0)
  • 29. User User Address User Address Country User Address Country Company
  • 32. Permission Resource ● resource_id ● authorized_resource_id ● action ● target_resource_id Permission Inheritance ● parent_resource_id ● child_resource_id
  • 33. SELECT ... FROM document d JOIN document.attachment a WHERE … LIMIT 10 OFFSET 1000; EXISTS(SELECT 1 FROM permission p WHERE p.authorized_resource_id IN (?, …, ?) AND p.target_resource_id = d.resource_id AND action = ?) SELECT ... FROM document d JOIN document.attachment a WHERE EXISTS(SELECT 1 FROM permission p WHERE p.authorized_resource_id IN (?, …, ?) AND p.target_resource_id = d.resource_id AND action = ?) AND … LIMIT 10 OFFSET 1000;
  • 34. @Override public BooleanExpression authorizationPredicate(final long authorizedResourceId, final Expression<Long> targetResourceId, final String... actions) { if (authorizedResourceId == systemResourceId) { return BooleanTemplate.TRUE; } Objects.requireNonNull(targetResourceId, "Parameter targetResourceId must not be null"); validateActionsParameter(actions); long[] authorizationScope = getAuthorizationScope(authorizedResourceId); SQLSubQuery subQuery = new SQLSubQuery(); QPermission permission = QPermission.permission; BooleanExpression authorizedResourceIdPredicate; if (authorizationScope.length == 1) { authorizedResourceIdPredicate = permission.authorizedResourceId.eq(authorizationScope[0]); } else { // More than one as the scope contains at least one value (other branch) Long[] authorizationScopeLongArray = new Long[authorizationScope.length]; for (int i = 0, n = authorizationScope.length; i < n; i++) { if (authorizationScope[i] == systemResourceId) { return BooleanTemplate.TRUE; } authorizationScopeLongArray[i] = authorizationScope[i]; } authorizedResourceIdPredicate = permission.authorizedResourceId.in(authorizationScopeLongArray); } BooleanExpression actionPredicate = null; if (actions.length == 1) { actionPredicate = permission.action.eq(actions[0]); } else { actionPredicate = permission.action.in(actions); } return subQuery.from(permission) .where(permission.targetResourceId.eq(targetResourceId).and( actionPredicate.and(authorizedResourceIdPredicate))) .exists(); }
  • 35. SQLQuery query = new SQLQuery(connection, configuration); QDocument document = new QDocument("d"); BooleanExpression permissionCheckPredicate = authorizationQdslUtil .authorizationPredicate(userId, document.resourceId, actions); List<Long> list = query.from(document).where(permissionCheckPredicate) .list(document.documentId);
  • 36. Business Component Business Component Business Component Querydsl Querydsl Querydsl Liquibase DataSource Component (DataSource) DBCP Component (DataSource) DSF Component (XADataSource) JDBC Driver (DataSourceFactory) QuerydslSupport Querydsl Configuration Querydsl SQLTemplates
  • 37. @Reference(name = "querydslSupport", bind = "setQdsl") private QuerydslSupport qdsl; public void setQdsl(QuerydslSupport qdsl) { public List<Long> listDocumentIds() { return qdsl.execute((connection, configuration) -> { SQLQuery query = new SQLQuery(connection, configuration); QDocument document = new QDocument("d"); BooleanExpression permissionCheckPredicate = authorizationQdslUtil .authorizationPredicate(a1, document.resourceId, actions); List<Long> list = query.from(document).where(permissionCheckPredicate) .list(document.documentId); } } this.qdsl = qdsl; }
  • 38. Business Component Business Component Business Component Querydsl Querydsl Querydsl Liquibase DataSource Component (DataSource) DBCP Component (DataSource) DSF Component (XADataSource) JDBC Driver (DataSourceFactory) QuerydslSupport Querydsl Configuration Querydsl SQLTemplates Transaction Helper
  • 39. public long saveUser(String firstName, String lastName) { Objects.requireNonNull(firstName); Objects.requireNonNull(lastName); return transactionHelper.required(() -> { // Logic that should be implemented return 0l; }); }
  • 40. Caching ● Available Cache modules: cache-api, cache-infinispan, cache-noop ● Caching should be done in the persistent module by the programmer, who knows the business logic ● Caching and table updates should be done within the same component ● In case bulk update is done in another module, cache must be cleared
  • 41. OpenSource modules ● Resource ● Authorization ● Authentication ● Property Manager ● Blobstore (Before review) ● Audit (Before review)
  • 43. HTML Output LQMG / Maven H2 Liquibase schema (Bundle-Capability) HTML
  • 44.
  • 45. Manual Schema update LQMG / Maven Database Liquibase schema (Bundle-Capability) Generate Schema
  • 46. Manual Schema generation Webconsole plugin DataSource (OSGi service) Liquibase schema (Bundle-Capability) Generate Schema Custom User / Password
  • 47. Dump SQL file Webconsole plugin DataSource (OSGi service) Liquibase schema (Bundle-Capability) SQL
  • 48. LQMG extension in changelog.xml <databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" logicalFilePath="org.everit.osgi.resource.ri.schema" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:lqmg="http://everit.org/xml/ns/lqmg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd"> <changeSet id="1.0.0" author="everit"> <createTable tableName="res_resource" lqmg:class="QResource"> <column name="resource_id" type="bigint" autoIncrement="true" lqmg:property="resourceId"> <constraints primaryKeyName="pk_res_resource" primaryKey="true" nullable="false" /> </column> </createTable> </changeSet> </databaseChangeLog>
  • 49. Full Text Search ● Analize the different solutions – H2 → Lucene – MySQL → Sphinx – PostgreSQL → TSearch2 – SQL Server →??? – Oracle → Oracle Text ● Create a common API for Querydsl based query extension ● Create a module for each database engine
  • 50. Querydsl: http://www.querydsl.com/ Liquibase: http://www.liquibase.org/ Liquibase OSGi Bundle: https://github.com/everit-org/osgi-liquibase-bundle LQMG: https://github.com/everit-org/osgi-lqmg LQMG Maven Plugin: http://www.everit.org/lqmg-maven-plugin/ Liquibase DataSource: https://github.com/everit-org/osgi-liquibase-datasource Querydsl SQLTemplates Component: https://github.com/everit-org/osgi-querydsl-templates Querydsl Configuration Component: https://github.com/everit-org/osgi-querydsl-configuration Querydsl Support Component: https://github.com/everit-org/osgi-querydsl-support Cookbook chapter: http://cookbook.everit.org/persistence/index.html Download from Maven central Resource: https://github.com/everit-org/resource-ri Authorization: https://github.com/everit-org/authorization-ri Authentication: https://github.com/everit-org/authentication-simple Property Manager: https://github.com/everit-org/property-manager-ri Twitter: @EveritOrg

Hinweis der Redaktion

  1. DSF, DBCP and Liquibase components are available in the maven central and github
  2. And the winner is
  3. DSF, DBCP and Liquibase components are available in the maven central and github
  4. What can we do with a DataSource? Use Native SQL?
  5. Must get the help of other project: authorization
  6. Must get the help of other project: authorization
  7. - Any FROM and JOIN can be authorized - User-Group, ROLE as multiple parameters
  8. DSF, DBCP and Liquibase components are available in the maven central and github
  9. DSF, DBCP and Liquibase components are available in the maven central and github