用 Hibernet Tool 自動產生的 Domain Code,對於 FOREIGN KEY 會以 annotation:  @ManyToMany(fetch = FetchType.LAZY) 來作註,但執行時會發生下列的錯誤
Struts Problem Report

MIS 發表在 痞客邦 留言(0) 人氣()

作法如下:
http://stackoverflow.com/questions/26616723/java-lang-nosuchmethoderror-javax-persistence-table-indexesljavax-persistenc

MIS 發表在 痞客邦 留言(0) 人氣()

在目錄 %JBOSS_HOME%\modules\com\microsoft\sqlserver\jdbc\main 下放入 module.xml & sqljdbc42.jar
module.xml 的內容

MIS 發表在 痞客邦 留言(0) 人氣()

Sql Server Express

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
        <property name="hibernate.connection.url">jdbc:sqlserver://localhost\SQLEXPRESS;databaseName=master;user=sa;password=password</property>
        <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
    </session-factory>
</hibernate-configuration>

MIS 發表在 痞客邦 留言(0) 人氣()

Step 01: 準備 table : TEST_GROUP & TEST_MEMBERS
 
table : TEST_GROUP



CREATE TABLE JAPPS.TEST_GROUP
(
  ID    VARCHAR2(10 BYTE),
  NAME  VARCHAR2(10 BYTE)
)


MIS 發表在 痞客邦 留言(0) 人氣()

當 struts2 加入 struts2-spring-plugin 的 JAR 檔後,執行 JUnit 或 Maven build 時發生 



SEVERE:   [50:59.081] ********** FATAL ERROR STARTING UP STRUTS-SPRING INTEGRATION **********
Looks like the Spring listener was not configured for your web app!
Nothing will work until WebApplicationContextUtils returns a valid ApplicationContext.
You might need to add the following to web.xml:
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
SEVERE:   [50:59.089] Dispatcher initialization failed


MIS 發表在 痞客邦 留言(0) 人氣()

配置:
Maven: pom.xml



<dependency>
    <groupId>org.quartz-scheduler</groupId>
    <artifactId>quartz</artifactId>
    <version>2.2.2</version>
</dependency>
<dependency>
    <groupId>org.quartz-scheduler</groupId>
    <artifactId>quartz-jobs</artifactId>
    <version>2.2.2</version>
</dependency>


MIS 發表在 痞客邦 留言(0) 人氣()

看完 Spring Data JPA 基本篇 與 Spring Data JPA 進階篇 之後,再來看一下 Spring Data JPA 框架,它主要針對的就是 Spring 唯一沒有簡化到的業務邏輯代碼。接下來我們針對前面的例子進行改造,讓 Spring Data JPA 來幫助我們完成業務邏輯。在著手寫代碼之前,開發者需要先 下載Spring Data JPA 的發佈包(需要同時下載 Spring Data Commons 和 Spring Data JPA 兩個發佈包,Commons 是 Spring Data 的公共基礎包),並把相關的依賴 JAR 檔加入到 CLASSPATH 中。
 

MIS 發表在 痞客邦 留言(0) 人氣()

在 Spring Data JPA 基本篇 談到 JPA 的基本作業,現在加入 Spring 的注入(Dependency Injection)來看,Spring 簡化程式碼有多少.
Step 01: DAO Interface: PersonSpringDataDao.java



package com.mis.demos.dao;
import com.mis.demos.model.Person;
public interface PersonSpringDataDao {
    public Person Save(Person person);
    
}


MIS 發表在 痞客邦 留言(0) 人氣()

jpa-mis
本文的示例代碼基於 Hibernate EntityManager 開發,程式碼中使用到的都是 JPA 規範提供的Interface / Class,以便瞭解 JPA 基本的概念。整個系統架構如下
 
Step 01 : create mysql table: person



CREATE TABLE `person` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `firstName` varchar(45) NOT NULL,
  `lastName` varchar(45) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;


MIS 發表在 痞客邦 留言(0) 人氣()

1
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。