This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Person> list = entityManger | |
.createQuery("from Person p where p.status = :status", Person.class) | |
.setParameter("status", clientStatus) | |
.setHint("org.hibernate.fetchSize", "200") | |
.getResultList(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List list = session | |
.createQuery("from Person p where p.status = :status") | |
.setString("status", clientStatus) | |
.setFetchSize(200) | |
.list(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ INFO] HHH000412: Hibernate Core {4.3.5.Final} | |
[ INFO] HHH000021: Bytecode provider name : javassist | |
... | |
[DEBUG] Preparing to build session factory with filters : {} | |
[DEBUG] Creating new JDBC DriverManager Connection to [...] | |
... | |
[DEBUG] JDBC version : 11.1 | |
[ INFO] HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect | |
... | |
[DEBUG] JDBC3 getGeneratedKeys(): disabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<logger name="org.hibernate"> | |
<level value="debug"/> | |
<appender-ref ref="FILE"/> | |
</logger> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bean id="entityManagerFactory" | |
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" | |
p:dataSource-ref="dataSource" | |
p:persistenceUnitName="pu"> | |
<property name="packagesToScan" value="..."/> | |
<property name="jpaVendorAdapter"> | |
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" /> | |
</property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> | |
... | |
<property name="hibernateProperties"> | |
<props> | |
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop> | |
<prop key="hibernate.jdbc.fetch_size">200</prop> | |
</props> | |
</property> | |
</bean> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JdbcTemplate jdbc = new JdbcTemplate(dataSource); | |
jdbc.setFetchSize(200); | |
jdbc.query("select a, b, c from table", | |
new RowCallbackHandler() { | |
@Override | |
public void processRow(ResultSet rs) throws SQLException { | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PreparedStatement stmt = null; | |
ResultSet rs = null; | |
try { | |
stmt = conn. prepareStatement("select a, b, c from table"); | |
stmt.setFetchSize(200); | |
rs = stmt.executeQuery(); | |
while (rs.next()) { | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JdbcTemplate jdbc = new JdbcTemplate(dataSource); | |
jdbc.setFetchSize(200); | |
jdbc.query("select a, b, c from table", | |
new RowCallbackHandler() { | |
@Override | |
public void processRow(ResultSet rs) throws SQLException { | |
... | |
} | |
} |
NewerOlder