Skip to content

Commit e906563

Browse files
committed
#383 Updated documentation
1 parent 0b9f83e commit e906563

File tree

1 file changed

+13
-14
lines changed
  • activejdbc/src/main/java/org/javalite/activejdbc

1 file changed

+13
-14
lines changed

activejdbc/src/main/java/org/javalite/activejdbc/Model.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,25 +2682,24 @@ public void manageTime(boolean manage) {
26822682
* value literals.
26832683
* Example:
26842684
* <pre>
2685-
* String insert = u.toInsert();
2685+
* String sql = user.toInsert();
26862686
* //yields this output:
2687-
* //INSERT INTO users (id, first_name, email, last_name) VALUES (1, 'Marilyn', 'mmonroe@yahoo.com', 'Monroe');
2687+
* //INSERT INTO users (id, email, first_name, last_name) VALUES (1, 'mmonroe@yahoo.com', 'Marilyn', 'Monroe')
26882688
* </pre>
26892689
*
26902690
* @return INSERT SQL based on this model.
26912691
*/
26922692
public String toInsert() {
26932693
return toInsert(getMetaModelLocal().getDialect());
26942694
}
2695-
26962695

26972696
/**
26982697
* Generates INSERT SQL based on this model with the provided dialect.
26992698
* Example:
27002699
* <pre>
2701-
* String insert = u.toInsert(new MySQLDialect());
2700+
* String sql = user.toInsert(new MySQLDialect());
27022701
* //yields this output:
2703-
* //INSERT INTO users (id, first_name, email, last_name) VALUES (1, 'Marilyn', 'mmonroe@yahoo.com', 'Monroe');
2702+
* //INSERT INTO users (id, email, first_name, last_name) VALUES (1, 'mmonroe@yahoo.com', 'Marilyn', 'Monroe')
27042703
* </pre>
27052704
*
27062705
* @param dialect dialect to be used to generate the SQL
@@ -2711,31 +2710,31 @@ public String toInsert(Dialect dialect) {
27112710
}
27122711

27132712
/**
2714-
* Generates UPDATE SQL based on this model. Uses single quotes for all string values.
2713+
* Generates UPDATE SQL based on this model. Uses the dialect associated with this model database to format the
2714+
* value literals.
27152715
* Example:
27162716
* <pre>
2717-
*
2718-
* String update = u.toUpdate();
2717+
* String sql = user.toUpdate();
27192718
* //yields this output:
2720-
* //UPDATE students SET DOB = '1965-12-01' , FIRST_NAME = 'Jim' , LAST_NAME = 'Cary' WHERE id = 1
2719+
* //UPDATE users SET email = 'mmonroe@yahoo.com', first_name = 'Marilyn', last_name = 'Monroe' WHERE id = 1
27212720
* </pre>
27222721
*
27232722
* @return UPDATE SQL based on this model.
27242723
*/
27252724
public String toUpdate() {
27262725
return toUpdate(getMetaModelLocal().getDialect());
27272726
}
2728-
2727+
27292728
/**
2730-
* Generates UPDATE SQL based on this model. Uses single quotes for all string values.
2729+
* Generates UPDATE SQL based on this model with the provided dialect.
27312730
* Example:
27322731
* <pre>
2733-
*
2734-
* String update = u.toUpdate();
2732+
* String sql = user.toUpdate(new MySQLDialect());
27352733
* //yields this output:
2736-
* //UPDATE students SET DOB = '1965-12-01' , FIRST_NAME = 'Jim' , LAST_NAME = 'Cary' WHERE id = 1
2734+
* //UPDATE users SET email = 'mmonroe@yahoo.com', first_name = 'Marilyn', last_name = 'Monroe' WHERE id = 1
27372735
* </pre>
27382736
*
2737+
* @param dialect dialect to be used to generate the SQL
27392738
* @return UPDATE SQL based on this model.
27402739
*/
27412740
public String toUpdate(Dialect dialect) {

0 commit comments

Comments
 (0)