Subversion Repository Public Repository

litesoft

Diff Revisions 2 vs 24 for /trunk/Java/core/Server/src/org/litesoft/sql/SQLPersistenceHelper.java

Diff revisions: vs.
  @@ -43,6 +43,7 @@
43 43
44 44 // PersistenceHelper vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
45 45
46 + @Override
46 47 public synchronized void initializeDB()
47 48 {
48 49 SQLDBconnection zDBC = null;
  @@ -66,37 +67,44 @@
66 67 }
67 68 }
68 69
70 + @Override
69 71 public DBconnection createConnection()
70 72 throws DBException
71 73 {
72 74 return createSQLDBconnection();
73 75 }
74 76
77 + @Override
75 78 protected String LLnormalizeIdentifierNotNullOrEmpty( String pIdentifier )
76 79 {
77 80 return getHelper().normalizeIdentifier( pIdentifier );
78 81 }
79 82
83 + @Override
80 84 protected String[] LLgetTablesEquals( String pName )
81 85 {
82 86 return LLgetTablesFor( SQLHelper.escapePercent( pName ) );
83 87 }
84 88
89 + @Override
85 90 protected String[] LLgetTablesStartsWith( String pStart )
86 91 {
87 92 return LLgetTablesFor( SQLHelper.escapePercent( pStart ) + "%" );
88 93 }
89 94
95 + @Override
90 96 protected String[] LLgetTablesEndsWith( String pEnd )
91 97 {
92 98 return LLgetTablesFor( "%" + SQLHelper.escapePercent( pEnd ) );
93 99 }
94 100
101 + @Override
95 102 protected String[] LLgetTablesStartsAndEndsWith( String pStart, String pEnd )
96 103 {
97 104 return LLgetTablesFor( SQLHelper.escapePercent( pStart ) + "%" + SQLHelper.escapePercent( pEnd ) );
98 105 }
99 106
107 + @Override
100 108 protected String[] LLgetTablesForParts( String[] pParts )
101 109 {
102 110 StringBuilder sb = new StringBuilder();
  @@ -126,6 +134,7 @@
126 134 }
127 135 }
128 136
137 + @Override
129 138 protected Map<String, DBtableColumn[]> LLgetColumns( String pTableName )
130 139 throws DBException
131 140 {
  @@ -145,6 +154,7 @@
145 154 }
146 155 }
147 156
157 + @Override
148 158 protected Map<String, DBtableIndex[]> LLgetIndexes( String pTableName )
149 159 throws DBException
150 160 {
  @@ -167,6 +177,7 @@
167 177 * @return TRUE if table exists,
168 178 * FALSE if table appears to not exist
169 179 */
180 + @Override
170 181 public boolean tableExists( SimpleFromIdentifier pSimpleFromIdentifier )
171 182 throws DBException, MultipleTablesException
172 183 {
  @@ -186,6 +197,7 @@
186 197 * @return TRUE if table exists,
187 198 * FALSE if table appears to not exist
188 199 */
200 + @Override
189 201 public boolean columnExists( SimpleFromIdentifier pSimpleFromIdentifier, String pColumnName )
190 202 throws DBException, MultipleTablesException
191 203 {
  @@ -206,6 +218,7 @@
206 218 }
207 219 }
208 220
221 + @Override
209 222 public long rawCount( SimpleFromIdentifier pSimpleFromIdentifier, WhereClause pSelectionWhereClause )
210 223 throws DBException
211 224 {
  @@ -214,12 +227,14 @@
214 227 return rawCount( zTableName, SQL_OR_Helper.toSQL( pSelectionWhereClause ) );
215 228 }
216 229
230 + @Override
217 231 public void deleteRows( SimpleFromIdentifier pSimpleFromIdentifier, WhereClause pSelectionWhereClause )
218 232 throws DBException
219 233 {
220 234 deleteRows( null, pSimpleFromIdentifier, pSelectionWhereClause );
221 235 }
222 236
237 + @Override
223 238 public void deleteRows( DBconnection pDBconnection, SimpleFromIdentifier pSimpleFromIdentifier, WhereClause pSelectionWhereClause )
224 239 throws DBException
225 240 {
  @@ -240,6 +255,7 @@
240 255 *
241 256 * @throws DBException - Exception regarding the OR layer
242 257 */
258 + @Override
243 259 public boolean snagOne( SimpleFromIdentifier pSimpleFromIdentifier, SimpleColumnDefinition pKeyCD, SimpleColumnDefinition pSnagCD, Long pUniqueSnagValue, WhereClause pSelectionWhereClause, OrderBy pOrderBy, ColumnUpdateValuePair[] pUpdateValuePairs )
244 260 throws DBException
245 261 {
  @@ -300,12 +316,14 @@
300 316 // select id from SnagTest where zsnaguniquecolumn is null order by id limit 1 );
301 317 }
302 318
319 + @Override
303 320 public void deleteAllRows( SimpleFromIdentifier pSimpleFromIdentifier )
304 321 throws DBException
305 322 {
306 323 deleteAllRows( null, pSimpleFromIdentifier );
307 324 }
308 325
326 + @Override
309 327 public void deleteAllRows( DBconnection pDBconnection, SimpleFromIdentifier pSimpleFromIdentifier )
310 328 throws DBException
311 329 {
  @@ -314,6 +332,7 @@
314 332 LLdeleteRows( pDBconnection, "DELETE FROM " + zTableName + " WHERE 1=1" );
315 333 }
316 334
335 + @Override
317 336 public void dropTable( TableManager pTableManager, SimpleFromIdentifier pSimpleFromIdentifier )
318 337 throws DBException
319 338 {
  @@ -345,6 +364,7 @@
345 364 pTableManager.removeTable( zTableName );
346 365 }
347 366
367 + @Override
348 368 public void addColumnToExistingTable( SimpleFromIdentifier pSimpleFromIdentifier, SimpleColumnDefinitionExtended pSCD )
349 369 throws DBException
350 370 {
  @@ -499,6 +519,7 @@
499 519 }
500 520 }
501 521
522 + @Override
502 523 public PersistenceHelperRowSource prepareForGetNextRow()
503 524 {
504 525 if ( mResultSetColumnCount != -1 )
  @@ -518,6 +539,7 @@
518 539 }
519 540 }
520 541
542 + @Override
521 543 public Object[] getNextRow()
522 544 {
523 545 if ( mQuery == null )
  @@ -554,6 +576,7 @@
554 576 }
555 577 }
556 578
579 + @Override
557 580 public void dispose()
558 581 {
559 582 if ( mQuery != null )
  @@ -563,6 +586,7 @@
563 586 }
564 587 }
565 588
589 + @Override
566 590 protected void finalize()
567 591 throws Throwable
568 592 {
  @@ -583,6 +607,7 @@
583 607
584 608 private static class MyIndexColumnsLocator implements SQLIndexColumnsLocator
585 609 {
610 + @Override
586 611 public String[] getColumnsForIndex( String pIndexName )
587 612 {
588 613 for ( MetaDataForPO zMD : DataStoreLocator.get().getMetaDataStore().getAllMetaDataForPOs() )