Skip to content

Instantly share code, notes, and snippets.

@gitbricho
gitbricho / B1:pom.xml
Last active August 29, 2015 14:06
healthcare/pom.xml : properties and dependencies
...
<properties>
<!-- Spring / Hibernate version -->
<version.spring>4.1.1.RELEASE</version.spring>
<version.spring.data>1.7.0.RELEASE</version.spring.data>
<version.thymeleaf>2.1.3.RELEASE</version.thymeleaf>
<version.eclipselink>2.5.0</version.eclipselink>
<version.mysql>5.1.22</version.mysql>
<version.servlet>3.0.1</version.servlet>
<version.hibernate.validation>5.1.2.Final</version.hibernate.validation>
@gitbricho
gitbricho / B1:app.properties
Last active August 29, 2015 14:06
healthcare/src/resouces/app.properties
#message source
message.source.basename=WEB-INF/messages/messages
#DB properties:
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/healthcaredb
username=demo
password=pass
initialSize=5
maxActive=50
@gitbricho
gitbricho / B1:DbConfig.java
Last active August 29, 2015 14:06
healthcare: com.itrane.healthcare.init.DbConfig
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories("com.itrane.healthcare.repo")
public class DbConfig {
@Resource
private Environment env;
// データソースの設定。
//  プロパティの値は src/resources/app.properties から取得
@gitbricho
gitbricho / B1:messages.properties
Last active August 29, 2015 14:08
healthcare: WEB-INF/messages/messages.properties
app.title=健康管理
app.footer=健康管理 2014
home.title=バイタルチェック <small>健康管理 ホーム</small>
home.welcome=<b>バイタル・チェック</b>アプリで毎日のバイタルをチェックしましょう!
@gitbricho
gitbricho / B1:WebAppConfig.java
Last active August 29, 2015 14:08
healthcare/src/com.itrane.healthcare.init/WebAppConfig.java
@Configuration
@EnableWebMvc
@Import({ DbConfig.class })
// データベース設定をインポート
@ComponentScan("com.itrane.healthcare")
@PropertySource("classpath:resources/app.properties")
public class WebAppConfig extends WebMvcConfigurerAdapter {
...
@gitbricho
gitbricho / B2:Vital.java
Last active August 29, 2015 14:09
healthcare : com.itrane.healthcare.model.Vital.java
@Entity
@Table(name = "vital")
public class Vital implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
private Long id = null;
@gitbricho
gitbricho / B2:Vod.java
Last active August 29, 2015 14:09
healthcare : com.itrane.healthcare.model.Vod.java
@Entity
@Table(name = "vod")
public class Vod implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
private Long id = null;
@gitbricho
gitbricho / B2:VitalMst.java
Last active August 29, 2015 14:09
healthcare : com.trane.healthcare.model.VitalMst.java
@Entity
@Table(name = "vitalmst")
public class VitalMst implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
private Integer id = null;
@gitbricho
gitbricho / B2:VodRepository.java
Last active August 29, 2015 14:09
healthcare : com.itrane.healthcare.repo.VodRepository.java
public interface VodRepository extends JpaRepository<Vod, Long> {
@Query("select v from Vod v where v.sokuteiBi = ?1")
public List<Vod> findBySokuteiBi(String sokuteiBi);
@Query("select v from Vod v where v.sokuteiBi between ?1 and ?2 order by v.sokuteiBi")
public List<Vod> findBySokuteiBiBetween(String sokuteiBi1, String sokuteiBi2);
}
@gitbricho
gitbricho / B2:VodServiceImpl.java
Last active August 29, 2015 14:09
health : com.itrane.healthcare.service.VodServiceImpl.java
@Service
public class VodServiceImpl implements VodService {
@Resource
private VodRepository vodRepository;
@Resource
private VitalRepository vitalRepository;
@PersistenceContext