JPA Data Auditing
AuditingSometime we need to keep track with the change of the Entity, eg.When it is createdWho created itLast modified dateLast modified by somebodyImplement via JPAJPA specification provides a...
View ArticleCreate a restul application with AngularJS and CakePHP(I) :Prepare project...
Prepare project skeletonThere are several solutions provided in the CakePHP documents to create a new CakePHP project from scratch.clone the cakephp from github, and work on it.use bake command line...
View ArticleCreate a restful application with AngularJS and CakePHP(II): Bake backend...
Bake backend REST APII will reuse the database scheme of the CakePHP Blog tutorial.Prepare posts tableExecute the following scripts to create a posts table in your MySQL database, it also initialized...
View ArticleCreate a restful application with AnguarJS and CakePHP(III): Build the...
Build the frontend pages with AngularJSAngularJS is one of the most popular JS frameworks, with which it is easy to build awesome single page applications.If you have no experience of AngularJS...
View ArticleCreate a restful application with AngularJS and CakePHP(IV): Simple...
Simple authentication and authorizationNow we add the basic security feature to this application, such as login, logout, only the author of the certain Post can edit and delete it.Prepare the...
View ArticleAngularJS CakePHP Sample codes
IntroductionThis sample is a Blog application which has the same features with the official CakePHP Blog tutorial, the difference is AngularJS was used as frontend solution, and CakePHP was only use...
View ArticleCreate a restful application with AngularJS and Grails
Create a restful application with AngularJS and GrailsIn this example application, I will create a simple application which basic CRUD operations, and I reused some AngularJS codes of theAngularJS...
View ArticleCreate a restful application with AngularJS and Zend 2 framework
Create a restful application with AngularJS and Zend 2 frameworkThis example application uses AngularJS/Bootstrap as frontend and Zend2 Framework as REST API producer.The backend codeThis backend code...
View ArticleCreate a restful application with AngularJS and Zend 2 framework (2)
Replace the backend with Doctrine ORMDoctrine is a very popular data access solution for PHP, it includes low level DBAL and high level OR mapping solution.Doctrine has some Zend specific modules to...
View ArticleAuditing with Hibernate Envers
Auditing with Hibernate EnversThe approaches provided in JPA lifecyle hook and Spring Data auditing only track the creation and last modification info of an Entity, but all the modification history are...
View ArticleModeling with Doctrine
Modeling with DoctrineIn this post, we try to use Doctrine to make the models richer, and make it more like a real world application.OverviewImagine there are several models in this application, Album,...
View ArticleJPA 2.1 Schema generation properties
JPA 2.1 Schema generation propertiesIf you have some experience of Hibernate before, you must have used Hibernatehibernate.hbm2ddl.auto property to maintain the database schema for your project and...
View ArticleJPA 2.1: Bulk Update and Delete
JPA 2.1: Bulk Update and DeleteIn the JPA 2.0 and early version, if you want to execute a bulk updating query, you have to use update or delete clause in JPQL directly. JPA 2.1 introduce new Criteria...
View ArticleJPA 2.1: Attribute Converter
JPA 2.1: Attribute ConverterIf you are using Hibernate, and want a customized type is supported in your Entity class, you could have to write a custom Hibernate Type.JPA 2.1 brings a new feature named...
View ArticleJPA 2.1: Entity Graph
JPA 2.1: Entity GraphEntity Graph is a means to specify the structure of a graph of entities, it defines the return path and boundaries when the entity is loaded.Define Entity GraphYou can define an...
View ArticleJPA 2.1: Treat
JPA 2.1: TreatJPA 2.1 introduces a new keyword treat in JPQL which allow path expressions to be treated as a subclass, giving access to subclass specific state.Create two specified Comments, VoteUp and...
View ArticleJPA 2.1: Unsynchronized Persistence Contexts
JPA 2.1: Unsynchronized Persistence ContextsIn JPA 2.0 and the early version, any change of the data will be synchronized into database at the transaction is committed.JPA 2.1 introduced a...
View ArticleJPA 2.1: Programmatic Named Queries
JPA 2.1: Programmatic Named QueriesIn JPA 2.0 or the early version, you can define a named query by add a @NamedQueryannotation on the entity class.JPA 2.1 brings a new programmatic approach to create...
View ArticleJPA 2.1: CDI Support
JPA 2.1: CDI SupportIn JPA 2.0 or the early version, you can not @Inject a CDI bean into JPA facilities.Utilize Apache CODI or JBoss Seam 3, @Inject could be supported in Entity...
View ArticleJPA 2.1: Overview
JPA 2.1: OverviewJPA 2.1 brings a series of small improvements.I have written some posts to introduce them one by one.Schema generation scripts configurationAttribute ConverterBulk Criterial Update and...
View Article