File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/lob/BlobTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/lob/ClobTest.java | |||
Method name: void testBoundedBlobLocatorAccess()
|
Method name: void testBoundedClobLocatorAccess()
|
|||
Number of AST nodes: 18 | Number of AST nodes: 18 | |||
1 | if ( supportsLobValueChangePropogation() ) {↵ | 1 | if ( supportsLobValueChangePropogation() ) {↵ | |
2 | s = openSession();↵ | 2 | s = openSession();↵ | |
3 | s.beginTransaction();↵ | 3 | s.beginTransaction();↵ | |
4 | entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE );↵ | 4 | entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE );↵ | |
5 | entity.getBlobLocator().truncate( 1 );↵ | 5 | entity.getClobLocator().truncate( 1 );↵ | |
6 | entity.getBlobLocator().setBytes( 1, changed );↵ | 6 | entity.getClobLocator().setString( 1, changed );↵ | |
7 | s.getTransaction().commit();↵ | 7 | s.getTransaction().commit();↵ | |
8 | s.close();↵ | 8 | s.close();↵ | |
9 | s = openSession();↵ | 9 | s = openSession();↵ | |
10 | s.beginTransaction();↵ | 10 | s.beginTransaction();↵ | |
11 | entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE );↵ | 11 | entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE );↵ | |
12 | assertNotNull( entity.getBlobLocator() );↵ | 12 | assertNotNull( entity.getClobLocator() );↵ | |
13 | assertEquals( BLOB_SIZE, entity.getBlobLocator().length() );↵ | 13 | assertEquals( CLOB_SIZE, entity.getClobLocator().length() );↵ | |
14 | assertEquals( changed, extractData( entity.getBlobLocator() ) );↵ | 14 | assertEquals( changed, extractData( entity.getClobLocator() ) );↵ | |
15 | entity.getBlobLocator().truncate( 1 );↵ | 15 | entity.getClobLocator().truncate( 1 );↵ | |
16 | entity.getBlobLocator().setBytes( 1, original );↵ | 16 | entity.getClobLocator().setString( 1, original );↵ | |
17 | s.getTransaction().commit();↵ | 17 | s.getTransaction().commit();↵ | |
18 | s.close();↵ | 18 | s.close();↵ | |
19 | } | 19 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 324 |
Number of mapped statements | 18 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 20.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17 | if (supportsLobValueChangePropogation()) | 17 | if (supportsLobValueChangePropogation()) | ||||||||||||||||||||||||||
18 | s = openSession(); | 18 | s = openSession(); | ||||||||||||||||||||||||||
19 | s.beginTransaction(); | 19 | s.beginTransaction(); | ||||||||||||||||||||||||||
20 | entity = (LobHolder)s.get(LobHolder.class, entity.getId(), LockMode.UPGRADE); | 20 | entity = (LobHolder)s.get(LobHolder.class, entity.getId(), LockMode.UPGRADE); | ||||||||||||||||||||||||||
21 | entity.getBlobLocator().truncate(1); |
| 21 | entity.getClobLocator().truncate(1); | |||||||||||||||||||||||||
22 | entity.getBlobLocator().setBytes(1, changed); |
| 22 | entity.getClobLocator().setString(1, changed); | |||||||||||||||||||||||||
23 | s.getTransaction().commit(); | 23 | s.getTransaction().commit(); | ||||||||||||||||||||||||||
24 | s.close(); | 24 | s.close(); | ||||||||||||||||||||||||||
25 | s = openSession(); | 25 | s = openSession(); | ||||||||||||||||||||||||||
26 | s.beginTransaction(); | 26 | s.beginTransaction(); | ||||||||||||||||||||||||||
27 | entity = (LobHolder)s.get(LobHolder.class, entity.getId(), LockMode.UPGRADE); | 27 | entity = (LobHolder)s.get(LobHolder.class, entity.getId(), LockMode.UPGRADE); | ||||||||||||||||||||||||||
28 | assertNotNull(entity.getBlobLocator()); |
| 28 | assertNotNull(entity.getClobLocator()); | |||||||||||||||||||||||||
29 | assertEquals(BLOB_SIZE, entity.getBlobLocator().length()); |
| 30 | assertEquals(changed, extractData(entity.getClobLocator())); | |||||||||||||||||||||||||
30 | assertEquals(changed, extractData(entity.getBlobLocator())); |
| 29 | assertEquals(CLOB_SIZE, entity.getClobLocator().length()); | |||||||||||||||||||||||||
31 | entity.getBlobLocator().truncate(1); |
| 31 | entity.getClobLocator().truncate(1); | |||||||||||||||||||||||||
32 | entity.getBlobLocator().setBytes(1, original); |
| 32 | entity.getClobLocator().setString(1, original); | |||||||||||||||||||||||||
33 | s.getTransaction().commit(); | 33 | s.getTransaction().commit(); | ||||||||||||||||||||||||||
34 | s.close(); | 34 | s.close(); |
Row | Violation |
---|---|
1 | Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator() |
4 | Expression entity.getBlobLocator().setBytes(1,changed) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression entity.getClobLocator().setString(1,changed) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type byte[] of variable changed does not match with type java.lang.String of variable changed |
7 | Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator() |
10 | Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator() |
13 | Type int of variable BLOB_SIZE does not match with type java.lang.String of variable changed |
14 | Type byte[] of variable changed does not match with type int of variable CLOB_SIZE |
15 | Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator() |
18 | Expression entity.getBlobLocator().setBytes(1,original) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Expression entity.getClobLocator().setString(1,original) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Type byte[] of variable original does not match with type java.lang.String of variable original |
21 | Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator() |