-
1. Re: jboss-5.0.0alpha build
bill.burke Jan 17, 2005 9:28 AM (in response to graysonpierce)how can this be? Well...the @Dependent annotation has changed to @Embedded and I haven't updated(forgot) the tutorial yet.
Bill -
2. Re: jboss-5.0.0alpha build
graysonpierce Jan 17, 2005 1:55 PM (in response to graysonpierce)Bill,
Thank you for the quick response. This begs the questions, where do you go for the latest ejb 3.0 spec? I specifically checked the one on JBoss and Sun websites before posting. -
3. Re: jboss-5.0.0alpha build
bill.burke Jan 17, 2005 2:36 PM (in response to graysonpierce)www.jcp.org
the ejb3 in CVS is different than the draft you will get at the jcp.org because we are working with a version not yet public.
Bill -
4. Re: jboss-5.0.0alpha build
stralnet Jan 20, 2005 7:01 AM (in response to graysonpierce)"graysonpierce" wrote:
Per previous discussion, if you cvs checkout jboss-head and build it you end up with a jboss-5.0.0alpha build in the output directory. When you try to run the tutorials agains this build, the entity tutorial works just fine (purchase_order, lineitems, etc)
however if you try to run the composite key tutorial you get the following
16:01:18,814 ERROR [Ejb3Module] Starting failed jboss.j2ee:service=EJB3,module=t
utorial.ejb3
java.lang.TypeNotPresentException: Type javax.ejb.Dependent not present
How can this be?
I've been looking through the source for ejb3, and noticed that the getIdColumn method of EntityToHibernateXML assumes that the class has a single primary key.
I made a change to that to check for an EmbeddedId and I got that example to work properly.
I now have a problem with a project I am working on with EJB3 in that I have an abstract entity which all my other entities extend, but the highest abstract class is the only one with a primary key, and it is a composite key.
org.hibernate.MappingException: Foreign key (UserBean [pk])) must have same number of columns as the referenced primary key (ItemBean [id,configurationDirectory,suffix])
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:85)
at org.hibernate.mapping.ForeignKey.setReferencedTable(ForeignKey.java:51)
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:889)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:837)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:996)
at org.jboss.ejb3.HibernateSessionFactory.createSessionFactory(HibernateSessionFactory.java:157)
at org.jboss.ejb3.Ejb3Module.createHibernateSessionFactory(Ejb3Module.java:212)
at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:224)
You got any Tips Bill? I'm happy to hack at the code myself... -
5. Re: jboss-5.0.0alpha build
bill.burke Jan 20, 2005 8:48 AM (in response to graysonpierce)@Inheritance won't work with composite keys yet.
http://jira.jboss.com/jira/browse/EJBTHREE-45
(just entered in today)
Is this your problem? Or are you just doing
abstract class Foo
{
@EmbeddedId MyPK pk;
}
@Entity
public class FooImpl extends Foo
{
}
where Foo is not annotated as @Entity -
6. Re: jboss-5.0.0alpha build
stralnet Jan 20, 2005 3:25 PM (in response to graysonpierce)Nup, I've got Foo as an Entity too...
I guess I'll just use an autogenerated primary key and ensure the uniqueness of the other fields manually. -
7. Re: jboss-5.0.0alpha build
bill.burke Jan 20, 2005 3:37 PM (in response to graysonpierce)ok this is a bug then and on the TODO list for the release at the end of the month
-
8. Re: jboss-5.0.0alpha build
emsa Jan 21, 2005 8:46 AM (in response to graysonpierce)"bill.burke@jboss.com" wrote:
www.jcp.org
the ejb3 in CVS is different than the draft you will get at the jcp.org because we are working with a version not yet public.
Bill
Is there any ETA for the next public draft?
/Magnus