These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: gen-property on v.3
PostPosted: Fri Aug 19, 2005 9:55 am 
Regular
Regular

Joined: Mon Jun 14, 2004 1:42 pm
Posts: 80
Location: Brazil
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.0x (alpha tools 4)
Mapping documents:
Code:
<hibernate-mapping package="teste">
   <class
      name="ClassT"
      table="ClassT"
   >   
<meta attribute="extends">teste.Stest</meta>

<meta attribute="class-code">
</meta>

      <id
         column="idClass"
         name="idClass"
         type="java.lang.Integer"
      >
         <generator class="increment">
         </generator>
      </id>   
      <property
         name="notVisible"
         column="visible"

         type="string"
         not-null="true"
        >
          <meta attribute="gen-property">false</meta>
      </property>
   </class>
</hibernate-mapping>

The generated POJO:
Code:
package teste;

import java.util.*;

/**
* ClassT generated by hbm2java
*/
public class ClassT extends teste.Stest implements java.io.Serializable {

    // Fields   

     private Integer idClass;
     private String notVisible;


    // Constructors

    /** default constructor */
    public ClassT() {
    }
   
    /** constructor with id */
    public ClassT(Integer idClass) {
        this.idClass = idClass;
    }
   
    // Property accessors

    /**
     *
     */
    public Integer getIdClass() {
        return this.idClass;
    }
   
    public void setIdClass(Integer idClass) {
        this.idClass = idClass;
    }

    /**
     *
     */
    public String getNotVisible() {
        return this.notVisible;
    }
   
    public void setNotVisible(String notVisible) {
        this.notVisible = notVisible;
    }

  // The following is extra code specified in the hbm.xml files


  // end of extra code specified in the hbm.xml files
}

Comments

Well I'm missing the old gen-property meta tag now... the notVisible attribute is implemented in the super class (Stest) and I don''t want to generate the method in the persistent class... is there a new way to do that? is it a bug ?

Thanks.

_________________
Alexandre Torres
--------------------


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 19, 2005 10:25 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
try with the latest cvs version before reporting it as a bug (i think its fixed there)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: gen-property on v.3
PostPosted: Fri Dec 14, 2007 2:31 pm 
Newbie

Joined: Fri Dec 14, 2007 2:23 pm
Posts: 2
Has this issue been resolved? I'm having the same problem. The property is not generated but a reference to it appears in the full constructor.

Code:
   <property name="extractDate" type="date">
         <meta attribute="gen-property">false</meta>
      </property>


Code:
public Application(Date applicationDate, String applicationNumber, Date extractDate) {
       this.applicationDate = applicationDate;
       this.applicationNumber = applicationNumber;
       this.extractDate = extractDate;
}


The error code reads:
Quote:
extractDate cannot be resolved or is not a field


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 14, 2007 2:40 pm 
Newbie

Joined: Fri Dec 14, 2007 2:23 pm
Posts: 2
It looks like a JIRA was created on this issue but no resolution was posted.

http://opensource.atlassian.com/project ... WyPhZNme0v


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 15, 2007 4:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
there is a file for which I asked to get the patch for, but no reply so far.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.