|
|
ToDo:
|
|
ひかぞーは大喜びだったらしい。何時までもピュアなココロを持っていて欲しいな。
CREATE TABLE `test`.`Employee` ( `ID` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `FistName` VARCHAR(45) NOT NULL, `LastName` VARCHAR(45) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE = InnoDB;Hibernate AnnotationのModel
package org.hikazoh;
import java.io.Serializable;
import javax.persistence.*;
@Entity
@Table(name="Employee")
public class Employee implements Serializable {
@Id
@Column(name="ID")
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Integer iD;
@Column(name="FirstName")
private String firstName;
@Column(name="LastName")
private String lastName;
public Integer getID() {
return iD;
}
public void setID(Integer id) {
iD = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
サンプルコードは…
package org.hikazoh;
import org.hibernate.*;
import org.hibernate.cfg.AnnotationConfiguration;
public class SimpleTest {
public static void main(String[] args) {
SessionFactory sessionFactory =
new AnnotationConfiguration()
.addPackage("org.hikazoh")
.addAnnotatedClass(Employee.class)
.buildSessionFactory();
Session session = sessionFactory.openSession();
Transaction tx = null;
try{
tx = session.beginTransaction();
Employee emp = new Employee();
emp.setFirstName("Hika");
emp.setLastName("Zou");
session.save(emp);
tx.commit();
}catch(Exception e){
if ( tx != null ){
tx.rollback();
}
}finally{
session.close();
}
sessionFactory.close();
}
}
なぜか?お好み焼き呑み。
Sqliteは簡単に使っているのでこれは良いかも。
jQueryまだまだ勉強できてない。
この正月休みで再インストールを予定です。
SJISが入ったのか?
Before...
_ anonimous [Those average every day people also used that exact same h..]
_ anonimous [Average every day people also used that exact same http://..]
_ anonimous [Every day people also used that exact same http://hawley.2..]
_ anonimous [Used that exact same http://roadshow.250Free.com/shopping-..]
_ anonimous [apple also used that exact same http://emilio.250Free.com/..]