From: Roy F. <ro...@tr...> - 2004-08-22 11:37:52
|
FWIW, I am getting the same behavior, as described below, with the latest 3.0M3 snapshot. Also, I am curious about the new mapping file, "JavaWrapperMappings.xml", and how it differs in usage from "JavaMappings.xml". thanks in advance, roy -----Forwarded Message----- From: Roy Feldman <ro...@tr...> To: and...@li... Subject: [Andromda-user] Another Hibernate cartridge problem Date: Fri, 20 Aug 2004 19:23:42 +0700 Hi Everyone, I am using 3.0M2 release and Poseidon for my modeling, and I am getting output like the following for all of my class attributes. This time, I am consistently using types defined in the datatypes package. ;-) * @hibernate.property * column="AMOUNT" * type="$attribute.type.fullyQualifiedHibernateType" * * @hibernate.column * name="AMOUNT" * sql-type="FLOAT" */ public java.lang.Float getAmount() { return this.amount; } All of my attributes are getting a column type of "$attribute.type.fullyQualifiedHibernateType". In this case, I have specified that the amount "attribute" has the type datatype.Float. The good news is that the sql-type gets generated correctly for all of my attributes. ;-) Obviously, Hibernate barfs on a column type of "$attribute.type.fullyQualifiedHibernateType". As a workaround, I have hacked the HibernateEntity.vsl file and removed the line marked with "+++ in the following snippet. <VelocitySnippet> * column="$attribute.columnName" +++ * type="$attribute.type.fullyQualifiedHibernateType" * * @hibernate.column * name="$attribute.columnName" * sql-type="$attribute.sqlType" */ public $attribute.type.fullyQualifiedName ${attribute.getterName}() { return this.$attribute.name; } </VelocitySnippet> That seems to get around the problem, Hibernate doesn't seem to need the type specified for the column, at least in the simple example I am working with where I only have Strings and one Float. I am invoking the hibernate cartridge in Ant through the andromda task. Is it possible that there is a problem with my hibernate namespace configuration? I have carefully checked the property specifications and they all look correct, namely 1) languageMappingsUri -> JavaMappings.xml 2) jdbcMappingsUri -> JdbcMappings.xml 3) hibernateTypeMappingsUri -> HibernateTypeMappings.xml 4) sqlMappingsUri -> MySQLMappings.xml (No difference with Hypersonic) Any ideas would be greatly appreciated. thanks, roy |