[jboss-user] [Datasource Configuration] - Re: xa-datasource x creating tables in both database

Luciano Borges do-not-reply at jboss.com
Wed Jul 4 09:44:10 EDT 2012


Luciano Borges [https://community.jboss.org/people/lucianoborges] created the discussion

"Re: xa-datasource x creating tables in both database"

To view the discussion, visit: https://community.jboss.org/message/746092#746092

--------------------------------------------------------------
Hi Wolf.

My war look like this:

twophasecommit.war
`-- WEB-INF
    |-- classes
    |   |-- example
    |   |   `-- twophasecommit
    |   |       |-- entity
    |   |       |   |-- Book.class
    |   |       |   `-- BookSummary.class
    |   |       `-- persistence
    |   |           |-- BookDAO.class
    |   |           `-- BookSummaryDAO.class
    |   |-- META-INF
    |   |   `-- persistence.xml
    |-- lib
    |   
    `-- web.xml

My JBoss is 6.1.

My entities:

package example.twophasecommit.domain;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

@Entity
public class *Book* implements Serializable {

private static final long serialVersionUID = 1L;

          @Id
          @GeneratedValue
          private Long id;

          @Column
          private String title;

          @Column
          private String author;

          public Book() {
                    super();
          }

          public Book(String title, String author) {
                    this.title = title;
                    this.author = author;
          }

          public Long getId() {
                    return id;
          }

          public void setId(Long id) {
                    this.id = id;
          }

  public String getTitle() {
                    return title;
          }

          public void setTitle(String title) {
                    this.title = title;
          }

          public String getAuthor() {
                    return author;
          }

          public void setAuthor(String author) {
                    this.author = author;
          }
}
---------------
package example.twophasecommit.domain;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class *BookSummary* implements Serializable{

          private static final long serialVersionUID = 1L;

          @Id
          private int id;

          private String summary;

          public String getSummary() {
                    return summary;
          }

          public void setSummary(String summary) {
                    this.summary = summary;
          }

          public void setId(int id) {
                    this.id = id;
          }

          public int getId() {
                    return id;
          }

}

Thanks,
Luciano
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/746092#746092]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120704/439745ab/attachment.html 


More information about the jboss-user mailing list