db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject Re: Problem with BOOLEAN fields
Date Mon, 16 May 2005 10:44:50 GMT





Hi,

Piechu <piechutm@wp.pl> schrieb am 15.05.2005 22:11:44:

> Hello
>
> Thanks. But where can I find information about which Torque type is an
> equivalent for the type from database ? is there any rule.
>

In the generator source, look for files template/sql/base/<db
name>/db.props. There is one for every database, it contains the mapping
Torque type -> database type

> Another problem is - when I used type "CLOB" I've got BUILDING FAILED
> message caused in *.jelly - and it's probably something wrong with
> Torque types. What should I use for Text filed in database and is there
> any equivalent type for type Money in database?
>

I have tried to generate a clob field using the postgresql setting and it
looks fine to me (I could not run the classes, I do not have a postgresql
installation running here). For this, I used the schema.xml from the
tutorial, and changed the ISBN number to CLOB:

<database
  name="bookstore"
  defaultIdMethod="native">

  <table name="book" description="Book Table">
...
    <column
      name="isbn"
      required="true"
      type="CLOB"
      javaName="ISBN"
      description="ISBN Number"/>
...

Perhaps you have another issue in your schema.xml.
Regarding the money type, it is not supported natively by Torque because it
is postgresql-specific. You can try and change the db.props file in the
genrator and insert it (no idea whether that works), or you can change the
mapping of an unused Torque datatype to money (that should work, but is
very unintuitive if one reads the schema.xml)


> And last thing - should schema.xml file describe whole database - or if
> some things are programmed in database, such as auto numeration for
> primary keys, unique fields, default values - should it be also included
> in schema.xml file? If not - how should I mark a primary key which is
> auto-numeration field?

Everything you can do in the schema.xml, you should do in the schema.xml.
Primary keys are autoincrement in most cases (the only exception known to
me is mysql), but it does not hurt to specify it by setting
autoincrement="true"

>
> Greetings
> Jakub Piechnik
>

Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message