@@ -2682,25 +2682,24 @@ public void manageTime(boolean manage) {
2682
2682
* value literals.
2683
2683
* Example:
2684
2684
* <pre>
2685
- * String insert = u .toInsert();
2685
+ * String sql = user .toInsert();
2686
2686
* //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')
2688
2688
* </pre>
2689
2689
*
2690
2690
* @return INSERT SQL based on this model.
2691
2691
*/
2692
2692
public String toInsert () {
2693
2693
return toInsert (getMetaModelLocal ().getDialect ());
2694
2694
}
2695
-
2696
2695
2697
2696
/**
2698
2697
* Generates INSERT SQL based on this model with the provided dialect.
2699
2698
* Example:
2700
2699
* <pre>
2701
- * String insert = u .toInsert(new MySQLDialect());
2700
+ * String sql = user .toInsert(new MySQLDialect());
2702
2701
* //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')
2704
2703
* </pre>
2705
2704
*
2706
2705
* @param dialect dialect to be used to generate the SQL
@@ -2711,31 +2710,31 @@ public String toInsert(Dialect dialect) {
2711
2710
}
2712
2711
2713
2712
/**
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.
2715
2715
* Example:
2716
2716
* <pre>
2717
- *
2718
- * String update = u.toUpdate();
2717
+ * String sql = user.toUpdate();
2719
2718
* //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
2721
2720
* </pre>
2722
2721
*
2723
2722
* @return UPDATE SQL based on this model.
2724
2723
*/
2725
2724
public String toUpdate () {
2726
2725
return toUpdate (getMetaModelLocal ().getDialect ());
2727
2726
}
2728
-
2727
+
2729
2728
/**
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 .
2731
2730
* Example:
2732
2731
* <pre>
2733
- *
2734
- * String update = u.toUpdate();
2732
+ * String sql = user.toUpdate(new MySQLDialect());
2735
2733
* //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
2737
2735
* </pre>
2738
2736
*
2737
+ * @param dialect dialect to be used to generate the SQL
2739
2738
* @return UPDATE SQL based on this model.
2740
2739
*/
2741
2740
public String toUpdate (Dialect dialect ) {
0 commit comments