-->
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.  [ 3 posts ] 
Author Message
 Post subject: @hibernate.property tag is being ignored
PostPosted: Wed Jan 07, 2004 8:30 pm 
Newbie

Joined: Wed Jan 07, 2004 6:36 pm
Posts: 4
I'm trying to get a xdoclet to generate my mapping file.

I have a trivial class:

Code:
package org.petsoar.pets;
/**
* @hibernate.class table="PETS"
*/
public class Pet
{
    private Long   id;
    private String petName;

   /*
    * @hibernate.property column="pet_name" type="string" unique="true"
    * @return
    */
   public String getPetName()
   {
      return petName;
   }

   public void setPetName(String string)
   {
      petName = string;
   }
   
    public void setId(Long l)
    {
        id = l;
    }

    /**
     * @hibernate.id generator-class="native" column="PET_ID"
     */
    public Long getId()
    {
        return id;
    }
}


The generated mapping file looks as follows:

Code:
<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
    <class
        name="org.petsoar.pets.Pet"
        table="PETS"
        dynamic-update="false"
        dynamic-insert="false"
    >

        <id
            name="id"
            column="PET_ID"
            type="java.lang.Long"
        >
            <generator class="native">
            </generator>
        </id>

        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-Pet.xml
            containing the additional properties and place it in your merge dir.
        -->

    </class>

</hibernate-mapping>


For whatever reason, xdoclet is not picking up my hibernate.property tag.

Is there anything obvious I'm doing wrong? I'm using the latest version of xdoclet and of hibernate.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2004 8:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Code:
  /*
    * @hibernate.property column="pet_name" type="string" unique="true"

Missing a * after /*


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2004 11:52 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Just to be clear:


Code:
   /**
    * @hibernate.property column="pet_name" type="string" unique="true"
    * @return
    */


Note the '/**'. It's javadoc, you know.


Sherman


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.