| http://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#mapping-column-filter
- In this section, the AccountType is not necessary and distracts from the essentials. It should be removed.
- typo: "Persising an fetching" -> "Persisting and fetching"
- Example 82 could be replaced with the simple sentence "When persisting the entities, the filters are not evaluated. In this example, it is possible to add inactive accounts to the collection, which will be saved but are not returned when fetching them later." The rest of the code seems to be rather long, boring and off-topic.
- In the same example, instead of the INSERT statements, I prefer the columns to be aligned, like this, just as an idea. Or, to expand on that idea, just use a table for laying out the data instead of SQL statements.
- In the current form I cannot look at the code and at the data at the same time because Example 82 is so long.
- In Example 81, the formatting is inconsistent regarding the spacing around = in annotations.
- In Example 81, the name = "..." should be removed from the @Entity annotations since it is redundant in the default configuration. Or, to be consistent, all fields would need the implicit annotations also, which would clutter the code.
- I am confused about the @Filter annotation appearing twice, once in the Client and once in the Account. Is that redundancy really required or is it just a documentation mistake? (After reading further, I saw that this code is used in two separate examples. It would be easier for the reader to only have one feature per code; that means one code example for filtering entities, and another code example for filtering collections.)
- Before Example 82, the sentence starts with "If the database". But the "then" for that "if" is missing. That sentence is continued nowhere.
- "going to" is used when talking about plans. In this context, I don't want "plans" from Hibernate but guarantees. Therefore, "going to" should be replaced with "will" everywhere. Or just switch to the present tense, which sounds even more like a guarantee.
- In Example 83, the log message should be "Activating" instead of "Activate".
- typo: "was allowed" -> "were allowed"
- typo: "other Session will get" -> "other Session would get"
- typo: "filters have not" -> "filters had not"
- typo: "illustrate din" -> "illustrated in"
- Above Example 85, there should be an explanation about what the filter firstAccounts intends to do, since its name doesn't make sense, not even along its condition.
|