congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SessionImplementor.find
Code IndexAdd Tabnine to your IDE (free)

How to use
find
method
in
org.hibernate.engine.spi.SessionImplementor

Best Java code snippets using org.hibernate.engine.spi.SessionImplementor.find (Showing top 20 results out of 315)

origin: hibernate/hibernate-orm

@Override
public <T> T find(Class<T> entityClass, Object primaryKey) {
  return delegate.find( entityClass, primaryKey );
}
origin: hibernate/hibernate-orm

@Override
public <T> T find(Class<T> entityClass, Object primaryKey, LockModeType lockMode) {
  return delegate.find( entityClass, primaryKey, lockMode );
}
origin: hibernate/hibernate-orm

@Override
public <T> T find(Class<T> entityClass, Object primaryKey, LockModeType lockMode, Map<String, Object> properties) {
  return delegate.find( entityClass, primaryKey, lockMode, properties );
}
origin: hibernate/hibernate-orm

@Override
public <T> T find(Class<T> entityClass, Object primaryKey, Map<String, Object> properties) {
  return delegate.find( entityClass, primaryKey, properties );
}
origin: hibernate/hibernate-orm

@Test
public void testHqlWithFetch() {
  inTransaction(
      s -> {
        Parent dbParent = s.find( Parent.class, this.parent.getId() );
        Set<Child> children = dbParent.getChildren();
        assertEquals( 1, children.size() );
      }
  );
}
origin: hibernate/hibernate-orm

@Test
public void testHqlWithFetch() {
  inTransaction(
      s -> {
        Parent parent = s.find( Parent.class, this.parent.getId() );
        assertEquals( 1, parent.getChildren().size() );
      }
  );
}
origin: hibernate/hibernate-orm

inTransaction(
    session -> {
      session.find( Item.class, item.getId(), LockModeType.PESSIMISTIC_WRITE );
          secondSession -> {
            try {
              secondSession.find(
                  Item.class,
                  item.getId(),
origin: hibernate/hibernate-orm

@Test
@TestForIssue( jiraKey = "HHH-3930" )
public void testEagerFetchBidirectionalOneToOneWithDirectFetching() {
  inTransaction( session -> {
    EntityA a = new EntityA( 1L, new EntityB( 2L ) );
    
    session.persist( a );
    session.flush();
    session.clear();
    // Use atomic integer because we need something mutable
    final AtomicInteger queryExecutionCount = new AtomicInteger();
    
    session.getEventListenerManager().addListener( new StatisticalLoggingSessionEventListener() {
      @Override
      public void jdbcExecuteStatementStart() {
        super.jdbcExecuteStatementStart();
        queryExecutionCount.getAndIncrement();
      }
    } );
    
    session.find( EntityA.class, 1L );
    
    assertEquals(
        "Join fetching inverse one-to-one didn't use the object already present in the result set!",
        1,
        queryExecutionCount.get()
    );
  } );
}
origin: hibernate/hibernate-orm

inTransaction(
    session -> {
      session.find( Item.class, item.getId(), LockModeType.PESSIMISTIC_WRITE );
origin: hibernate/hibernate-orm

inTransaction(
    session -> {
      session.find( Item.class, item.getId(), LockModeType.PESSIMISTIC_WRITE );
origin: hibernate/hibernate-orm

@Test
@TestForIssue( jiraKey = "HHH-13175")
public void testSubsequentSelectFromFind() {
  inTransaction(
      entityManagerFactory(),
      session -> {
        final RootGraph<Issue> graph = GraphParser.parse( Issue.class, "comments", session );
        final Issue issue = session.find(
            Issue.class,
            1,
            Collections.singletonMap( GraphSemantic.FETCH.getJpaHintName(), graph )
        );
        assertTrue( Hibernate.isInitialized( issue ) );
        assertTrue( Hibernate.isInitialized( issue.getComments() ) );
        assertTrue( Hibernate.isInitialized( issue.getReporter() ) );
        assertTrue( Hibernate.isInitialized( issue.getAssignee() ) );
        assertFalse( Hibernate.isInitialized( issue.getAssignee().getAssignedIssues() ) );
      }
  );
}
origin: hibernate/hibernate-orm

sessionFactory,
session -> {
  AnotherEntity it = session.find( AnotherEntity.class, 1 );
  assertNotNull( it );
origin: hibernate/hibernate-orm

sessionFactory,
session -> {
  TheEntity it = session.find( TheEntity.class, 1 );
  assertNotNull( it );
origin: hibernate/hibernate-orm

sessionFactory,
session -> {
  TheEntity it = session.find( TheEntity.class, 1 );
  assertNotNull( it );
origin: org.hibernate.orm/hibernate-core

@Override
public <T> T find(Class<T> entityClass, Object primaryKey) {
  return delegate.find( entityClass, primaryKey );
}
origin: org.hibernate.orm/hibernate-core

@Override
public <T> T find(Class<T> entityClass, Object primaryKey, LockModeType lockMode) {
  return delegate.find( entityClass, primaryKey, lockMode );
}
origin: org.hibernate.orm/hibernate-core

@Override
public <T> T find(Class<T> entityClass, Object primaryKey, LockModeType lockMode, Map<String, Object> properties) {
  return delegate.find( entityClass, primaryKey, lockMode, properties );
}
origin: org.hibernate.orm/hibernate-core

@Override
public <T> T find(Class<T> entityClass, Object primaryKey, Map<String, Object> properties) {
  return delegate.find( entityClass, primaryKey, properties );
}
origin: hibernate/hibernate-orm

sessionFactory,
session -> {
  TheEntity it = session.find( TheEntity.class, 1 );
  assertNotNull( it );
origin: hibernate/hibernate-orm

sessionFactory,
session -> {
  TheEntity it = session.find( TheEntity.class, 1 );
  assertNotNull( it );
org.hibernate.engine.spiSessionImplementorfind

Popular methods of SessionImplementor

  • getFactory
    Get the creating SessionFactoryImplementor
  • getTransactionCoordinator
  • connection
  • getPersistenceContext
    Get the persistence context for this session
  • getLoadQueryInfluencers
    Get the load query influencers associated with this session.
  • isTransactionInProgress
    Does this Session have an active Hibernate transaction or is there a JTA transaction in progress?
  • getEntityPersister
    Get the EntityPersister for any instance
  • getJdbcCoordinator
  • isClosed
    Determine whether the session is closed. Provided separately from #isOpen() as this method does not
  • flush
  • getTenantIdentifier
    Match te method on org.hibernate.Session and org.hibernate.StatelessSession
  • generateEntityKey
  • getTenantIdentifier,
  • generateEntityKey,
  • getContextEntityIdentifier,
  • isOpen,
  • bestGuessEntityName,
  • getFlushMode,
  • getSessionFactory,
  • guessEntityName,
  • immediateLoad,
  • initializeCollection

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Menu (java.awt)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JButton (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now