[JBoss Seam] - Re: EntityHome wire() and isWired()
by tynor
As Pete said in another thread earlier today:
anonymous wrote : seam-gen is a tool for quickly bootstrapping an application - it's not supposed to generate code you put straight into production.
>From my perspective as a Seam user (not a Seam committer), good documentation on how the Seam-gen'd classes and facelets work is pretty essential. They are the defacto way that Seam apps are constructed. The Seam propaganda encourages new projects to use Seamgen.
But the reality is that the generated files are really just a starting point for adaptation to a working application. As it is, there is scarce info about how the dozens of functions in EntityHome and EntityList are intended to be used and extended. Most of the functions don't even have javadoc.
The Seam reference manual has gotten quite a bit better from 1.2.1 to 2.0.0 (e.g. I found the sequence diagram for authentication quite enlightening) -- but I still don't see good examples of how the seamgen'd classes work and how they are expected to be extended (isWired(), wire(), getDefinedId(), etc.). None of the supplied examples use a seam-gen bootstrapped architecture, so we're left with no docs and no examples...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093648#4093648
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093648
18Â years, 8Â months
[JBoss Seam] - inserting into associations..
by minamti
How should I insert into associations.
Let's say I have the following tables..
create table user (
user_id bigint unsigned NOT NULL,
user_name varchar(255) NOT NULL,
PRIMARY KEY(user_id)
);
create table actions (
action_id tinyint unsigned not null,
action_name varchar(255) NOT NULL,
PRIMARY KEY(action_id));
create table user_actions (
user_id bigint unsigned not null,
action_id tinyint unsigned NOT NULL,
session_id varchar(255),
action_time TIMESTAMP NOT NULL,
PRIMARY KEY (user_id, action_id, session_id, action_timestamp)
FOREIGN KEY(user_id) REFERENCES user(user_id) ON UPDATE CASCADE ON DELETE RESTRICT,
FOREIGN KEY(action_id) REFERENCES actions(action_id) ON UPDATE CASCADE ON DELETE RESTRICT);
Lets say the user record exists and the action record exists. What is the way to insert a record into user_actions.
If I try to persist a UseractionsAssocHome object obtained from Component.getInstance, I get a EntityNotFound exception.
Caused by: org.jboss.seam.framework.EntityNotFoundException: entity not found: c
om.foo.entity.UserActionAssoc#com.foo.entity.UserActionAssocId@6bca1c13
at org.jboss.seam.framework.Home.handleNotFound(Home.java:109)
at org.jboss.seam.framework.EntityHome.find(EntityHome.java:75)
at org.jboss.seam.framework.Home.initInstance(Home.java:91)
at org.jboss.seam.framework.Home.getInstance(Home.java:71)
at org.jboss.seam.framework.EntityHome.persist(EntityHome.java:50)
at com.foo.entity.UserActionAssocHome.persist(UserActionAssocHome.jav
a:29)
Thanks,
M
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093647#4093647
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093647
18Â years, 8Â months
[JBoss Seam] - Re: seam generate-entities failure
by franciscoacb
"pete.muir(a)jboss.org" wrote : seam-gen is a tool for quickly bootstrapping an application - it's not supposed to generate code you put straight into production.
Why not, Pete?
I mean, I have always thinked that seam-gen generated code was what is suggested by JBoss Seam Team as a "good pratice", a good way to organize code etc.
You guys have a huge experience in developing web applications, infinitely greater than mine, as a newbie. So isn't it correct to assume that the generated code takes advantage of this experience and we can consider that the code is already (or at least almost) production-quality?
Cheers,
Francisco Antônio
"The biggest weapon against stress is our ability to choose a thought instead of another one." (WILLIAM JAMES)"
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093646#4093646
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093646
18Â years, 8Â months
[JBoss Seam] - Re: h:message for / s:decorate question
by Holger Prause
Well finally i found out how to(semi dirty workaround in my opinion)
Dont override the required message in your messages.properties
It will take effect for all your input fields where required is specified
When u got an internet application with just 1 form field thats maybe an solution
Instead specify the requiredMessage attribute on inputText tag
| <h:inputText id="myInput"
| requiredMessage="#{messages['inputLabel']}: #{messages['javax.faces.component.UIInput.REQUIRED']}"
| value="#{TestBean.value}"
| required="true" />
| <h:message for="myInput" />
|
Do the same for validation and converter messages, if your validator or converter outputs different message u got a problem becourse the decision what error message to output have to be made in the facelet via the
validatorMessage attribute.
>From jsf 1.2 api
anonymous wrote :
| ...will be used as the text of the validator message, replacing any message that comes from the validator.
|
The problem on this approach is the you override the default messages coming from the pre defined validators.
Maybe its all working in your enviroment better.
Well anyway i like seam but i dont like jsf
Bye and thx,
Holger
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093643#4093643
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093643
18Â years, 8Â months