Skip to content

Commit

Permalink
Remove spacing in insert and update statements
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Nov 29, 2022
1 parent 26aaf1b commit 8d3adc3
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 52 deletions.
Expand Up @@ -115,7 +115,7 @@ else if ( getDialect() instanceof OracleDialect && getDialect().getVersion().isB
}
else {
assertEquals(
"Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1; statement executed: update Person set name=?, version=? where id=? and version=?",
"Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1; statement executed: update Person set name=?,version=? where id=? and version=?",
expected.getMessage()
);
}
Expand Down
Expand Up @@ -49,8 +49,8 @@ public void testBatchOrdering() {
} );

verifyContainsBatches(
new Batch( "insert into TASK (name, id) values (?, ?)", 2 ),
new Batch( "insert into TASK_CATEGORY (TASK_ID, categories) values (?, ?)", 2 )
new Batch( "insert into TASK (name,id) values (?,?)", 2 ),
new Batch( "insert into TASK_CATEGORY (TASK_ID,categories) values (?,?)", 2 )
);
}

Expand Down
Expand Up @@ -66,14 +66,14 @@ public void testBatching() {
} );

verifyContainsBatches(
new Batch( "insert into SaleDocumentSummary (sale_number, totalPrice, id) values (?, ?, ?)" ),
new Batch( "insert into Product (description, name, price, quantity, id) values (?, ?, ?, ?, ?)" ),
new Batch( "insert into SaleDocumentSummary (sale_number,totalPrice,id) values (?,?,?)" ),
new Batch( "insert into Product (description,name,price,quantity,id) values (?,?,?,?,?)" ),
new Batch(
"insert into SaleDocument (ID_SALE_DOCUMENT_CORRECTION, sale_number, totalPrice, id) values (?, ?, ?, ?)",
"insert into SaleDocument (ID_SALE_DOCUMENT_CORRECTION,sale_number,totalPrice,id) values (?,?,?,?)",
2
),
new Batch(
"insert into SaleDocumentItem (lp, product_id, quantity, ID_SALE_DOCUMENT, ID_SALE_DOCUMENT_SUMAMRY, id) values (?, ?, ?, ?, ?, ?)" )
"insert into SaleDocumentItem (lp,product_id,quantity,ID_SALE_DOCUMENT,ID_SALE_DOCUMENT_SUMAMRY,id) values (?,?,?,?,?,?)" )
);
}

Expand Down
Expand Up @@ -49,10 +49,10 @@ public void testInsert() {
} );

verifyContainsBatches(
new Batch( "insert into book_comment (book_comment, id) values (?, ?)", 2 ),
new Batch( "insert into Book (comment_id, title, id) values (?, ?, ?)" ),
new Batch( "insert into Author (book_id, name, id) values (?, ?, ?)" ),
new Batch( "insert into Book_book_comment (Book_id, comments_id) values (?, ?)" )
new Batch( "insert into book_comment (book_comment,id) values (?,?)", 2 ),
new Batch( "insert into Book (comment_id,title,id) values (?,?,?)" ),
new Batch( "insert into Author (book_id,name,id) values (?,?,?)" ),
new Batch( "insert into Book_book_comment (Book_id,comments_id) values (?,?)" )
);
}

Expand Down
Expand Up @@ -48,8 +48,8 @@ public void testReferenceDifferentSubclass() {
} );

verifyContainsBatches(
new Batch( "insert into SubclassB (name, referenceA_id, id) values (?, ?, ?)", 2 ),
new Batch( "insert into SubclassA (name, referenceB_id, id) values (?, ?, ?)", 2 )
new Batch( "insert into SubclassB (name,referenceA_id,id) values (?,?,?)", 2 ),
new Batch( "insert into SubclassA (name,referenceB_id,id) values (?,?,?)", 2 )
);
}

Expand Down
Expand Up @@ -69,9 +69,9 @@ public void testReferenceItself() {
} );

verifyContainsBatches(
new Batch( "insert into Placeholder (name, id) values (?, ?)", 2 ),
new Batch( "insert into Parameter (name, parent_id, TYPE, id) values (?, ?, " + literal( "INPUT" ) + ", ?)" ),
new Batch( "insert into Parameter (name, parent_id, TYPE, id) values (?, ?, " + literal( "OUTPUT" ) + ", ?)", 3 )
new Batch( "insert into Placeholder (name,id) values (?,?)", 2 ),
new Batch( "insert into Parameter (name,parent_id,TYPE,id) values (?,?," + literal( "INPUT" ) + ",?)" ),
new Batch( "insert into Parameter (name,parent_id,TYPE,id) values (?,?," + literal( "OUTPUT" ) + ",?)", 3 )
);
}

Expand Down
Expand Up @@ -57,9 +57,9 @@ public void testBatching() {
} );

verifyContainsBatches(
new Batch( "insert into Address (street, ID) values (?, ?)", 2 ),
new Batch( "insert into Person (name, ID) values (?, ?)", 4 ),
new Batch( "insert into Person_Address (persons_ID, addresses_ID) values (?, ?)", 6 )
new Batch( "insert into Address (street,ID) values (?,?)", 2 ),
new Batch( "insert into Person (name,ID) values (?,?)", 4 ),
new Batch( "insert into Person_Address (persons_ID,addresses_ID) values (?,?)", 6 )
);
}

Expand Down
Expand Up @@ -50,8 +50,8 @@ public void testBatching() {
} );

verifyContainsBatches(
new Batch( "insert into Address (street, ID) values (?, ?)", 2 ),
new Batch( "insert into Person (name, address_ID) values (?, ?)", 2 )
new Batch( "insert into Address (street,ID) values (?,?)", 2 ),
new Batch( "insert into Person (name,address_ID) values (?,?)", 2 )
);
}

Expand Down
Expand Up @@ -58,8 +58,8 @@ public void testBatching() {
} );

verifyContainsBatches(
new Batch( "insert into Address (street, ID) values (?, ?)", 2 ),
new Batch( "insert into Person (address_ID, name, ID) values (?, ?, ?)", 4 )
new Batch( "insert into Address (street,ID) values (?,?)", 2 ),
new Batch( "insert into Person (address_ID,name,ID) values (?,?,?)", 4 )
);
}

Expand Down
Expand Up @@ -74,9 +74,9 @@ public void testBatchingWithFlush() {
);

verifyContainsBatches(
new Batch( "insert into TopEntity (name, id) values (?, ?)" ),
new Batch( "insert into MiddleEntity (name, top_id, id) values (?, ?, ?)", 2 ),
new Batch( "insert into BottomEntity (middle_id, name, id) values (?, ?, ?)", 2 )
new Batch( "insert into TopEntity (name,id) values (?,?)" ),
new Batch( "insert into MiddleEntity (name,top_id,id) values (?,?,?)", 2 ),
new Batch( "insert into BottomEntity (middle_id,name,id) values (?,?,?)", 2 )
);
}

Expand Down Expand Up @@ -132,10 +132,10 @@ public void testBatchingWithFlush2() {
);

verifyContainsBatches(
new Batch( "insert into TopEntity (name, id) values (?, ?)", 2 ),
new Batch( "insert into MiddleEntity (name, top_id, id) values (?, ?, ?)", 2 ),
new Batch( "insert into BottomEntity (middle_id, name, id) values (?, ?, ?)", 2 ),
new Batch( "insert into BottomEntity2 (middle_id, name, id) values (?, ?, ?)", 2 )
new Batch( "insert into TopEntity (name,id) values (?,?)", 2 ),
new Batch( "insert into MiddleEntity (name,top_id,id) values (?,?,?)", 2 ),
new Batch( "insert into BottomEntity (middle_id,name,id) values (?,?,?)", 2 ),
new Batch( "insert into BottomEntity2 (middle_id,name,id) values (?,?,?)", 2 )
);
}

Expand Down
Expand Up @@ -49,8 +49,8 @@ public void testBatching() {
} );

verifyContainsBatches(
new Batch( "insert into Address (street, ID) values (?, ?)", 2 ),
new Batch( "insert into Person (address_ID, name, ID) values (?, ?, ?)", 2 )
new Batch( "insert into Address (street,ID) values (?,?)", 2 ),
new Batch( "insert into Person (address_ID,name,ID) values (?,?,?)", 2 )
);
}

Expand Down
Expand Up @@ -32,7 +32,7 @@ public void testInsertSortingWithFlushPersistLeftBeforeRight() {
clearBatches();
session.flush();

verifyContainsBatches( new Batch( "insert into TopEntity (name, id) values (?, ?)" ) );
verifyContainsBatches( new Batch( "insert into TopEntity (name,id) values (?,?)" ) );

LeftEntity left = new LeftEntity();
RightEntity right = new RightEntity();
Expand All @@ -56,9 +56,9 @@ public void testInsertSortingWithFlushPersistLeftBeforeRight() {
);

verifyContainsBatches(
new Batch( "insert into TopEntity (name, id) values (?, ?)" ),
new Batch( "insert into LeftEntity (name, top_id, id) values (?, ?, ?)" ),
new Batch( "insert into RightEntity (left_id, name, top_id, id) values (?, ?, ?, ?)" )
new Batch( "insert into TopEntity (name,id) values (?,?)" ),
new Batch( "insert into LeftEntity (name,top_id,id) values (?,?,?)" ),
new Batch( "insert into RightEntity (left_id,name,top_id,id) values (?,?,?,?)" )
);
}

Expand All @@ -72,7 +72,7 @@ public void testInsertSortingWithFlushPersistRightBeforeLeft() {
clearBatches();
session.flush();

verifyContainsBatches( new Batch( "insert into TopEntity (name, id) values (?, ?)" ) );
verifyContainsBatches( new Batch( "insert into TopEntity (name,id) values (?,?)" ) );

LeftEntity left = new LeftEntity();
RightEntity right = new RightEntity();
Expand All @@ -96,9 +96,9 @@ public void testInsertSortingWithFlushPersistRightBeforeLeft() {
);

verifyContainsBatches(
new Batch( "insert into TopEntity (name, id) values (?, ?)" ),
new Batch( "insert into LeftEntity (name, top_id, id) values (?, ?, ?)" ),
new Batch( "insert into RightEntity (left_id, name, top_id, id) values (?, ?, ?, ?)" )
new Batch( "insert into TopEntity (name,id) values (?,?)" ),
new Batch( "insert into LeftEntity (name,top_id,id) values (?,?,?)" ),
new Batch( "insert into RightEntity (left_id,name,top_id,id) values (?,?,?,?)" )
);
}

Expand Down
Expand Up @@ -56,8 +56,8 @@ public void testBatching() {
} );

verifyContainsBatches(
new Batch( "insert into Address (street, ID) values (?, ?)", 2 ),
new Batch( "insert into Person (address_ID, name, ID) values (?, ?, ?)", 4 )
new Batch( "insert into Address (street,ID) values (?,?)", 2 ),
new Batch( "insert into Person (address_ID,name,ID) values (?,?,?)", 4 )
);
}

Expand Down
Expand Up @@ -72,11 +72,11 @@ public void testInheritanceWithSecondaryTable() {
} );

verifyContainsBatches(
new Batch( "insert into TOP_LEVEL (name, id) values (?, ?)" ),
new Batch( "insert into SHAPE (name, SHAPE_TYPE, SHAPE_ID) values (?, " + literal( "POLYGON" ) + ", ?)" ),
new Batch( "insert into SHAPE (name, SHAPE_TYPE, SHAPE_ID) values (?, " + literal( "CIRCLE" ) + ", ?)" ),
new Batch( "insert into SHAPE_CIRCLE (centre, SHAPE_ID) values (?, ?)" ),
new Batch( "insert into GEOGRAPHIC_AREA (name, SHAPE_ID, TOP_LEVEL_ID, id) values (?, ?, ?, ?)", 2 )
new Batch( "insert into TOP_LEVEL (name,id) values (?,?)" ),
new Batch( "insert into SHAPE (name,SHAPE_TYPE,SHAPE_ID) values (?," + literal( "POLYGON" ) + ",?)" ),
new Batch( "insert into SHAPE (name,SHAPE_TYPE,SHAPE_ID) values (?," + literal( "CIRCLE" ) + ",?)" ),
new Batch( "insert into SHAPE_CIRCLE (centre,SHAPE_ID) values (?,?)" ),
new Batch( "insert into GEOGRAPHIC_AREA (name,SHAPE_ID,TOP_LEVEL_ID,id) values (?,?,?,?)", 2 )
);
}

Expand Down
Expand Up @@ -50,8 +50,8 @@ public void testBatching() {
} );

verifyContainsBatches(
new Batch( "insert into Address (person_ID, street, ID) values (?, ?, ?)", 2 ),
new Batch( "insert into Person (name, ID) values (?, ?)", 2 )
new Batch( "insert into Address (person_ID,street,ID) values (?,?,?)", 2 ),
new Batch( "insert into Person (name,ID) values (?,?)", 2 )
);
}

Expand Down
Expand Up @@ -52,8 +52,8 @@ public void testBatchingWithEmbeddableId() {
} );

verifyContainsBatches(
new Batch( "insert into Person (name, id) values (?, ?)" ),
new Batch( "insert into Address (street, id) values (?, ?)" )
new Batch( "insert into Person (name,id) values (?,?)" ),
new Batch( "insert into Address (street,id) values (?,?)" )
);

sessionFactoryScope().inTransaction( session -> {
Expand Down
Expand Up @@ -109,7 +109,7 @@ public void testSessionSettingOverridesSessionFactorySetting()
session.close();
}

PreparedStatement preparedStatement = connectionProvider.getPreparedStatement( "insert into Event (name, id) values (?, ?)" );
PreparedStatement preparedStatement = connectionProvider.getPreparedStatement( "insert into Event (name,id) values (?,?)" );
verify(preparedStatement, times( 5 )).addBatch();
verify(preparedStatement, times( 2 )).executeBatch();

Expand Down

0 comments on commit 8d3adc3

Please sign in to comment.