This content has been marked as final.
Show 2 replies
-
1. Re: mapping problems between ntext, jtds and ejb3
leulberg Jul 14, 2006 3:23 PM (in response to leulberg)I tried useLOB=true in jtds and annotation like this
/** * TextArea message */ @Lob @Basic @Column(name="message", columnDefinition="NTEXT NULL") public void setMessage(String s){ this.message = s; } public String getMessage(){ return this.message; }
But no better result.
In addition the stack trace:org.hibernate.HibernateException: Wrong column type: message, expected: varchar(255) at org.hibernate.mapping.Table.validateColumns(Table.java:251) at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1002) at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:314) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:627) : :
-
2. Re: mapping problems between ntext, jtds and ejb3
leulberg Jul 16, 2006 10:50 AM (in response to leulberg)I solved my problem.
I annotated the setter and not the getter. Is it neccessary to annotate the getter because of any spec? Which one?
My code looks like below, now./** * TextArea message */ @Lob @Column(columnDefinition="NTEXT NULL") public String getMessage(){ return this.message; } public void setMessage(String s){ this.message = s; }