code_snippet
stringlengths
92
2.48k
score
float64
1.83
4.89
@Test @Resources(annotatedClasses = { SubclassOfSingleTableInheritance.class, SingleEntity.class, RootOfSingleTableInheritance.class, OtherSubclassOfSingleTableInheritance.class, SubclassOfSubclassOfSingleTableInheritance.class }) public void testNoPolymorphism() { EntityBinding noInheritanceEntityB...
2.333333
@Test @Resources(annotatedClasses = { SubclassOfSingleTableInheritance.class, SingleEntity.class, RootOfSingleTableInheritance.class, OtherSubclassOfSingleTableInheritance.class, SubclassOfSubclassOfSingleTableInheritance.class }) public void testPreOrderRootSubEntityClosure() { EntityBinding rootEn...
2.555556
@Override protected void applyRootReturnSelectFragments(SelectStatementBuilder selectStatementBuilder) { selectStatementBuilder.appendSelectClauseFragment( getQueryableCollection().selectFragment( getCollectionReferenceAliases().getCollectionTableAlias(), getCollectionReferenceAliases().getCollectionCol...
3.333333
@Override public void startingCollectionElements(CollectionElementDefinition elementDefinition) { final Type elementType = elementDefinition.getType(); log.tracef( "%s Starting collection element graph : %s", StringHelper.repeat( ">>", fetchSourceStack.size() ), elementDefinition.getCollectionDefinitio...
3.555556
@Override protected void beforeTransactionCommit() { transactionCoordinator().sendBeforeTransactionCompletionNotifications( this ); final boolean flush = ! transactionCoordinator().getTransactionContext().isFlushModeNever() && ( isDriver || ! transactionCoordinator().getTransactionContext().isFlushBeforeCompl...
4.222222
@Test public void testRevisionsCounts() { assertEquals( Arrays.asList( 1, 2, 3, 4 ), getAuditReader().getRevisions( ChildIndexedListJoinColumnBidirectionalRefIngEntity.class, ing1_id ) ); assertEquals( Arrays.asList( 1, 2, 4 ), getAuditReader().getRevisions( ChildIndexedListJoinColumnBidire...
3.888889
@Test public void testHistoryOfIng2() { ParentOwnedIndexedListJoinColumnBidirectionalRefEdEntity ed2 = getEntityManager().find( ParentOwnedIndexedListJoinColumnBidirectionalRefEdEntity.class, ed2_id ); ChildIndexedListJoinColumnBidirectionalRefIngEntity rev1 = getAuditReader().find( ChildIndexedList...
3.555556
@Test public void testObtainEntityNameAssociationWithEntityNameAndNotAuditedModeInNewSession() { //force a new session and AR forceNewSession(); loadDataOnSessionAndAuditReader(); checkEntities(); checkEntityNames(); }
4.444444
@Test @Priority(10) public void initData() { EntityManager em = getEntityManager(); EmbeddableListEntity1 ele1 = new EmbeddableListEntity1(); // Revision 1 (ele1: initially 1 element in both collections) em.getTransaction().begin(); ele1.getComponentList().add( c3_1 ); em.persist( ele1 ); em.getTransa...
3.888889
@Test @Priority(10) public void initData() { EntityManager em = getEntityManager(); // Revision 1 em.getTransaction().begin(); PropertyOverrideEntity propertyEntity = new PropertyOverrideEntity( "data 1", 1, "data 2" ); em.persist( propertyEntity ); em.getTransaction().commit(); propertyEntityId = prop...
3.555556
protected void resetRegionUsageState(CacheAccessListener localListener, CacheAccessListener remoteListener) { String stdName = StandardQueryCache.class.getName(); String acctName = Account.class.getName(); localListener.getSawRegionModification( stdName ); localListener.getSawRegionModification( acctName ); ...
3.777778
@Override public void configure(Configuration cfg) { super.configure( cfg ); cfg.setProperty( Environment.USE_SECOND_LEVEL_CACHE, "true" ); cfg.setProperty( Environment.GENERATE_STATISTICS, "true" ); cfg.setProperty( Environment.USE_QUERY_CACHE, "false" ); cfg.setProperty( Environment.CACHE_REGION_FACTORY, g...
4.444444
@Test public void testOrphanDelete() { Session session = openSession(); Transaction t = session.beginTransaction(); Product prod = new Product( "Widget" ); Part part = new Part( "Widge", "part if a Widget" ); MapKey mapKey = new MapKey( "Top" ); prod.getParts().put( mapKey, part ); Part part2 = new Part(...
3.111111
protected AnnotationInstance parserPrimaryKeyJoinColumnList(List<JaxbPrimaryKeyJoinColumn> primaryKeyJoinColumnList, AnnotationTarget target) { if ( MockHelper.isNotEmpty( primaryKeyJoinColumnList ) ) { if ( primaryKeyJoinColumnList.size() == 1 ) { return parserPrimaryKeyJoinColumn( primaryKeyJoinColumnList.ge...
3.777778
public static <T> JaxbRoot<T> unmarshallXml(String fileName, String schemaName, Class<T> clazz, ClassLoaderService classLoaderService) throws JAXBException { Schema schema = getMappingSchema( schemaName, classLoaderService ); InputStream in = classLoaderService.locateResourceStream( fileName...
3.111111
private AnnotationInstance overrideSchemaCatalogByDefault(AnnotationInstance annotationInstance, EntityMappingsMocker.Default defaults) { List<AnnotationValue> newAnnotationValueList = new ArrayList<AnnotationValue>(); newAnnotationValueList.addAll( annotationInstance.values() ); boolean schemaDefined = false; ...
3.333333
public AbstractRowReader(ReaderCollector readerCollector) { this.entityReferenceInitializers = readerCollector.getEntityReferenceInitializers() != null ? new ArrayList<EntityReferenceInitializer>( readerCollector.getEntityReferenceInitializers() ) : Collections.<EntityReferenceInitializer>emptyList(); this....
2.555556
private void resolveEntityKey( ResultSet resultSet, ResultSetProcessingContextImpl context, FetchSource fetchSource, Map<EntityReference,EntityReferenceInitializer> initializerByEntityReference) throws SQLException { // Resolve any bidirectional entity references first. for ( BidirectionalEntityReferenc...
3
public EntityKey interpretEntityKey( SessionImplementor session, String optionalEntityName, Serializable optionalId, Object optionalObject) { if ( optionalEntityName != null ) { final EntityPersister entityPersister; if ( optionalObject != null ) { entityPersister = session.getEntityPersister( o...
3
@Test public void testChildIdColumnName() { Assert.assertEquals( "other_id", ((Column) getCfg() .getClassMapping( "org.hibernate.envers.test.integration.inheritance.joined.primarykeyjoin.ChildPrimaryKeyJoinEntity_AUD" ) .getKey().getColumnIterator().next()).getName() ); }
3.666667
@After public void cleanup() { b.setC( null ); b.setD( null ); b.getGCollection().remove( g ); c.getBCollection().remove( b ); c.getDCollection().remove( d ); d.getBCollection().remove( b ); d.setC( null ); d.setE( null ); d.getFCollection().remove( f ); e.getDCollection().remove( d ); e.setF(...
3.222222