<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="testIntegration"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="com.genuitec.eclipse.j2eedt.core.J2EE14_CONTAINER"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jstl.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/postgresql-8.2-504.jdbc3.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-beanutils-1.6.1.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-codec-1.2.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/myfaces-all.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-digester-1.5.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-el.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-fileupload-1.0.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-validator.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/>
<classpathentry combineaccessrules="false" kind="src" path="/lib-myfaces"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-lang-2.1.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-collections-3.1.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-logging-1.0.4.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/easymock.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/ejb.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jakarta-oro-2.0.8.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/junit.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/log4j-1.2.9.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring-2.0.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring-aspects-2.0.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring-mock-2.0.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/c3p0-0.9.0.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-dbcp.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-pool.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/ehcache-1.2.2.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/ejb3-persistence.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/hibernate-3.2.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/hibernate-annotations-3.2.0.GA.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/hsqldb.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jta.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/aspectjweaver.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/asm-all-2.2.3.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/cglib-nodep-2.1_3.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/tomahawk-1.1.5.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jsf-facelets.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/el-api.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/el-ri.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/antlr-2.7.6.jar"/>
<classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
</classpath>
Hibernate:
select
user0_.id as id0_0_,
user0_.name as name0_0_,
user0_.pwd as pwd0_0_,
user0_.money as money0_0_,
user0_.position as position0_0_
from
public.user user0_
where
user0_.id=?
Hibernate:
select
stock0_.id as id2_0_,
stock0_.name as name2_0_,
stock0_.price as price2_0_
from
public.stock stock0_
where
stock0_.id=?
Hibernate:
select
stockposit0_.id as id1_,
stockposit0_.idstock as idstock1_,
stockposit0_.idUser as idUser1_,
stockposit0_.amount as amount1_
from
public.stockposition stockposit0_
where
stockposit0_.idstock=?
and stockposit0_.idUser=?
Hibernate:
select
orderstock0_.id as id4_,
orderstock0_.iduser as iduser4_,
orderstock0_.idstock as idstock4_,
orderstock0_.price as price4_,
orderstock0_.amount as amount4_,
orderstock0_.creation as creation4_
from
public.orderstock orderstock0_
where
orderstock0_.idstock=?
and orderstock0_.price>=? limit ?
Hibernate:
select
stockposit0_.id as id1_,
stockposit0_.idstock as idstock1_,
stockposit0_.idUser as idUser1_,
stockposit0_.amount as amount1_
from
public.stockposition stockposit0_
where
stockposit0_.idstock=?
and stockposit0_.idUser=?
Hibernate:
select
user0_.id as id0_0_,
user0_.name as name0_0_,
user0_.pwd as pwd0_0_,
user0_.money as money0_0_,
user0_.position as position0_0_
from
public.user user0_
where
user0_.id=?
Hibernate:
update
public.user
set
name=?,
pwd=?,
money=?,
position=?
where
id=?
Hibernate:
update
public.stockposition
set
idstock=?,
idUser=?,
amount=?
where
id=?
Hibernate:
update
public.user
set
name=?,
pwd=?,
money=?,
position=?
where
id=?
Hibernate:
delete
from
public.orderstock
where
id=?
Hibernate:
select
stockposit0_.id as id1_,
stockposit0_.idstock as idstock1_,
stockposit0_.idUser as idUser1_,
stockposit0_.amount as amount1_
from
public.stockposition stockposit0_
where
stockposit0_.idstock=?
and stockposit0_.idUser=?
Hibernate:
select
nextval ('hibernate_sequence')
Hibernate:
select
nextval ('hibernate_sequence')
Hibernate:
insert
into
public.transactionstock
(buyer, seller, idstock, price, amount, creation, id)
values
(?, ?, ?, ?, ?, ?, ?)
Hibernate:
insert
into
public.offerstock
(iduser, idstock, price, amount, creation, id)
values
(?, ?, ?, ?, ?, ?)
Hibernate:
update
public.stock
set
name=?,
price=?
where
id=?
Hibernate:
update
public.stockposition
set
idstock=?,
idUser=?,
amount=?
where
id=?
Hibernate:
select
offerstock0_.id as id3_0_,
user1_.id as id0_1_,
offerstock0_.iduser as iduser3_0_,
offerstock0_.idstock as idstock3_0_,
offerstock0_.price as price3_0_,
offerstock0_.amount as amount3_0_,
offerstock0_.creation as creation3_0_,
user1_.name as name0_1_,
user1_.pwd as pwd0_1_,
user1_.money as money0_1_,
user1_.position as position0_1_
from
public.offerstock offerstock0_
left outer join
public.user user1_
on offerstock0_.iduser=user1_.id
where
offerstock0_.idstock=?
order by
offerstock0_.price desc limit ?
Hibernate:
select
orderstock0_.id as id4_0_,
user1_.id as id0_1_,
orderstock0_.iduser as iduser4_0_,
orderstock0_.idstock as idstock4_0_,
orderstock0_.price as price4_0_,
orderstock0_.amount as amount4_0_,
orderstock0_.creation as creation4_0_,
user1_.name as name0_1_,
user1_.pwd as pwd0_1_,
user1_.money as money0_1_,
user1_.position as position0_1_
from
public.orderstock orderstock0_
left outer join
public.user user1_
on orderstock0_.iduser=user1_.id
where
orderstock0_.idstock=?
order by
orderstock0_.price asc limit ?
public String registerNewUser() {
User user = new User();
user.setName(name);
user.setPwd(pwd);
user.setPosition(new Long(0));
user.setMoney(User.DEFAULT_MONEY);
user = userService.registerNewUser(user);
context().getExternalContext().getSessionMap().put("user", user);
// errorhandling
return "success";
}
<managed-bean>
<managed-bean-name>userReg</managed-bean-name>
<managed-bean-class>
de.aja.fussi.auth.UserAuthHandler
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>userService</property-name>
<value>#{userServiceTarget}</value>
</managed-property>
</managed-bean>
<bean id="userServiceTarget" class="de.aja.fussi.market.UserServiceImpl">
<property name="transactionManager" ref="transactionManager"/>
<property name="userDao" ref="userDao"/>
<property name="stockDao" ref="stockDao"/>
<property name="stockpositionDao" ref="stockpositionDao"/>
<property name="stockofferDao" ref="stockofferDao"/>
<property name="stockorderDao" ref="stockorderDao"/>
</bean>
<bean id="userDao" class="de.aja.fussi.persistence.UserDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="stockpositionDao"
class="de.aja.fussi.persistence.StockpositionDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="get*" read-only="true" propagation="REQUIRED"/>
<tx:method name="find*" read-only="true" propagation="REQUIRED"/>
<tx:method name="select*" read-only="true" propagation="REQUIRED"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="txServiceMethodsUser" expression="execution(* de.aja.fussi.market.UserService*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="txServiceMethodsUser"/>
</aop:config>
public User registerNewUser(User user) {
List<Stock> allStock = stockDao.findAll();
Iterator <Stock>itAllStock = allStock.iterator();
user = userDao.save(user);
while (itAllStock.hasNext()) {
Stock stock = (Stock) itAllStock.next();
Stockposition stockPosition = new Stockposition(user.getId(),stock, 100);
user.addStockposition(stockPosition);
stockpositionDao.save(stockPosition);
}
return user;
}
public List<Stock> findAll() {
log.debug("getting all Stock instances");
try {
List<Stock> allInstances = (List<Stock>) getHibernateTemplate()
.find("from Stock s order by s.price desc");
return allInstances;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
public User save(User user) {
log.debug("saving User instance");
try {
getHibernateTemplate().save(user);
// getHibernateTemplate().saveOrUpdate(transientInstance);
log.debug("save successful");
return user;
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
while (itAllStock.hasNext()) {
Stock stock = (Stock) itAllStock.next();
Stockposition stockPosition = new Stockposition(user.getId(),stock, 100);
user.addStockposition(stockPosition);
stockpositionDao.save(stockPosition);
}