Discussion:
[Middlegen-user] Next problem
Pete Clark
2002-09-26 12:00:02 UTC
Permalink
Okay, I replaced the jars with the jars used in the 2.0b1 samples lib
directory and I'm now getting Local and LocalHome interfaces.



Next problems:



1) What happened to my primary key constructors? I can no longer with
middlegen 2.0 get PK classes that let me create a primarykey like

TableTPK(Integer primaryKey) . and I have pkclass=true.



2) I'm generating finder methods and they're being incorrectly
translated to JBoss. for example.



08:42:01,530 DEBUG [findByCurrentVersionId] EJB-QL: SELECT DISTINCT
OBJECT(o) FROM AppT o WHERE

o.currentVersionId = ?1

translates to:

08:42:01,530 DEBUG [findByCurrentVersionId] SQL: SELECT DISTINCT FROM
app_t t0_o WHERE t0_o.cu

rrentVersionID = ?



. missing the field names in the generated SQL. Is this a Jboss bug?



Pete
a***@netcom.no
2002-09-26 14:51:07 UTC
Permalink
----- Original Message -----
From: "Pete Clark" <***@directvinternet.com>
Date: Thursday, September 26, 2002 2:57 pm
Subject: [Middlegen-user] Next problem
Post by Pete Clark
Okay, I replaced the jars with the jars used in the 2.0b1 samples lib
directory and I'm now getting Local and LocalHome interfaces.
Good.
Post by Pete Clark
1) What happened to my primary key constructors? I can no longer with
middlegen 2.0 get PK classes that let me create a primarykey like
TableTPK(Integer primaryKey) . and I have pkclass=true.
First, the pkclass attribute has nothing to do with pk generation at
run-time. -This is *build-time*. It's a hint to Middlegen about whether
a Primary Key *class* should be generated for each EJB. Read the docs.
http://boss.bekk.no/boss/middlegen/plugins/cmp20.html#pkclass

As of version 2.0 EJBs generated by Middlegen can (optionally) generate
their own primary key *values* at *run-time*. There are two schemes:
Sequence Block and GUID. These are documented on the same page as above.

-So if any of these are turned on, the generated EJBs will not have pk
arguments, as they will be generated internally in the ejbCreate method.

If you prefer to create your own keys (why would you?), just set
gui="false" and don't use a sequenceblock element.

Also not that if you're on WebLogic, you can take advantage of
WebLogic's proprietary pk generation feature. If you use this and
deploy to WLS, the proprietary pk gen mechanism will be used regardless
of guid and sequenceblock.
Post by Pete Clark
2) I'm generating finder methods and they're being incorrectly
translated to JBoss. for example.
08:42:01,530 DEBUG [findByCurrentVersionId] EJB-QL: SELECT DISTINCT
OBJECT(o) FROM AppT o WHERE
o.currentVersionId = ?1
08:42:01,530 DEBUG [findByCurrentVersionId] SQL: SELECT DISTINCT FROM
app_t t0_o WHERE t0_o.cu
rrentVersionID = ?
. missing the field names in the generated SQL. Is this a Jboss bug?
It's really hard to tell, since you didn't enclose the relevant part of
the deployment descriptor. It could be Middlegen, XDoclet or JBoss.

Take a look at this page: (no, the content is not offensive)
http://boss.bekk.no/boss/middlegen/nude.html

HTH,
Aslak
Post by Pete Clark
Pete
Loading...