[EJB/JBoss] - What is wrong with my local ejb JNDI lookup code (or the ejb
by sairndain
I'm trying to perform a JNDI lookup on a local stateless session bean.
When I use the jboss jmx console to check the JNDI name space I get the following:
anonymous wrote : +- HandleDelegate (class: org.jboss.proxy.ejb.handle.HandleDelegateImpl)
| +- ORB (class: org.jacorb.orb.ORB)
| +- env (class: org.jnp.interfaces.NamingContext)
| | +- ejb (class: org.jnp.interfaces.NamingContext)
| | | +- DddEJBBeanLocal[link -> local/DddEJBBean@16619879] (class: javax.naming.LinkRef)
| | +- DddEJBRemoteHome[link -> DddEJBBean] (class: javax.naming.LinkRef)
The code I am using for the JNDI lookup is as follows:
private DddEJBLocal lookupDddEJBBean() {
| try {
| Context c = new InitialContext();
| DddEJBLocalHome rv = (DddEJBLocalHome) c.lookup("java:comp/env/ejb/DddEJBBeanLocal");
| return rv.create();
| } catch (NamingException ne) {
| java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", ne);
| throw new RuntimeException(ne);
| } catch (CreateException ce) {
| java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", ce);
| throw new RuntimeException(ce);
| }
| }
The ejb-jar.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
| <ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
| <enterprise-beans>
| <session>
| <display-name>DddEJBSB</display-name>
| <ejb-name>DddEJBBean</ejb-name>
| <home>ddd.ejb.DddEJBRemoteHome</home>
| <remote>ddd.ejb.DddEJBRemote</remote>
| <local-home>ddd.ejb.DddEJBLocalHome</local-home>
| <local>ddd.ejb.DddEJBLocal</local>
| <ejb-class>ddd.ejb.DddEJBBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
|
| <ejb-ref>
| <description>DddEJBBean</description>
| <ejb-link>dddEAR-ejb.jar#DddEJBBean</ejb-link>
| <ejb-ref-name>DddEJBRemoteHome</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <home>ddd.ejb.DddEJBRemoteHome</home>
| <remote>ddd.ejb.DddEJBRemote</remote>
| </ejb-ref>
|
| <ejb-local-ref>
| <description>DddEJBBean</description>
| <ejb-link>dddEAR-ejb.jar#DddEJBBean</ejb-link>
| <ejb-ref-name>ejb/DddEJBBeanLocal</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <local-home>ddd.ejb.DddEJBLocalHome</local-home>
| <local>ddd.ejb.DddEJBLocal</local>
| </ejb-local-ref>
|
| </session>
| </enterprise-beans>
| <assembly-descriptor>
| <container-transaction>
| <method>
| <ejb-name>DddEJBBean</ejb-name>
| <method-name>*</method-name>
| </method>
| <trans-attribute>Required</trans-attribute>
| </container-transaction>
| </assembly-descriptor>
| </ejb-jar>
I get the the following error:
anonymous wrote : javax.naming.NameNotFoundException: ejb not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:716)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at ddd.ejb.DddHelper.lookupDddEJBBean(DddHelper.java:32)
QUESTION#1:
What is wrong with my lookup code or the ejb-jar.xml configuration?
QUESTION#2
Are proprietary JBoss configuration files (e.g., jboss.xml) required in order to successfully perform a JNDI lookup on the above mentioned bean?
Thanks for any help! --sd
[More information... if needed]
***ddd.ejb.DddEJBBean***
package ddd.ejb;
|
| import javax.ejb.SessionBean;
| import javax.ejb.SessionContext;
|
| /**
| *
| * @author sairndain
| */
| public class DddEJBBean implements SessionBean {
|
| private SessionContext context;
|
| // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click the + sign on the left to edit the code.">;
|
| // TODO Add code to acquire and use other enterprise resources (DataSource, JMS, enterprise bean, Web services)
| // TODO Add business methods or web service operations
|
| /**
| * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
| */
| public void setSessionContext(SessionContext aContext) {
| context = aContext;
| }
|
| /**
| * @see javax.ejb.SessionBean#ejbActivate()
| */
| public void ejbActivate() {
|
| }
|
| /**
| * @see javax.ejb.SessionBean#ejbPassivate()
| */
| public void ejbPassivate() {
|
| }
|
| /**
| * @see javax.ejb.SessionBean#ejbRemove()
| */
| public void ejbRemove() {
|
| }
|
| // </editor-fold>;
|
| /**
| * See section 7.10.3 of the EJB 2.0 specification
| * See section 7.11.3 of the EJB 2.1 specification
| */
| public void ejbCreate() {
| // TODO implement ejbCreate if necessary, acquire resources
| // This method has access to the JNDI context so resource aquisition
| // spanning all methods can be performed here such as home interfaces
| // and data sources.
| }
|
| private String field1 = "...value of field1 in DddEJBBean.java...";
| public String getField1() {
| System.out.println(".................DddEJBBean/getField1()..............");
|
| return this.field1;
| }
|
| // Add business logic below. (Right-click in editor and choose
| // "EJB Methods > Add Business Method" or "Web Service > Add Operation")
|
| }
|
***ddd.ejb.DddHelper***
package ddd.ejb;
|
| import javax.ejb.CreateException;
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.naming.NamingException;
|
| /**
| *
| * @author sairndain
| */
| public class DddHelper {
|
|
| private String field1 = "...value of field1 in DddHelper.java...";
| public String getField1()
| {
| System.out.println(".................DddHelper/getField1()..............");
|
| DddEJBLocal localref = this.lookupDddEJBBean();
| return localref.getField1() + this.field1;
| }
|
| private DddEJBLocal lookupDddEJBBean() {
| try {
| Context c = new InitialContext();
| DddEJBLocalHome rv = (DddEJBLocalHome) c.lookup("java:comp/env/ejb/DddEJBBeanLocal");
| return rv.create();
| } catch (NamingException ne) {
| java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", ne);
| throw new RuntimeException(ne);
| } catch (CreateException ce) {
| java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", ce);
| throw new RuntimeException(ce);
| }
| }
| }
|
***ddd.web.WelcomeJSFBean***
package ddd.web;
|
| import ddd.ejb.DddHelper;
|
| /**
| *
| * @author sairndain
| */
|
| public class WelcomeJSFBean {
|
| /** Creates a new instance of WelcomeJSFBean */
| public WelcomeJSFBean() {
| }
|
| private String field1 = "...value of field1 in WelcomeJSFBean.java...";
| public String getField1()
| {
| System.out.println(".................WelcomeJSFBean/getField1()..............");
| DddHelper dh = new DddHelper();
| return dh.getField1() + this.field1;
| }
| }
***web.xml***
<?xml version="1.0" encoding="UTF-8"?>
| <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.faces</url-pattern>
| </servlet-mapping>
| <session-config>
| <session-timeout>
| 30
| </session-timeout>
| </session-config>
| <welcome-file-list>
| <welcome-file>welcomeJSF.faces</welcome-file>
| </welcome-file-list>
| </web-app>
|
***
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118913#4118913
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118913
18 years, 3 months
[Security & JAAS/JBoss] - Re: looking for working example: custom login module extends
by ragavgomatam
I have a custom login module that is working fine with jboss 4.2.1 and jboss 5 Beta 3. Caveat is I extend the AbstractServerLoginModule NOT UsernamePasswordLoginModule. But this should not a big issue as UsernamePasswordLoginModule extends AbstractServerLoginModule. So enjoy...
Code
package com.jaas.module;
|
| import java.math.BigDecimal;
| import java.security.Principal;
| import java.security.acl.Group;
| import java.sql.SQLException;
| import java.util.Arrays;
| import java.util.Map;
| import java.util.Set;
|
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.naming.NamingException;
| import javax.security.auth.Subject;
| import javax.security.auth.callback.Callback;
| import javax.security.auth.callback.CallbackHandler;
| import javax.security.auth.callback.NameCallback;
| import javax.security.auth.callback.PasswordCallback;
| import javax.security.auth.callback.UnsupportedCallbackException;
| import javax.security.auth.login.LoginException;
| import javax.sql.DataSource;
|
| import org.apache.commons.dbutils.QueryRunner;
| import org.apache.commons.dbutils.handlers.ArrayHandler;
| import org.jboss.security.SimpleGroup;
| import org.jboss.security.SimplePrincipal;
| import org.jboss.security.auth.spi.AbstractServerLoginModule;
|
| public class CustomLoginModule extends AbstractServerLoginModule {
|
| private Principal principal;
|
| private String authSql;
|
| private String rolesSql;
|
| private String name = null;
|
| private String password = null;
|
| @SuppressWarnings("unused")
| private String ssn = null;
|
| public void initialize(Subject subject, CallbackHandler callbackHandler,
| Map sharedState, Map options) {
| super.initialize(subject, callbackHandler, sharedState, options);
| this.authSql = (String) options.get("authSql");
| this.rolesSql = (String) options.get("rolesSql");
| }
|
| public boolean login() throws LoginException {
|
| //this is a protected boolean in Super class
| loginOk = false;
| if (this.callbackHandler == null) {
| throw new LoginException("No callback handler is available");
| }
|
| Callback callbacks[] = new Callback[2];
|
| callbacks[0] = new NameCallback("Name :");
| callbacks[1] = new PasswordCallback("Password :", false);
|
| try {
| this.callbackHandler.handle(callbacks);
| name = ((NameCallback) callbacks[0]).getName().trim();
| password = new String(((PasswordCallback) callbacks[1])
| .getPassword());
|
| Object[] results = (Object[]) getQueryRunner().query(authSql,
| new Object[] { name, password }, new ArrayHandler());
|
| ssn = ((BigDecimal) results[3]).toString();
| principal = new CustomPrincipal((String) results[0],
| (String) results[1], ((BigDecimal) results[2]).toString(),
| ((BigDecimal) results[3]).toString());
|
| loginOk = true;
|
| } catch (java.io.IOException ioe) {
| ioe.printStackTrace();
| throw new LoginException(ioe.toString());
| } catch (UnsupportedCallbackException ce) {
| ce.printStackTrace();
| throw new LoginException("Error: " + ce.getCallback().toString());
| } catch (SQLException ex) {
| ex.printStackTrace();
| }
| return loginOk;
| }
|
| @Override
| protected Principal getIdentity() {
| return this.principal;
| }
|
| @Override
| protected Group[] getRoleSets() {
|
| Group roleGroup = new SimpleGroup("Roles");
| Group callerPrincipal = new SimpleGroup("CallerPrincipal");
| Group[] groups = { roleGroup, callerPrincipal };
|
| try {
| Object[] grps = (Object[]) getQueryRunner().query(rolesSql,
| new Object[] { name }, new ArrayHandler());
| for (int i = 0; i < grps.length; i++) {
| roleGroup.addMember(new SimplePrincipal(((String) grps)
| .trim()));
| }
| } catch (SQLException ex) {
| ex.printStackTrace();
| }
| callerPrincipal.addMember(this.principal);
| return groups;
| }
|
| public boolean commit() throws LoginException {
|
| boolean flag = false;
|
| if (!loginOk) {
| abort();
| throw new LoginException(
| "Error: Username Password failed to authenticate ");
| }
|
| if (loginOk) {
| Set<? super Principal> setOfPrincipals = subject.getPrincipals();
| setOfPrincipals.add(this.principal);
| setOfPrincipals.addAll(Arrays.asList(this.getRoleSets()));
| flag = true;
| } else {
| flag = false;
| }
| return flag;
| }
|
| public boolean logout() {
|
| this.subject.getPrincipals().remove(this.principal);
| subject = null;
| return true;
|
| }
|
| public boolean abort() {
|
| if ((subject != null) && (this.principal != null)) {
| Set setOfPrincipals = subject.getPrincipals();
| setOfPrincipals.remove(this.principal);
| }
| subject = null;
| this.principal = null;
| return true;
|
| }
|
| private Context getContext() throws NamingException {
| return new InitialContext();
| }
|
| private DataSource getDataSource() {
| DataSource ds = null;
| try {
| ds = (DataSource) getContext().lookup("java:jdbc/OracleDS");
| } catch (NamingException ne) {
| ne.printStackTrace();
| }
| return ds;
| }
|
| private QueryRunner getQueryRunner() {
| return new QueryRunner(getDataSource());
| }
|
| }
|
|
|
My Custom Principal
Code
package com.jaas.module;
|
| import java.security.Principal;
|
| public class CustomPrincipal implements Principal {
|
| private String firstName;
|
| private String lastName;
|
| private int age;
|
| private int ssn;
|
| public String getName() {
| String name = "";
| name = this.lastName != null ? this.firstName + " " + this.lastName
| : this.firstName;
| return name;
| }
|
| public String getFirstName() {
| return this.firstName;
| }
|
| public String getLastName() {
| return this.lastName;
| }
|
| public int getAge() {
| return this.age;
| }
|
| private void setFirstName(String firstName) {
| this.firstName = firstName;
| }
|
| private void setLastName(String lastName) {
| this.lastName = lastName;
| }
|
| private void setAge(String age) {
| this.age = Integer.parseInt(age);
| }
|
| public CustomPrincipal(String fName, String lName, String age, String ssn) {
| setFirstName(fName.trim());
| if (lName != null)
| setLastName(lName.trim());
| setAge(age.trim());
| setSsn(ssn.trim());
| }
|
| public CustomPrincipal(String name) {
| setFirstName(name.trim());
| }
|
| public int getSsn() {
| return this.ssn;
| }
|
| public void setSsn(String ssn) {
| this.ssn = Integer.parseInt(ssn);
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118904#4118904
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118904
18 years, 3 months
[EJB 3.0] - Transactions broken? Trivial Hibernate example with EJB3 and
by smithmb
Hello folks,
I'm trying to create a trivial example of a transaction working correctly with MySQ L5.0.x and local-tx-datasource and Connector/J 3.x. I'm using Hibernate and EJB3, and JBoss 4.0.x. I cannot get transactions to rollback w/ SessionContext.setRollbackOnly() OR by throwing an uncaught EJB/Runtime exception.
Rolling back via the mysql command line client works great, and the tables in question are InnoDB.
Here is my documentation of the problem -- I'd love it if anyone can tell me anything that looks weird. Please help -- this is so trivial it SHOULD work!
mysql-ds.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>MySqlDS</jndi-name>
| <connection-url>jdbc:mysql://127.0.0.1:3306/scheduler_db</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>censored</user-name>
| <password>censored</password>
| <metadata>
| <type-mapping>mySQL</type-mapping>
| </metadata>
| </local-tx-datasource>
| </datasources>
|
persistence.xml:
| <persistence>
| <persistence-unit name="persistence-unit">
| <jta-data-source>java:/MySqlDS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| <property name="hibernate.connection.release_mode" value="auto"/>
| <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
| </properties>
| </persistence-unit>
| </persistence>
|
My EJB3 session bean:
| @Stateless
| public class TestBean implements TestBeanLocal, TestBeanRemote
| {
|
| @PersistenceContext(name = "persistence-unit")
| EntityManager em;
|
| @Resource
| SessionContext ctx;
|
| public static final String RemoteJNDIName = "example/" + TestBean.class.getSimpleName() + "/remote";
| public static final String LocalJNDIName = "example/" + TestBean.class.getSimpleName() + "/local";
|
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| public void test()
| {
| Book book = new Book(null, "My first book", "Person 1");
| em.persist(book);
|
| Book book2 = new Book(null, "My second book", "Person 2");
| em.persist(book2);
|
| System.out.println("CURRENT TRANSACTION STATUS 1: " + (ctx.getRollbackOnly() ? "ROLLBACK" : "NOT ROLLBACK"));
| ctx.setRollbackOnly();
| System.out.println("CURRENT TRANSACTION STATUS 2: " + (ctx.getRollbackOnly() ? "ROLLBACK" : "NOT ROLLBACK"));
|
| Book book3 = new Book(null, "My third book", "Person 3");
| em.persist(book3);
|
| List someBooks = em.createQuery("from Book").getResultList();
|
| for (Iterator iter = someBooks.iterator(); iter.hasNext();)
| {
| Book element = (Book) iter.next();
| em.remove(element);
| }
| }
|
My test client:
| public static void main(String[] args) throws Exception
| {
| Properties properties = new Properties();
| properties.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| properties.put("java.naming.factory.url.pkgs", "=org.jboss.naming:org.jnp.interfaces");
| properties.put("java.naming.provider.url", "localhost:1099");
| Context context = new InitialContext(properties);
|
| TestBeanRemote beanRemote = (TestBeanRemote) context.lookup(TestBean.RemoteJNDIName);
| beanRemote.test();
| }
|
Output log from JBoss:
| 2008-01-10 17:15:40,755 DEBUG [org.jboss.remoting.transport.socket.ServerThread] WAKEUP in SERVER THREAD
| 2008-01-10 17:15:40,991 DEBUG [org.jboss.remoting.transport.socket.ServerThread] beginning dorun
| 2008-01-10 17:15:41,211 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4915213685571584
| 2008-01-10 17:15:41,211 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
| 2008-01-10 17:15:41,211 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
| 2008-01-10 17:15:41,211 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
| 2008-01-10 17:15:41,211 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Transaction already joined
| 2008-01-10 17:15:41,220 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] executing identity-insert immediately
| 2008-01-10 17:15:41,224 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
| 2008-01-10 17:15:41,224 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
| 2008-01-10 17:15:41,352 DEBUG [org.hibernate.SQL] insert into book (title, author) values (?, ?)
| 2008-01-10 17:15:41,420 DEBUG [org.hibernate.id.IdentifierGeneratorFactory] Natively generated identity: 1
| 2008-01-10 17:15:41,420 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
| 2008-01-10 17:15:41,420 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
| 2008-01-10 17:15:41,420 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
| 2008-01-10 17:15:41,420 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] executing identity-insert immediately
| 2008-01-10 17:15:41,421 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
| 2008-01-10 17:15:41,421 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
| 2008-01-10 17:15:41,421 DEBUG [org.hibernate.SQL] insert into book (title, author) values (?, ?)
| 2008-01-10 17:15:41,421 DEBUG [org.hibernate.id.IdentifierGeneratorFactory] Natively generated identity: 2
| 2008-01-10 17:15:41,421 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
| 2008-01-10 17:15:41,421 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
| 2008-01-10 17:15:41,421 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
| 2008-01-10 17:15:41,421 INFO [STDOUT] CURRENT TRANSACTION STATUS 1: NOT ROLLBACK
| 2008-01-10 17:15:41,422 INFO [STDOUT] CURRENT TRANSACTION STATUS 2: ROLLBACK
| 2008-01-10 17:15:41,422 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** closing entity managersession **************
| 2008-01-10 17:15:41,447 DEBUG [org.jboss.remoting.transport.socket.ServerThread] begin thread wait
|
Book.java (the hibernate entity):
| @Entity
| @Table(name = "book")
| @SequenceGenerator(name = "book_sequence", sequenceName = "book_id_seq")
| public class Book implements Serializable
| {
| /**
| *
| */
| private static final long serialVersionUID = -9108127436362270765L;
| private Integer id;
| private String title;
| private String author;
|
| public Book()
| {
| super();
| }
|
| public Book(Integer id, String title, String author)
| {
| super();
| this.id = id;
| this.title = title;
| this.author = author;
| }
|
| @Override
| public String toString()
| {
|
| return "Book: " + getId() + " Title " + getTitle() + " Author " + getAuthor();
| }
|
| /**
| * @return the author
| */
| public String getAuthor()
| {
| return author;
| }
|
| /**
| * @param author the author to set
| */
| public void setAuthor(String author)
| {
| this.author = author;
| }
|
| /**
| * @return the id
| */
| @Id
| @GeneratedValue(strategy = GenerationType.AUTO, generator = "book_sequence")
| public Integer getId()
| {
| return id;
| }
|
| /**
| * @param id the id to set
| */
| public void setId(Integer id)
| {
| this.id = id;
| }
|
| /**
| * @return the title
| */
| public String getTitle()
| {
| return title;
| }
|
| /**
| * @param title the title to set
| */
| public void setTitle(String title)
| {
| this.title = title;
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118903#4118903
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118903
18 years, 3 months