File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/ManyToOneType.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/SpecialOneToOneType.java | |||
Method name: Serializable disassemble(Object, SessionImplementor, Object)
|
Method name: Serializable disassemble(Object, SessionImplementor, Object)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if ( isNotEmbedded( session ) ) {↵ | 1 | if ( isNotEmbedded(session) ) {↵ | |
2 | return getIdentifierType( session ).disassemble( value, session, owner );↵ | 2 | return getIdentifierType(session).disassemble(value, session, owner);↵ | |
3 | }↵ | 3 | }↵ | |
4 | ↵ | 4 | ↵ | |
5 | if ( value == null ) {↵ | 5 | if (value==null) {↵ | |
6 | return null;↵ | 6 | return null;↵ | |
7 | }↵ | 7 | }↵ | |
8 | else {↵ | 8 | else {↵ | |
9 | // cache the actual id of the object, not the value of the↵ | 9 | // cache the actual id of the object, not the value of the↵ | |
10 | // property-ref, which might not be initialized↵ | 10 | // property-ref, which might not be initialized↵ | |
11 | Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved( ↵ | 11 | Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved( ↵ | |
12 | getAssociatedEntityName(), ↵ | 12 | getAssociatedEntityName(), ↵ | |
13 | value, ↵ | 13 | value, ↵ | |
14 | session↵ | 14 | session↵ | |
15 | );↵ | 15 | );↵ | |
16 | if ( id == null ) {↵ | 16 | if (id==null) {↵ | |
17 | throw new AssertionFailure(↵ | 17 | throw new AssertionFailure(↵ | |
18 | "cannot cache a reference to an object with a null id: " + ↵ | 18 | "cannot cache a reference to an object with a null id: " + ↵ | |
19 | getAssociatedEntityName()↵ | 19 | getAssociatedEntityName() ↵ | |
20 | );↵ | 20 | );↵ | |
21 | }↵ | 21 | }↵ | |
22 | return getIdentifierType( session ).disassemble( id, session, owner );↵ | 22 | return getIdentifierType(session).disassemble(id, session, owner);↵ | |
23 | } | 23 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 33 |
Number of mapped statements | 8 |
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) | 1.4 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | if (isNotEmbedded(session)) | 1 | if (isNotEmbedded(session)) | |
2 | return getIdentifierType(session).disassemble(value, session, owner); | 2 | return getIdentifierType(session).disassemble(value, session, owner); | |
3 | if (value == null) | 3 | if (value == null) | |
4 | return null; | 4 | return null; | |
else | else | |||
5 | Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved(getAssociatedEntityName(), value, session); | 5 | Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved(getAssociatedEntityName(), value, session); | |
6 | if (id == null) | 6 | if (id == null) | |
7 | throw new AssertionFailure("cannot cache a reference to an object with a null id: " + getAssociatedEntityName()); | 7 | throw new AssertionFailure("cannot cache a reference to an object with a null id: " + getAssociatedEntityName()); | |
8 | return getIdentifierType(session).disassemble(id, session, owner); | 8 | return getIdentifierType(session).disassemble(id, session, owner); |
Row | Violation |
---|