facebook

XDoclet tags with JBoss

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #228254 Reply

    kosl
    Member

    Hello,
    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

    #228268 Reply

    Riyad Kalla
    Member

    I have asked our EJB guy to have a look at this.

    #228338 Reply

    Greg
    Member

    @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?

    #228556 Reply

    kosl
    Member

    @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.

    #228792 Reply

    kosl
    Member

    This 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

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: XDoclet tags with JBoss

You must be logged in to post in the forum log in