Skip to content

Commit 9cf9f90

Browse files
committed
Update wording in general
1 parent 6a3ffe1 commit 9cf9f90

28 files changed

+239
-260
lines changed

architecture/compare-hibernate.html

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,22 @@ <h1><a href="/docs">Documentation</a> / <a href="/docs/architecture">Architectur
8282

8383
<h2 id="jpa">JPA</h2>
8484
<p>
85-
The issues discussed in the <a href="/architecture/compare-jpa">comparison with JPA</a> also apply to Hibernate.
86-
The comparison here apply more specifically to Hibernate.
85+
The issues discussed in this <a href="/architecture/compare-jpa">comparison with JPA</a> also apply to Hibernate.
8786
</p>
8887

8988
<h2 id="max-rows">Honoring maxRows in SQL</h2>
9089
<p>
9190
Ebean ORM will always honor firstRows / maxRows in generated SQL. Once you include a join fetch
92-
to a @OneToMany Hibernate stops implementing maxRows in SQL and instead brings all the rows back
91+
to a @OneToMany, Hibernate stops implementing maxRows in SQL and instead brings all the rows back
9392
to the client (application server) and filters the results there.
9493
</p>
9594
<p>
9695
This means the database does not get the opportunity to optimise that query using maxRows
97-
(via limit offset clause or similar) and so the DB query execution plan can be very different
98-
by reducing the ability of the DB to use indexes and increasing the chances of full table scans.
96+
(via limit offset clause or similar) so the DB query execution plan can be very different
97+
by reducing the ability to use indexes and increasing the chance of a full table scan.
9998
</p>
10099
<p>
101-
This also means significantly more data is pulled back from the DB to the client.
100+
Significantly more data is pulled back from the DB to the client in this way.
102101
</p>
103102
<div class="row">
104103
<div class="col-md-6">
@@ -161,49 +160,47 @@ <h4 class="media-heading">Lazy loading beyond the context</h4>
161160
</div>
162161

163162
<p>
164-
Hibernate does not allow lazy loading beyond the end of it's Session scope and instead
165-
throws <code>LazyInitialisationException</code>.
163+
Hibernate does not allow lazy loading beyond the end of its' Session scope throwing <code>LazyInitialisationException</code>.
166164
</p>
167165
<h4>Ebean allows lazy loading beyond the initial scope</h4>
168166
<ul>
169167
<li>
170-
The transaction isolation level of read committed is used as per the JPA spec. This means
171-
there is no effective difference when we lazy load with using another JDBC transaction relative
168+
The transaction isolation level of read committed is used as per the JPA spec. There is no effective difference when we lazy load with using another JDBC transaction relative
172169
to holding open a transaction (as typically required by Hibernate via "Open session in view").
173170
</li>
174171
<li>
175172
Ebean's entity beans have a reference back to their load context which enables subsequent
176-
lazy loading to execute with the same PersistenceContext and also enables batch lazy loading.
173+
lazy loading with the same PersistenceContext. (also enables batch lazy loading)
177174
This means the lazy loading still produces a consistent object graph (just as if it was loaded
178175
eagerly).
179176
</li>
180177
<li>
181-
If you want to prevent lazy loading with Ebean you can do <code>query.setDisableLazyLoading(true)</code>.
178+
To prevent lazy loading with Ebean, set <code>query.setDisableLazyLoading(true)</code>.
182179
This is useful when you want to use a partially populated bean and give it to a reflection based tool
183180
that converts it to JSON or DTO's etc.
184181
</li>
185182
</ul>
186183
<blockquote>
187-
With Ebean lazy loading just works without any drama
184+
With Ebean, lazy loading "just works" without any drama
188185
</blockquote>
189186

190187
<p>&nbsp;</p>
191188
<h4 id="open-session-in-view">Open session in view</h4>
192189
<p>
193190
As a byproduct of Ebean supporting lazy loading (beyond transaction scope) Ebean does not require
194-
the <code>"Open session in view"</code> pattern which is sometimes used with Hibernate.
191+
the <code>"Open session in view"</code> pattern sometimes seen with Hibernate.
195192
</p>
196193
<p>
197-
The "Open session in view" used with Hibernate has the effect of holding a transaction open for a
198-
longer time relative to Ebean. This pattern is considered an anti-pattern by many and instead the
199-
focus is on making sure service layer code has loaded everything that is needed on the entities
194+
"Open session in view" has the effect of holding a transaction open for a
195+
longer time relative to Ebean. This is considered an anti-pattern by many, with the
196+
focus now being on ensuring the service layer has loaded everything needed on the entities
200197
(and this is code we don't need to write with Ebean).
201198
</p>
202199

203200
<p>&nbsp;</p>
204201
<h2 id="history">SQL2011 @History vs Hibernate Envers</h2>
205202
<p>
206-
Ebean's @History is a database centric approach mapping to SQL2011. Hibernate Envers is an application centric approach
203+
Ebean's @History is a database-centric approach mapping to SQL2011. Hibernate Envers is an application centric approach
207204
which means that unlike @History bulk updates and external updates don't get included in auditing with Envers.
208205
</p>
209206
<div class="row">

architecture/compare-jpa.html

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ <h4 class="media-heading">Sessionless ORM</h4>
9999
</div>
100100
</div>
101101
<p>
102-
JPA is architecture such that the entity beans must be <code>attached</code> to the <code>PersistenceContext</code>
103-
in order for the entity beans to be <code>persisted</code>.
102+
JPA is architected such that entity beans must be <code>attached</code> to the <code>PersistenceContext</code>
103+
in order to be <code>persisted</code>.
104104
</p>
105105
<p>
106106
That is, JPA mandates <code>attach/detach</code> semantics. This has a number of consequences including:
@@ -117,9 +117,9 @@ <h3>Ebean architecture</h3>
117117
<ul>
118118
<li>No Entity manager, only manage transactions</li>
119119
<li>Dirty state on each entity bean</li>
120-
<li>Persisting (save,delete) does not require the PersistenceContext</li>
120+
<li>Persisting (save, delete) does not require the PersistenceContext</li>
121121
<li>PersistenceContext attached to the Transaction</li>
122-
<li>Partially populated beans always expected</li>
122+
<li>Partially populated beans are always expected</li>
123123
</ul>
124124

125125
<hr/>
@@ -135,19 +135,19 @@ <h3>JDBC batch control</h3>
135135
<li>No ability to turn off cascade behavior (to take full control)</li>
136136
</ul>
137137
<p>
138-
Using JDBC batch is important so that Ebean can get optimal performance when persisting. With Ebean
139-
there is a JDBC batch buffer attached to the transaction and can seamlessly batch up persistence
138+
Using JDBC batch is important so that we can get optimal performance when persisting. With Ebean
139+
there is a JDBC batch buffer attached to the transaction that can seamlessly batch up persistence
140140
calls using JDBC batch.
141141
</p>
142142
<p>
143-
Ebean provides full control over JDBC batch via the transaction including the
143+
Ebean provides full control over JDBC batch via the transaction, including the
144144
<code>batch size</code>, <code>getGeneratedKeys</code>, and <code>cascade behavior</code>.
145-
Unlike JPA with Ebean it is easy to fully control and optimise batch processing.
145+
In contrast to JPA, it is easy to fully control and optimise batch processing with Ebean.
146146
</p>
147147

148148
<h3>Transaction</h3>
149149
<p>
150-
Additional to full control over JDBC batch Ebean provides the ability on a transaction to:
150+
Ebean provides the ability on a transaction to:
151151
</p>
152152
<ul>
153153
<li>Register transaction callbacks (Post commit callback etc)</li>
@@ -158,7 +158,7 @@ <h3>Transaction</h3>
158158
<h3>Raw JDBC</h3>
159159
<p>
160160
Ebean provides access to the underlying <code>java.sql.Connection</code> for performing
161-
raw JDBC if needed along with <code>transaction.addModification(table, ...)</code> method to
161+
raw JDBC if needed along with a <code>transaction.addModification(table, ...)</code> method to
162162
tell Ebean what tables were modified for L2 cache invalidation.
163163
</p>
164164
<p>
@@ -168,17 +168,16 @@ <h3>Raw JDBC</h3>
168168

169169
<h3>Transaction Isolation level</h3>
170170
<p>
171-
Ebean lets you start a transaction at a higher Isolation level. JPA does not support this.
171+
Ebean lets you start a transaction at a higher isolation level. JPA does not support this.
172172
</p>
173173

174174
<h3>Stateless updates</h3>
175175
<p>
176176
Ebean allows us to populate a bean (or object graph) and <code>update()</code> without loading
177-
the object object. This is useful in Rest like API's where we want to populate an entity object graph
177+
the object object. This is useful in REST-like API's where we want to populate an entity object graph
178178
from JSON and perform an update.
179179
</p>
180180

181-
182181
<hr/>
183182
<h2 id="query-features">Query features</h2>
184183

@@ -198,8 +197,8 @@ <h3>findPagedList</h3>
198197
<h3>findEach</h3>
199198
<p>
200199
JPA has no support for executing large queries. Ebean has <code>findEach</code>
201-
for executing large queries (cursors / streaming) that takes into account the scope of the persistence context
202-
, JDBC driver fetchSize and MySql specific treatment (because MySql has specific issues to deal with).
200+
for executing large queries (cursors / streaming) that takes into account the scope of the persistence context,
201+
JDBC driver, fetchSize, and MySql specific treatment (because MySql has specific issues to deal with).
203202
</p>
204203

205204
<h3>findMap</h3>
@@ -248,14 +247,14 @@ <h3 id="jpql">JPQL</h3>
248247
some important features for controlling object graph construction from mixed sources (L2, L3 and DB).
249248
</p>
250249
<p>
251-
In JPA the emphasis on annotations <code>FetchType.Eager</code> and <code>FetchType.Lazy</code>
252-
and limitations in JPQL has put JPA in a bad position for optimising ORM queries and it will be
250+
The emphasis on annotations <code>FetchType.Eager</code> and <code>FetchType.Lazy</code>
251+
and limitations in JPQL has put JPA in a bad position for optimising ORM queries. It will be
253252
interesting if they can get to the level of control over object graph construction that Ebean supports.
254253
</p>
255254

256255
<h3 id="type-safe-query">Type safe queries</h3>
257256
<p>
258-
You could argue there is a bit more "ceremony" with JPA Criteria queries which makes the
257+
One could argue there is a bit more "ceremony" with JPA Criteria queries that make the
259258
query more verbose and harder to read.
260259
</p>
261260

@@ -292,11 +291,6 @@ <h5>JPA Criteria</h5>
292291
<a href="https://docs.jboss.org/hibernate/orm/5.0/topical/html/metamodelgen/MetamodelGenerator.html">JPA Query Meta model classes</a>
293292
in order to provide type safe query construction and execution.
294293
</p>
295-
<h5>QueryDSL</h5>
296-
<p>
297-
I suspect many JPA users look to use <a href="http://www.querydsl.com/">QueryDSL</a> as a preference
298-
over the standard JPA Criteria meta model objects.
299-
</p>
300294

301295
<hr/>
302296
<h2 id="mapping">Mapping</h2>
@@ -314,7 +308,7 @@ <h3>@View</h3>
314308
<h3>Entities without @Id</h3>
315309
<p>
316310
Ebean does not require entities to have an @Id property. These entities are considered "read only" and
317-
automatically bypass the persistence context. This entities are typically used for reporting purposes.
311+
automatically bypass the persistence context. These entities are typically used for reporting purposes.
318312
</p>
319313

320314
<h3>Naming convention</h3>

architecture/load-context.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ <h2 id="overview">Overview</h2>
8787
to the secondary queries.
8888
</p>
8989

90-
<h2 id="batch-loading">Batch loading</h2>
90+
<h2 id="batch-loading">Batch Loading</h2>
9191
<p>
92-
The Load context provides the batch loading mechanism. This solves the <a href="/docs/query/nplus1">N + 1</a> issue
93-
for Ebean. As such it is one of the most important internal features of Ebean ORM.
92+
The load context provides the batch loading mechanism, solving the <a href="/docs/query/nplus1">N + 1</a> issue
93+
for Ebean. As such, it is one of the most important internal features of Ebean ORM.
9494
</p>
9595

9696
<h2 id="propagate">Propagate query context</h2>
9797
<p>
98-
When secondary queries load additional parts of the object graph Ebean propagates key query execution context
98+
When secondary queries load additional parts of the object graph, Ebean propagates key query execution context
9999
from the <code>origin query</code> to the secondary queries including:
100100
</p>
101101
<ul>

architecture/orm-impedence-mismatch.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,25 +82,25 @@ <h1><a href="/docs">Documentation</a> / <a href="/docs/architecture">Architectur
8282

8383
<h2 id="overview">ORM for OLTP only</h2>
8484
<p>
85-
If you try to look at ORM from the viewpoint of trying to cover the entire feature set
86-
of Relational Databases then yes there is absolutely a large mismatch.
85+
If you seek to look for any ORM to cover the entire featureset
86+
of a relational database, you'll find there is a mismatch.
8787
</p>
8888
<p>
89-
Certainly for Ebean ORM and I'd suggest in general ORM is a poor abstraction for a large
90-
feature set of Relational Databases and specifically ORM is not well placed to be a
89+
ORMs are a poor abstraction for the large feature set of relational databases. Specifically, they are not well placed to be a
9190
good abstraction for <code>Reporting</code> and <code>Data Warehouse</code> features.
9291
</p>
9392
<p>
94-
Ebean ORM is orientated towards OLTP with reasonably normalised schemas and well known
95-
relationships but Relational Databases can do much more than this.
93+
While Ebean ORM is oriented towards online transaction processing (OLTP) with reasonably normalized schemas and well known
94+
relationships, relational databases as a technology can do much more than this.
9695
</p>
9796

9897
<h2>Impedance details</h2>
9998
<p>
100-
Lets continue to look into the ORM impedance details with the view that we are restricting
99+
Lets continue to look into the ORM impedance details with the view of restricting
101100
ourselves to OLTP Databases.
102101
</p>
103102

103+
<!-- Re-Add when there is content
104104
<h3>Inheritance</h3>
105105
<p>
106106
@@ -109,7 +109,7 @@ <h3>Inheritance</h3>
109109
<h3>Object vs Relational relationships</h3>
110110
<p>
111111
112-
</p>
112+
</p> -->
113113

114114
<h3>Schema ownership conflict</h3>
115115
<p>

0 commit comments

Comments
 (0)