-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draft Hibernate integration. Not used yet (one new repository comment…
…ed).
- Loading branch information
Showing
6 changed files
with
121 additions
and
19 deletions.
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
src/main/java/com/programmez/samples/gigreservation/domain/Ticketing.java
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
39 changes: 39 additions & 0 deletions
39
...m/programmez/samples/gigreservation/repository/internal/HibernateTicketingRepository.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* To change this template, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.programmez.samples.gigreservation.repository.internal; | ||
|
||
import com.programmez.samples.gigreservation.domain.Ticketing; | ||
import com.programmez.samples.gigreservation.repository.TicketingRepository; | ||
import java.util.List; | ||
import org.hibernate.SessionFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Repository; | ||
|
||
/** | ||
* | ||
* @author Sryl <[email protected]> | ||
*/ | ||
// @Repository("hibernate") | ||
public class HibernateTicketingRepository implements TicketingRepository { | ||
|
||
@Autowired | ||
private SessionFactory sessionFactory; | ||
|
||
@Override | ||
public Ticketing findById(Long ticketingId) { | ||
return (Ticketing) sessionFactory.getCurrentSession().get(Ticketing.class, ticketingId); | ||
} | ||
|
||
@Override | ||
public void updateNbTickets(Ticketing ticketing) { | ||
throw new UnsupportedOperationException("Not supported yet."); | ||
} | ||
|
||
@Override | ||
public List<Ticketing> findByBand(String ticketingBand, boolean audit) { | ||
throw new UnsupportedOperationException("Not supported yet."); | ||
} | ||
|
||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" | ||
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> | ||
<hibernate-configuration> | ||
<session-factory> | ||
<!-- Database connection settings --> | ||
<property name="connection.driver_class">org.h2.Driver</property> | ||
<property name="connection.url">jdbc:h2://localhost</property> | ||
<!-- JDBC connection pool (use the built-in) --> | ||
<property name="connection.pool_size">1</property> <!-- SQL dialect --> | ||
<property name="dialect">org.hibernate.dialect.H2Dialect</property> <!-- Enable Hibernate's automatic session context management --> | ||
<property name="current_session_context_class">thread</property> <!-- Disable the second-level cache --> | ||
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <!-- Echo all executed SQL to stdout --> | ||
<property name="show_sql">true</property> | ||
<!-- Drop and re-create the database schema on startup --> | ||
<property name="hbm2ddl.auto">update</property> | ||
</session-factory> | ||
</hibernate-configuration> |