diff --git a/hibernate-core/src/main/java/org/hibernate/sql/Delete.java b/hibernate-core/src/main/java/org/hibernate/sql/Delete.java index a6badc0305..cd5affb8f3 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/Delete.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/Delete.java @@ -16,13 +16,13 @@ import java.util.Map; */ public class Delete { - private String tableName; - private String versionColumnName; - private String where; + protected String tableName; + protected String versionColumnName; + protected String where; + protected String comment; + + protected Map primaryKeyColumns = new LinkedHashMap<>(); - private Map primaryKeyColumns = new LinkedHashMap(); - - private String comment; public Delete setComment(String comment) { this.comment = comment; return this; @@ -43,9 +43,9 @@ public class Delete { buf.append( " where " ); } boolean conditionsAppended = false; - Iterator iter = primaryKeyColumns.entrySet().iterator(); + Iterator> iter = primaryKeyColumns.entrySet().iterator(); while ( iter.hasNext() ) { - Map.Entry e = (Map.Entry) iter.next(); + Map.Entry e = iter.next(); buf.append( e.getKey() ).append( '=' ).append( e.getValue() ); if ( iter.hasNext() ) { buf.append( " and " ); diff --git a/hibernate-core/src/main/java/org/hibernate/sql/InFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/InFragment.java index 3237c53204..3e15777220 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/InFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/InFragment.java @@ -25,8 +25,8 @@ public class InFragment { public static final String NULL = "null"; public static final String NOT_NULL = "not null"; - private String columnName; - private List values = new ArrayList(); + protected String columnName; + protected List values = new ArrayList(); /** * @param value an SQL literal, NULL, or NOT_NULL diff --git a/hibernate-core/src/main/java/org/hibernate/sql/Insert.java b/hibernate-core/src/main/java/org/hibernate/sql/Insert.java index 25b2d7d276..93083a90e1 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/Insert.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/Insert.java @@ -19,10 +19,13 @@ import org.hibernate.type.LiteralType; * @author Gavin King */ public class Insert { + + protected String tableName; + protected String comment; + + protected Map columns = new LinkedHashMap<>(); + private Dialect dialect; - private String tableName; - private String comment; - private Map columns = new LinkedHashMap(); public Insert(Dialect dialect) { this.dialect = dialect; @@ -111,7 +114,7 @@ public class Insert { } else { buf.append(" ("); - Iterator iter = columns.keySet().iterator(); + Iterator iter = columns.keySet().iterator(); while ( iter.hasNext() ) { buf.append( iter.next() ); if ( iter.hasNext() ) { diff --git a/hibernate-core/src/main/java/org/hibernate/sql/InsertSelect.java b/hibernate-core/src/main/java/org/hibernate/sql/InsertSelect.java index efc4a7cf49..fc8388b982 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/InsertSelect.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/InsertSelect.java @@ -18,10 +18,13 @@ import org.hibernate.dialect.Dialect; * @author Steve Ebersole */ public class InsertSelect { - private String tableName; - private String comment; - private List columnNames = new ArrayList(); - private Select select; + + protected String tableName; + protected String comment; + + protected List columnNames = new ArrayList<>(); + + protected Select select; public InsertSelect(Dialect dialect) { //This is no longer used. Deprecate & remove? @@ -70,7 +73,7 @@ public class InsertSelect { buf.append( "insert into " ).append( tableName ); if ( !columnNames.isEmpty() ) { buf.append( " (" ); - Iterator itr = columnNames.iterator(); + Iterator itr = columnNames.iterator(); while ( itr.hasNext() ) { buf.append( itr.next() ); if ( itr.hasNext() ) { diff --git a/hibernate-core/src/main/java/org/hibernate/sql/Select.java b/hibernate-core/src/main/java/org/hibernate/sql/Select.java index e8b0aa4f3f..30a516dfb8 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/Select.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/Select.java @@ -17,15 +17,17 @@ import org.hibernate.internal.util.StringHelper; */ public class Select { - private String selectClause; - private String fromClause; - private String outerJoinsAfterFrom; - private String whereClause; - private String outerJoinsAfterWhere; - private String orderByClause; - private String groupByClause; - private String comment; - private LockOptions lockOptions = new LockOptions(); + protected String selectClause; + protected String fromClause; + protected String outerJoinsAfterFrom; + protected String whereClause; + protected String outerJoinsAfterWhere; + protected String orderByClause; + protected String groupByClause; + protected String comment; + + protected LockOptions lockOptions = new LockOptions(); + public final Dialect dialect; private int guesstimatedBufferSize = 20; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/SimpleSelect.java b/hibernate-core/src/main/java/org/hibernate/sql/SimpleSelect.java index f27f407b2c..46f96b71cd 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/SimpleSelect.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/SimpleSelect.java @@ -31,15 +31,18 @@ public class SimpleSelect { //private static final Alias DEFAULT_ALIAS = new Alias(10, null); - private String tableName; - private String orderBy; - private Dialect dialect; - private LockOptions lockOptions = new LockOptions( LockMode.READ ); - private String comment; + protected String tableName; + protected String orderBy; + protected String comment; + + protected List columns = new ArrayList(); + protected Map aliases = new HashMap(); + protected List whereTokens = new ArrayList(); + + protected LockOptions lockOptions = new LockOptions( LockMode.READ ); + + private Dialect dialect; - private List columns = new ArrayList(); - private Map aliases = new HashMap(); - private List whereTokens = new ArrayList(); public SimpleSelect addColumns(String[] columnNames, String[] columnAliases) { for ( int i = 0; i < columnNames.length; i++ ) { diff --git a/hibernate-core/src/main/java/org/hibernate/sql/Update.java b/hibernate-core/src/main/java/org/hibernate/sql/Update.java index 93611d73a4..7b9a3fdae8 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/Update.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/Update.java @@ -19,15 +19,15 @@ import org.hibernate.type.LiteralType; */ public class Update { - private String tableName; - private String versionColumnName; - private String where; - private String assignments; - private String comment; + protected String tableName; + protected String versionColumnName; + protected String where; + protected String assignments; + protected String comment; - private Map primaryKeyColumns = new LinkedHashMap(); - private Map columns = new LinkedHashMap(); - private Map whereColumns = new LinkedHashMap(); + protected Map primaryKeyColumns = new LinkedHashMap<>(); + protected Map columns = new LinkedHashMap<>(); + protected Map whereColumns = new LinkedHashMap<>(); private Dialect dialect; @@ -170,9 +170,9 @@ public class Update { } buf.append( "update " ).append( tableName ).append( " set " ); boolean assignmentsAppended = false; - Iterator iter = columns.entrySet().iterator(); + Iterator> iter = columns.entrySet().iterator(); while ( iter.hasNext() ) { - Map.Entry e = (Map.Entry) iter.next(); + Map.Entry e = iter.next(); buf.append( e.getKey() ).append( '=' ).append( e.getValue() ); if ( iter.hasNext() ) { buf.append( ", " ); @@ -192,7 +192,7 @@ public class Update { } iter = primaryKeyColumns.entrySet().iterator(); while ( iter.hasNext() ) { - Map.Entry e = (Map.Entry) iter.next(); + Map.Entry e = iter.next(); buf.append( e.getKey() ).append( '=' ).append( e.getValue() ); if ( iter.hasNext() ) { buf.append( " and " ); @@ -208,7 +208,7 @@ public class Update { } iter = whereColumns.entrySet().iterator(); while ( iter.hasNext() ) { - final Map.Entry e = (Map.Entry) iter.next(); + final Map.Entry e = iter.next(); if ( conditionsAppended ) { buf.append( " and " ); }