Other notes - I generated this from a SQL Server database with two tables.
Here is the hibernate tools script that generated this DB:
| create table sso_user (
| id numeric(19,0) identity not null,
| a_number varchar(255) not null unique,
| primary key (id)
| )
| create table user_link (
| id numeric(19,0) identity not null,
| user_id numeric(19,0) not null,
| url varchar(255) not null,
| title varchar(255) not null,
| description varchar(255) null,
| view_order numeric(19,0) null,
| update_date datetime not null,
| create_date datetime not null,
| primary key (id)
| )
| alter table user_link
| add constraint fk_user_link__user
| foreign key (user_id)
| references sso_user
| Feb 14, 2006 2:59:28 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
|
| package com.sso.domain;
| // Generated Feb 14, 2006 3:20:16 PM by Hibernate Tools 3.1.0.beta4
|
| import java.math.BigDecimal;
| import java.util.HashSet;
| import java.util.Set;
| import javax.persistence.CascadeType;
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.FetchType;
| import javax.persistence.Id;
| import javax.persistence.OneToMany;
| import javax.persistence.Table;
| import javax.persistence.UniqueConstraint;
|
|
| /**
| * SsoUser generated by hbm2java
| */
| @Entity
| @Table(name="sso_user"
| , uniqueConstraints = { @UniqueConstraint( columnNames = { "a_number" } ) }
| )
|
| public class SsoUser implements java.io.Serializable {
|
|
| // Fields
|
| private BigDecimal id;
| private String ANumber;
| private Set<UserLink> userLinks = new HashSet<UserLink>(0);
|
|
| // Constructors
|
| /** default constructor */
| public SsoUser() {
| }
|
| /** minimal constructor */
| public SsoUser(BigDecimal id, String ANumber) {
| this.id = id;
| this.ANumber = ANumber;
| }
|
| /** full constructor */
| public SsoUser(BigDecimal id, String ANumber, Set<UserLink> userLinks) {
| this.id = id;
| this.ANumber = ANumber;
| this.userLinks = userLinks;
| }
|
|
|
| // Property accessors
| @Id
| @Column(name="id", unique=true, nullable=false, insertable=true,
updatable=true, scale=0)
|
| public BigDecimal getId() {
| return this.id;
| }
|
| public void setId(BigDecimal id) {
| this.id = id;
| }
| @Column(name="a_number", unique=true, nullable=false, insertable=true,
updatable=true)
|
| public String getANumber() {
| return this.ANumber;
| }
|
| public void setANumber(String ANumber) {
| this.ANumber = ANumber;
| }
| @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.LAZY,
mappedBy="ssoUser")
|
| public Set<UserLink> getUserLinks() {
| return this.userLinks;
| }
|
| public void setUserLinks(Set<UserLink> userLinks) {
| this.userLinks = userLinks;
| }
|
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3923720#3923720
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3923720
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user