-->
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.  [ 1 post ] 
Author Message
 Post subject: Update Schema with custom annotation type
PostPosted: Wed Feb 07, 2007 12:59 pm 
Newbie

Joined: Wed Feb 07, 2007 12:48 pm
Posts: 3
Hi to everybody!
I have a very strange problem!
I create my annotation type for fuzzy date (i change every field that is a single date with this type, so in the db every date is rappresented by two extreme).

For problem with XML generation, i use this annotation in the hbm.xml file in this way:
Code:
        <property name="date" type="FDHibernateType" node="date">
         <column name = "date_fz_fr"/>
         <column name = "date_fz_to"/>
        </property>


If i use my entity everything gone right, but if i try to update the schema i have a problem, this is the code that permit the update of the schema:

Code:

AnnotationConfiguration privateConfig = new AnnotationConfiguration();
            privateConfig.setNamingStrategy(new HibernateNamingStrategy());
            privateConfig.setProperties(HibernateUtil.getConfiguration().getProperties());

  Class cls = (TestFDate2Entity.class);
       
        if (cls.isAnnotationPresent(Entity.class))
            privateConfig.addAnnotatedClass(cls);
        else
            privateConfig.addClass(cls);
       
       
        SchemaUpdate su = new SchemaUpdate(privateConfig);
        su.execute(true, false);



but in the column data is type raw and he don't create the two column date_fz_to and date_fz_fr.
Someone can help me? If something is not clear (very probably) pls ask me details!

Best Regards
N@ruto


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

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.