This content has been marked as final.
Show 2 replies
-
1. Re: datasource testing
alex_enache Aug 29, 2007 3:07 AM (in response to alex_enache)Sorry I submited it, instead of previewing it :D. I'll continue my question here.
And I have the following bean:@Entity @Name("user") @Scope(SESSION) @Table(name="test") public class User implements Serializable { private static final long serialVersionUID = 1881413500711441951L; private int varsta; private String prenume; private String nume; private int id; public User(String newName, String newForname, int newAge, int newId) { nume = newName; prenume = newForname; varsta = newAge; id = newId; } public User() { System.out.println("========USER CREATED=========="); } @NotNull public String getNume() { return nume; } public void setNume(String newName) { nume = newName; } @NotNull public String getPrenume() { return prenume; } public void setPrenume(String newForname) { prenume = newForname; } @NotNull public int getVarsta() { return varsta; } public void setVarsta(int newAge) { varsta = newAge; } @Id @NotNull public int getId() { return id; } public void setId(int newId) { id = newId; } @Override public String toString() { return "User(" + nume + prenume + ")"; } }
This was basicly took from seam's registering example and modified a bit.
My table is:
nume varchar(20)
prenume varchar(20)
id int not null auto_increment, primary key
And on a page I have a very basic controller:
<h:outputText value="User name=#{user.nume}"/>
All this is enough in order for the bean to retrieve the info from the DB ?? cuz it doens't work :(.
Best regards,
Alex Enache -
2. Re: datasource testing
alex_enache Aug 29, 2007 3:09 AM (in response to alex_enache)the db also has a "varsta" field, of type int ... I've missed that.