Skip to content

Commit

Permalink
Fixed example bug in extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis J. McWherter Jr committed Jan 21, 2016
1 parent b6a9538 commit 0c70f0e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pages/guide/05-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ There are four common patterns to extend Elide with custom business logic:

#Simple Translations
It is sometimes required to perform simple computations or translations when a model attribute is read or written.
For example, a user model might require a cryptographic hash applied to a password field before it is persisted.
For example, a user model might require a cryptographic hash applied to a password field before it is persisted.

It is generally not a good idea to put logic inside getter and setter functions that are used by JPA providers to
It is generally not a good idea to put logic inside getter and setter functions that are used by JPA providers to
hydrate and read attributes. JPA does provide a `Transient` annotation that allows attributes and functions to exist
in a data model that are not persisted. By default, Elide will not expose any attributes marked as `Transient`.
However, this behavior can be overridden by also annotating the attribute with the `ComputedAttribute` Elide annotation.
Expand Down Expand Up @@ -62,22 +62,22 @@ class Book {
public String title;

@OnUpdate("title")
void onUpdateTitle() {
public void onUpdateTitle() {
// title attribute updated
}

@OnCommit("title")
void onCommitTitle() {
public void onCommitTitle() {
// title attribute update committed
}

@OnCommit
void onCommitBook() {
public void onCommitBook() {
// book entity committed
}

@OnDelete
void onDeleteBook() {
public void onDeleteBook() {
// book entity deleted
}
}
Expand Down Expand Up @@ -115,8 +115,8 @@ Initializers can be configured in a custom `DataStore` when the method `populate
/* Assuming this DataStore extends another... */
super.populateEntityDictionary(dictionary);

/*
* Create an initializer for model Foobar, passing any runtime configuration to
/*
* Create an initializer for model Foobar, passing any runtime configuration to
* the constructor of the initializer.
*/
...
Expand Down

0 comments on commit 0c70f0e

Please sign in to comment.