[JBoss Seam] - How does the DataModel passes the data to the next page?
by hubaer
Hi all,
I try to understand the Issue-Tracker example, and hope that someone could explain me a little bit more about the page and object flow.
Esspecially I'm interested how the DataModel / dataTable works, because I need this in an application
Therefore I took the ProjectFinderBean, ProjectSelectorBean and ProjectEditorBean and extended them with some debug messages.
So I could figured out the dependencies between this 3 classes, if I click on one of the "View"-button:
| Caller: ProjectFinder #1
| - (Create)
| JSF(@Factory) -------------> findProjects
| ProjectSelector #1
| JSF ----------------------------------------------> (Create) ProjectEditor #1
| @In ---------------------------> (Create)
| JSF ----------------------------------------------> getButtonLabl (x-times)
| JSF ----------------------------------------------> isCreateEnabled (x-times)
| EndOfRequest (1) destroy
| EndOfRequest (2) getIssueList
| EndOfRequest (3) destroy
| ProjectEditor #2
| "View"-button (4) @In --------------------------> (Create)
| ProjectFinder #2
| (5) (Create) <---------------- @In
| isCreateEnabled (x-times)
| select
| (6) getSelection <------------
| ------------------------------> setInstance
| JSF getIssueList
| .
| .
| .
|
The number in the brackets are the points which are not really clear to me.
So here (maybe some newbie) questions:
(1) and (3): Does the tranisient keyword destroies the instances or the end of the request? Or both?
(2): Why is getIssueList() is called after destorying the ProjectEditorBean?
(4) and (5): Why is the @In is called after clicking on the "View"-button? Because of (1) and (3) ?
(6): How does the new instance of the ProjectFinderBean know which list entry was selected? Does this the PAGE-Scope on the @DataModel?
And one last question:
Why do I need session beans to pass the selected entry to another bean? Or is there a solution to do that with 2 beans.
Thank you in advance
Marco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025012#4025012
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025012
19Â years, 1Â month
[EJB 3.0] - EJB3 2. level cache and query cache question
by xinhua
Hi,
i opened 2.level cache and query cache in persistence.xml like following:
<property name="hibernate.show_sql" value="true" />
| <property name="hibernate.cache.provider_class" value="org.jboss.ejb3.entity.TreeCacheProviderHook"/>
| <property name="hibernate.treecache.mbean.object_name" value="jboss.cache:service=EJB3EntityTreeCache"/>
| <property name="hibernate.cache.use_query_cache" value="true" />
and on an entity:
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
for 2. level cache
and
query.setParameter("vorname", vorname).setParameter("nachname",
| nachname).setMaxResults(maxResults).setFirstResult(firstResult)
| .setHint("org.hibernate.cacheable", new Boolean(true)).setHint("org.hibernate.cacheMode", CacheMode.GET ).setHint("org.hibernate.fetchSize", new Integer(100));
|
for query cache...
but it doese not work :(
can anyone help?
thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025010#4025010
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025010
19Â years, 1Â month
[Persistence, JBoss/CMP, Hibernate, Database] - Getting generated ID by sequence
by stupar.aleksandar
I'm writing entity for person and this is the part of the class.
@Entity
| @SequenceGenerator(name = "tsperson_sequence", sequenceName = "SEQ_TSPERSON_ID")
| public class Tsperson implements Serializable {
| @Id
| @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="tsperson_sequence")
| @Column(name="TSPERSON_ID", nullable = false)
| private Long tspersonId;
What i'm trying to do is to get an Id after I flush person data
into database.
Tsperson person = new Tsperson();
| person.setFirstName("kill");
| person.setLastName("em");
| person.setUserName("all");
|
| em.persist(person);
| System.out.println(person.getTspersonId());
| em.flush();
| System.out.println(person.getTspersonId());
But all I get is old
stohastic Long value generated by container.
Output is something like this:
3150
3150
and primary key in database is 60.
Could someone tell my is this normal and how can I
get value generated from database sequence
into Person's memory.
Thnx in front.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025009#4025009
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025009
19Â years, 1Â month