[
https://issues.jboss.org/browse/SEAMFORGE-294?page=com.atlassian.jira.plu...
]
Liu Jianhong commented on SEAMFORGE-294:
----------------------------------------
I abstract BackingBean as "CommonGenericBean",and then write an concrete bean
"PersonBean" as following:
public class PersonBean extends CommonGenericBean<Person> implements MenuItem{}
When i test PersonBean on jboss-as7,two types of problems I encountered,
1.When write CommonGenericBean as floowing,enable interceptor class
"org.jboss.seam.transaction.TransactionInterceptor" caused getItemType() returns
Object,then disable the interceptor,getItemType() become return Peron class,so I can not
use JTA.
public abstract class CommonGenericBean<T> extends PersistenceUtil
{
private List<T> list = null;
private T item = createInstence();
private long id = 0;
private PaginationHelper<T> pagination;
private transient Class<T> entityClass;
public Class<T> getItemType()
{
if (entityClass == null) {
entityClass = getSuperClassGenricType(getClass());
}
return entityClass;
}
...
2.When write CommonGenericBean as floowing,it says "No active JTA transaction on
joinTransaction call",in this case,only "RESOURCE_LOCAL" type of
persistence can run.
public abstract class CommonGenericBean<T>
{
private List<T> list = null;
private T item = createInstence();
private long id = 0;
private PaginationHelper<T> pagination;
private transient Class<T> entityClass;
protected PersistenceUtil persit;
protected abstract void setPersistenceUnit(PersistenceUtil persit);
public Class<T> getItemType()
{
if (entityClass == null) {
entityClass = getSuperClassGenricType(getClass());
}
return entityClass;
}
...
Any one can fix those problem?
Common methods in scaffold controller bean should abstracted to a
supper class
------------------------------------------------------------------------------
Key: SEAMFORGE-294
URL:
https://issues.jboss.org/browse/SEAMFORGE-294
Project: Seam Forge
Issue Type: Enhancement
Components: Scaffold
Affects Versions: 1.0.0.Beta2
Reporter: Liu Jianhong
Fix For: 1.0.0.Beta3
Attachments: scaffold-metawidget-lib.zip, second.zip
Original Estimate: 1 day
Remaining Estimate: 1 day
Controller bean should as flowing:
@Named
@RequestScoped
public class @{entity.getName()}Bean extends AbstractBean<(a){entity.getName()}>
implements MenuItem
{
}
And we also can implement more than one AbstractBean such as FilterableBean and so on.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira