I want to exercise AOP,so I use follwing example code:
package com.apress.prospring3.ch6.staticpc;
import java.lang.reflect.Method;
import net.sf.cglib.proxy.MethodInterceptor;
import...
Type: Posts; User: EdwardKing; Keyword(s):
I want to exercise AOP,so I use follwing example code:
package com.apress.prospring3.ch6.staticpc;
import java.lang.reflect.Method;
import net.sf.cglib.proxy.MethodInterceptor;
import...
I use Spring Tool Suite 3.1.0 to create a spring project,and I put following jar into classpath
org.springframework.asm_3.1.1.RELEASE.jar
org.springframework.beans_3.1.1.RELEASE.jar...
I want to use Annotation to Injecting Simple Values,like follows:
package com.apress.prospring3.ch4.annotation;
import org.springframework.beans.factory.annotation.Value;
import...
I am first to use Spring Tool Suite,Version: 3.1.0.RELEASE, File -> New -> Spring Template project,then it download some bytes from internet. But I find pom.xml file is marked by red sign. The error...
I get above code from a book example which using Spring2.5,and I want to try above code,so I download spring3.1,when I compile it with javac command,it raise above error. Why Spring 3.0 is ok and...
I use springframework 3.1.0,when I compile following code,it raise compile error.
package command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;...
I use getHibernateTemplate().executeWithNativeSession+SQLQuery method to visit DB,like follows:
List userList=getHibernateTemplate().executeWithNativeSession(
new...
I use spring-framework-3.0.3,configure files are follows:
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"...
I use spring with oracle,I know I can get record by following statement
List info=this.getHibernateTemplate().find("from Test.Model");
For exmple,I can get all record by execute above...
I use spring,my class extends HibernateDaoSupport,then I execute following statement,like follows:
public void save(TestModel um) throws DataAccessException,SQLException{
...
I have two table,like follows:
create table USERINFO
(
ID VARCHAR2(18) not null,
NAME VARCHAR2(20) not null
)
create table ROLEINFO
(
I have used c3p0 to configure spring database url and password in .properties file, now I want to use jasypt+c3p0 to configure spring, but I don't know how to do it, please help me. A detailed...
Sorry,my code is follows:
List testList=this.getHibernateTemplate().find(" select col1,col2 from
mytable");
request.setAttribute("testList",testList);
return SUCCESS;
Why above code return a...
Why
this.getHibernateTemplate().find(" select new mytable(col1,col2) from mytable"); return a list of Object[] not return 'mytable' objects'?
How to make it return 'mytable' objects?
I have a table named mytable,it has two cols,col1 and col2,the data are
col1 col2
---------------
John 24
Kate 18
hibernate xml file is follows:
I use getHibernateTemplate() to look up a record,like follows:
this.getHibernateTemplate().find("from mytable where id='0001'");
above code can run well,then I make another query,like follows:...
I want to use JspTag to load data from struts2+spring+hibernate,usually I load data from struts2+spring+hibernate using following code:
public class TestAction extends ActionSupport{
......
...
I use oracle,it has a date column,so I mapping following code
<hibernate-mapping>
<class name="test.model" table="testTable">
<property name="createDate" type="java.util.Date">
...
I use Oracle9i,I have a date field,like follows
logtime date,
name varchar2(3)
My question is how to write oracle date mapping in Hibernate hbm.xml?
I use this.getHibernateTemple.find("from...
I create a DAO,this DAO extends HibernateDaoSupport,now I want to add transaction management,such as commit and rollback,I don't know how to do it,my code is follows:
...
I use composite-id,the composite-id is composed by id and uid,like follows:
Test.hbm.xml
<class name="Test.Model" table="Test" mutable="true" polymorphism="implicit" dynamic-update="false"...
I have two table,table A and table B,
table A
ID NAME
---------------
test John
tiger Kate
table B
I want to query two table by using getHibernateTemplate().find,like follows:
getHibernateTemplate().find("from test.a a ,test.b b where a.id=b.id and a.c='abc'")
My question is how to extract...
I want to use following SQL by HibernateTemplate().update:
update mytable1,mytable2 set mytable1.name='Jack',mytable2.salary='999' where mytable1.id='1' and mytable2.work='true' and...
I use getHibernateTemplate() method to get HibernateTemplate Object,then I use delete(Object entity) method to delete some database record,like follows:
getHibernateTemplate().delete(entity1); ...