| 01:12:21,113 INFO [STDOUT] Hibernate: insert into Folder (name, parent_id,
TYPE, id) values (?, ?, 'org.jboss.mail.mailbox.Folder', null)
| 01:12:21,120 WARN [JDBCExceptionReporter] SQL Error: -10, SQLState: 23000
| 01:12:21,121 ERROR [JDBCExceptionReporter] Attempt to insert null into a
non-nullable column: column: ID table: FOLDER in statement [insert into Folder
(name, parent_id, TYPE, id) values (?, ?, 'org.jboss.mail.mailbox.Folder',
null)]
| 01:12:21,123 ERROR [[HtmlAdaptor]] Servlet.service() for servlet
HtmlAdaptor threw exception
|
Now I have:
| @Entity
@Inheritance(strategy=javax.persistence.InheritanceType.SINGLE_TABLE)
| public class Folder implements Serializable {
| ...
| /**
| * @return surrogate key
| */
| @Id @GeneratedValue(strategy=GenerationType.AUTO)
| public long getId() {
| return id;
| }
|
| protected void setId(long id) {
| this.id = id;
| }
| ...
| }
|
| @Entity
@Inheritance(strategy=javax.persistence.InheritanceType.SINGLE_TABLE)
| public class Mailbox extends Folder implements Serializable {
| ...
|
| ...
| }
|
| /*
| * (non-Javadoc)
| *
| * @see
org.jboss.mail.mailbox.MailboxService#createMailbox(java.lang.String)
| */
| @Tx(TxType.REQUIRED)
| public Mailbox createMailbox(String alias) {
| emInit();
| Mailbox box = new Mailbox();
| Alias aliasObj = new Alias();
| aliasObj.setName(alias);
| box.addAlias(aliasObj);
| Folder inbox = new Folder();
| inbox.setName("INBOX");
| inbox.setParent(box);
| box.setDefaultInFolder(inbox);
| box.setDefaultOutFolder(inbox);
| session.persist(box);
| session.persist(inbox);
| session.persist(aliasObj);
| return box;
| }
|
Some of the goody redundency was in the attempt to fix this. I started out
with field access. Note that this code worked under JBAS 403 SP1 before
upgrade to EJB3 RC5.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921386#3921386
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921386
-------------------------------------------------------
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