- This topic has 4 replies, 3 voices, and was last updated 19 years, 6 months ago by kosl.
-
AuthorPosts
-
koslMemberHello,
I have a question about using XDoclet with CMP entity beans and JBoss. I have problems with datatype mapping. As far as I understand the standard mapping of type String is VARCHAR(50). Recently I had to define another mapping (namely to MEDIUMTEXT, I’m using MySQL) , I looked into the XDoclet documentation and I found out that the jdbc-type tag exists in two versions. One as @jboss.jdbc.type with parameter “type”. And second as parameter “jdbc-type” of the @ejb.persistence tag. The first seems for me to be ignored by the XDoclet and the second works. My question is, how should I know when to use which tag (or maybe I should use both of them?).The second question I have is concerning the “jdbc-type” possible values. In the documentation I’ve read that it has to be one of the fields of java.sql.Types, and there, of course, I can’t find the MEDIUMTEXT type (which is I suppose mySQL specific). My solution is that I use “BLOB” as “jdbc-type” and “MEDIUMTEXT” as “sql-type”. Is it the right solution (of course when I don’t want my beans to be easily transferable to other databases)?
thanx in advance for all advices
Karol Oslowski
Riyad KallaMemberI have asked our EJB guy to have a look at this.
GregMember@kosl wrote:
I have a question about using XDoclet with CMP entity beans and JBoss. I have problems with datatype mapping. As far as I understand the standard mapping of type String is VARCHAR(50). Recently I had to define another mapping (namely to MEDIUMTEXT, I’m using MySQL) , I looked into the XDoclet documentation and I found out that the jdbc-type tag exists in two versions. One as @jboss.jdbc.type with parameter “type”. And second as parameter “jdbc-type” of the @ejb.persistence tag. The first seems for me to be ignored by the XDoclet and the second works. My question is, how should I know when to use which tag (or maybe I should use both of them?).
Make sure that you are using the @ejb.persistence at the method level not class level. Can you post a sanitized version of your EJB so we can see the other tags you are using?
koslMember@support-greg wrote:
Make sure that you are using the @ejb.persistence at the method level not class level. Can you post a sanitized version of your EJB so we can see the other tags you are using?
Thx. for your answer, I’ll try to post it as soon as possible, unfortunatelly probably it will be on monday because at home I have no internet and during weekends I have usualy no internet access at all.
koslMemberThis is the code that I was writing about :
First version :
/**
* This is a cmp field. The cmp field is read/write.
* @ejb.interface-method view-type=”local”
* @ejb.persistence column-name=”LNAME”
* jdbc-type=”BLOB”
* sql-type=”MEDIUMTEXT”
*
*
*
*/
public abstract String getLastName();
public abstract void setLastName(String name);Second version :
/**
* This is a cmp field. The cmp field is read/write.
* @ejb.interface-method view-type=”local”
* @jboss.jdbc-type type=”BLOB”
*/
public abstract String getLastName();
public abstract void setLastName(String name);As I wrote the second version seems to be ignored by XDoclet and I don’t quite understand why.
kind regards
kosl
-
AuthorPosts