หน้าเว็บ
วันเสาร์ที่ 28 มีนาคม พ.ศ. 2558
Set Tomcat8 run on netbean 8
CATALINA_HOME : C:\Program Files\Apache Software Foundation\apache-tomcat-8.0.20
Path : C:\Program Files\Apache Software Foundation\apache-tomcat-8.0.20\bin;
C:\Program Files\Apache Software Foundation\apache-tomcat-8.0.20\conf\tomcat-users.xml
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="admin@1" roles="tomcat"/>
<user username="admin" password="admin@1" roles="tomcat,role1"/>
<user username="admin" password="admin@1" roles="role1"/>
<user username="admin" password="admin@1" roles="manager-gui"/>
<user username="admin" password="admin@1" roles="manager-script"/>
C:\Program Files\Apache Software Foundation\apache-tomcat-8.0.20\bin\catalina.bat
:noJuliConfig
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
:noJuliManager
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%
วันพุธที่ 25 มีนาคม พ.ศ. 2558
Annotation Hibernate
EJB 3 Annotations
@Entity จาวาคลาสที่มีการติดต่อกับฐานข้อมูล
@Table(name="customer") ทำการ Mapping กับฐานข้อมูลโดยมีชื่อตารางว่า Customer
@Id คีย์หลัก
@GeneratedValue id ที่ได้มาถูกสร้างโดยอัตโนมัติ
@Column(name="surName") ทำการ Mapping คอลัมน์กับฐานข้อมูล
@OneToOne(cascade = CascadeType.ALL) เมื่อมีการเพิ่มหรือลบข้อมูลของ Entity หลัก ระบบจะตามไปเพิ่มหรือลบข้อมูลในตารางที่เกี่ยวข้องด้วย
@ManyToOne
(default FetchType.EAGER)
@OneToMany
@ManyToMany
(default Fetch.LAZY)
@Entity จาวาคลาสที่มีการติดต่อกับฐานข้อมูล
@Table(name="customer") ทำการ Mapping กับฐานข้อมูลโดยมีชื่อตารางว่า Customer
@Id คีย์หลัก
@GeneratedValue id ที่ได้มาถูกสร้างโดยอัตโนมัติ
@Column(name="surName") ทำการ Mapping คอลัมน์กับฐานข้อมูล
@OneToOne(cascade = CascadeType.ALL) เมื่อมีการเพิ่มหรือลบข้อมูลของ Entity หลัก ระบบจะตามไปเพิ่มหรือลบข้อมูลในตารางที่เกี่ยวข้องด้วย
@ManyToOne
(default FetchType.EAGER)
@OneToMany
@ManyToMany
(default Fetch.LAZY)
Use Projections to specify which columns you would like to return
Example
SQL Query
SELECT user.id, user.name FROM user;
Hibernate Alternative
Criteria cr = session.createCriteria(User.class)
.setProjection(Projections.projectionList()
.add(Projections.property("id"), "id")
.add(Projections.property("Name"), "Name")) .setResultTransformer(Transformers.aliasToBean(User.class));
List list = cr.list();
ที่มา : http://stackoverflow.com/questions/11626761/hibernate-criteria-query-to-get-specific-columns
SQL Query
SELECT user.id, user.name FROM user;
Hibernate Alternative
Criteria cr = session.createCriteria(User.class)
.setProjection(Projections.projectionList()
.add(Projections.property("id"), "id")
.add(Projections.property("Name"), "Name")) .setResultTransformer(Transformers.aliasToBean(User.class));
List
วันจันทร์ที่ 16 มีนาคม พ.ศ. 2558
ทำความรู้จัก GruntJS
http://www.jir4yu.me/2014/%E0%B8%97%E0%B8%B3%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%88%E0%B8%B1%E0%B8%81-gruntjs/
สร้าง API ง่ายๆ ด้วย Node.js และ Express
http://www.siamhtml.com/restful-api-with-node-js-and-express/
Oracle timestamp to string
select to_char(column,'DD/MM/YYYY HH24:MI:SS') from table
วันพุธที่ 11 มีนาคม พ.ศ. 2558
วันจันทร์ที่ 9 มีนาคม พ.ศ. 2558
บันทึกปัญหาและวิธีแก้ไข
M:\PROGRAMMER\Document_New\RIM - Raw Material Issue Management\6.0 Problem & Solution
วันศุกร์ที่ 6 มีนาคม พ.ศ. 2558
Bootstrap Free Templates and plugin
http://startbootstrap.com/template-categories/all/
http://www.freshdesignweb.com/free-bootstrap-templates.html
http://www.templategarden.com/category/all/
http://www.bootstrapzero.com/bootstrap-templates
http://bootsnipp.com/
http://shapebootstrap.net/
http://graygrids.com/
http://www.freshdesignweb.com/free-bootstrap-templates.html
http://www.templategarden.com/category/all/
http://www.bootstrapzero.com/bootstrap-templates
http://bootsnipp.com/
http://shapebootstrap.net/
http://graygrids.com/
สมัครสมาชิก:
ความคิดเห็น (Atom)