Java Code Examples for org.springframework.orm.hibernate5.HibernateTemplate

The following examples show how to use org.springframework.orm.hibernate5.HibernateTemplate. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private HibernateTemplate getHibernateTemplate() {
    return new HibernateTemplate(getSessionFactory());
}
 
Example 2
Source Project: Mall-Server   Source File: SecondKillDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public SecondKillDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 3
Source Project: Mall-Server   Source File: HomeExtendDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public HomeExtendDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 4
Source Project: Mall-Server   Source File: MerchantDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public MerchantDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 5
Source Project: Mall-Server   Source File: AdminUserDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public AdminUserDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 6
Source Project: Mall-Server   Source File: GoodsDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public GoodsDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 7
Source Project: Mall-Server   Source File: GoodsCatDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public GoodsCatDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 8
Source Project: Mall-Server   Source File: AdminGroupDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public AdminGroupDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 9
Source Project: Mall-Server   Source File: OrderDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public OrderDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 10
Source Project: Mall-Server   Source File: ShoppingCartDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public ShoppingCartDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 11
Source Project: Mall-Server   Source File: AddressDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public AddressDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 12
Source Project: Mall-Server   Source File: GoodsCommentDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public GoodsCommentDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 13
Source Project: Mall-Server   Source File: UserDaoImpl.java    License: MIT License 4 votes vote down vote up
@Autowired
public UserDaoImpl(SessionFactory sessionFactory) {
    template = new HibernateTemplate(sessionFactory);
}
 
Example 14
Source Project: Spring-5.0-Cookbook   Source File: HiberConfig.java    License: MIT License 4 votes vote down vote up
@Bean
public HibernateTemplate hibernateTemplate(SessionFactory sessionFactory) {
        return new HibernateTemplate(sessionFactory);
}
 
Example 15
Source Project: spring-analysis-note   Source File: HibernateDaoSupport.java    License: MIT License 2 votes vote down vote up
/**
 * Create a HibernateTemplate for the given SessionFactory.
 * Only invoked if populating the DAO with a SessionFactory reference!
 * <p>Can be overridden in subclasses to provide a HibernateTemplate instance
 * with different configuration, or a custom HibernateTemplate subclass.
 * @param sessionFactory the Hibernate SessionFactory to create a HibernateTemplate for
 * @return the new HibernateTemplate instance
 * @see #setSessionFactory
 */
protected HibernateTemplate createHibernateTemplate(SessionFactory sessionFactory) {
	return new HibernateTemplate(sessionFactory);
}
 
Example 16
Source Project: spring-analysis-note   Source File: HibernateDaoSupport.java    License: MIT License 2 votes vote down vote up
/**
 * Set the HibernateTemplate for this DAO explicitly,
 * as an alternative to specifying a SessionFactory.
 * @see #setSessionFactory
 */
public final void setHibernateTemplate(@Nullable HibernateTemplate hibernateTemplate) {
	this.hibernateTemplate = hibernateTemplate;
}
 
Example 17
Source Project: spring-analysis-note   Source File: HibernateDaoSupport.java    License: MIT License 2 votes vote down vote up
/**
 * Return the HibernateTemplate for this DAO,
 * pre-initialized with the SessionFactory or set explicitly.
 * <p><b>Note: The returned HibernateTemplate is a shared instance.</b>
 * You may introspect its configuration, but not modify the configuration
 * (other than from within an {@link #initDao} implementation).
 * Consider creating a custom HibernateTemplate instance via
 * {@code new HibernateTemplate(getSessionFactory())}, in which case
 * you're allowed to customize the settings on the resulting instance.
 */
@Nullable
public final HibernateTemplate getHibernateTemplate() {
	return this.hibernateTemplate;
}
 
Example 18
Source Project: java-technology-stack   Source File: HibernateDaoSupport.java    License: MIT License 2 votes vote down vote up
/**
 * Create a HibernateTemplate for the given SessionFactory.
 * Only invoked if populating the DAO with a SessionFactory reference!
 * <p>Can be overridden in subclasses to provide a HibernateTemplate instance
 * with different configuration, or a custom HibernateTemplate subclass.
 * @param sessionFactory the Hibernate SessionFactory to create a HibernateTemplate for
 * @return the new HibernateTemplate instance
 * @see #setSessionFactory
 */
protected HibernateTemplate createHibernateTemplate(SessionFactory sessionFactory) {
	return new HibernateTemplate(sessionFactory);
}
 
Example 19
Source Project: java-technology-stack   Source File: HibernateDaoSupport.java    License: MIT License 2 votes vote down vote up
/**
 * Set the HibernateTemplate for this DAO explicitly,
 * as an alternative to specifying a SessionFactory.
 * @see #setSessionFactory
 */
public final void setHibernateTemplate(@Nullable HibernateTemplate hibernateTemplate) {
	this.hibernateTemplate = hibernateTemplate;
}
 
Example 20
Source Project: java-technology-stack   Source File: HibernateDaoSupport.java    License: MIT License 2 votes vote down vote up
/**
 * Return the HibernateTemplate for this DAO,
 * pre-initialized with the SessionFactory or set explicitly.
 * <p><b>Note: The returned HibernateTemplate is a shared instance.</b>
 * You may introspect its configuration, but not modify the configuration
 * (other than from within an {@link #initDao} implementation).
 * Consider creating a custom HibernateTemplate instance via
 * {@code new HibernateTemplate(getSessionFactory())}, in which case
 * you're allowed to customize the settings on the resulting instance.
 */
@Nullable
public final HibernateTemplate getHibernateTemplate() {
	return this.hibernateTemplate;
}
 
Example 21
Source Project: lams   Source File: HibernateDaoSupport.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a HibernateTemplate for the given SessionFactory.
 * Only invoked if populating the DAO with a SessionFactory reference!
 * <p>Can be overridden in subclasses to provide a HibernateTemplate instance
 * with different configuration, or a custom HibernateTemplate subclass.
 * @param sessionFactory the Hibernate SessionFactory to create a HibernateTemplate for
 * @return the new HibernateTemplate instance
 * @see #setSessionFactory
 */
protected HibernateTemplate createHibernateTemplate(SessionFactory sessionFactory) {
	return new HibernateTemplate(sessionFactory);
}
 
Example 22
Source Project: lams   Source File: HibernateDaoSupport.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Set the HibernateTemplate for this DAO explicitly,
 * as an alternative to specifying a SessionFactory.
 * @see #setSessionFactory
 */
public final void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
	this.hibernateTemplate = hibernateTemplate;
}
 
Example 23
Source Project: lams   Source File: HibernateDaoSupport.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Return the HibernateTemplate for this DAO,
 * pre-initialized with the SessionFactory or set explicitly.
 * <p><b>Note: The returned HibernateTemplate is a shared instance.</b>
 * You may introspect its configuration, but not modify the configuration
 * (other than from within an {@link #initDao} implementation).
 * Consider creating a custom HibernateTemplate instance via
 * {@code new HibernateTemplate(getSessionFactory())}, in which case
 * you're allowed to customize the settings on the resulting instance.
 */
public final HibernateTemplate getHibernateTemplate() {
  return this.hibernateTemplate;
}
 
Example 24
Source Project: spring4-understanding   Source File: HibernateDaoSupport.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Create a HibernateTemplate for the given SessionFactory.
 * Only invoked if populating the DAO with a SessionFactory reference!
 * <p>Can be overridden in subclasses to provide a HibernateTemplate instance
 * with different configuration, or a custom HibernateTemplate subclass.
 * @param sessionFactory the Hibernate SessionFactory to create a HibernateTemplate for
 * @return the new HibernateTemplate instance
 * @see #setSessionFactory
 */
protected HibernateTemplate createHibernateTemplate(SessionFactory sessionFactory) {
	return new HibernateTemplate(sessionFactory);
}
 
Example 25
Source Project: spring4-understanding   Source File: HibernateDaoSupport.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Set the HibernateTemplate for this DAO explicitly,
 * as an alternative to specifying a SessionFactory.
 * @see #setSessionFactory
 */
public final void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
	this.hibernateTemplate = hibernateTemplate;
}
 
Example 26
Source Project: spring4-understanding   Source File: HibernateDaoSupport.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Return the HibernateTemplate for this DAO,
 * pre-initialized with the SessionFactory or set explicitly.
 * <p><b>Note: The returned HibernateTemplate is a shared instance.</b>
 * You may introspect its configuration, but not modify the configuration
 * (other than from within an {@link #initDao} implementation).
 * Consider creating a custom HibernateTemplate instance via
 * {@code new HibernateTemplate(getSessionFactory())}, in which case
 * you're allowed to customize the settings on the resulting instance.
 */
public final HibernateTemplate getHibernateTemplate() {
  return this.hibernateTemplate;
}