Hi,
I have an existing Postgresql database and am trying
to produce a corresponding XML schema. The related
Torque ANT build targets each fall short in some way
(with respect to handling Postgresql types). My
questions hightlight some shortcomings (but I'd still
like to use the Om/Peer classes that will result).
Hope you can help wiht ANY of these:
Environment:RH Linux, torque-3.0-b4, tdk-2.2-b3, using
native pgsql sequencing rather than idBroker.
Ques 1: What are the Torque-acceptable XML statements
I should use for: (SQL from a pg_dump of schema
segment)
CREATE TABLE "anm_id" (
"anm_key" integer DEFAULT
nextval('"anm_id_serial_anm_key_seq"'::text) NOT NULL,
"bal_30_60" numeric(8,2),
"is_dup_mbrshp" boolean,
Constraint "pk_anm_id", Primary Key ("anm_key")
);
Ques 2: What db.props changes will allow "ant JDBC" to
produce an equivalent XML statement for a database
with this column:
"bal_30_60" numeric(8,2),
my db.props now include:
# numeric(precision, scale) / decimal(precision,
scale)
NUMERIC = numeric
DECIMAL = decimal
Ques 3: Having cleaned up some of the pg_dump'd SQL,
"ant sql2xml" converted the following:
CREATE SEQUENCE "anm_id_serial_anm_key_seq" start 1
increment 1 maxvalue 9223372036854775807 minvalue 1
cache 1;
CREATE TABLE "anm_id" (
"anm_key" integer NOT NULL,
"bal_30_60" numeric(8,2),
"is_dup_mbrshp" boolean,
Primary Key ("anm_key"),
Constraint "pk_anm_id"
)
);
to:
<app-data>
<database name="default" package="null"
defaultIdMethod="null" baseClass="BaseObject"
basePeer="BasePeer">
<table name="anm_id"" javaname="AnmId""
idMethod="idbroker">
<column name="anm_key"" javaName="AnmKey""
primaryKey="true" required="true" type="INTEGER" />
<column name="bal_30_60"" javaName="Bal3060""
required="false" type="VARCHAR" size="82" />
<column name="is_dup_mbrshp""
javaName="IsDupMbrshp"" required="false"
type="VARCHAR" />
<column name="Constraint" javaName="Constraint"
required="false" type="VARCHAR" />
</table>
</database></app-data>
Thus the conversion produce: the numeric (8,2) ->
VARCHAR 82, constraints -> column named "Constraint",
and "idMethod=idbroker" was inserted and NO mention of
the sequence... (any thoughts on these?)
=====
Jeff Gehrung (Sr. Programmer Analyst)
Holstein Association USA
Brattleboro VT 05302
802.451.4146
[EMAIL PROTECTED]
[EMAIL PROTECTED]
I'm told "42" answers most ?s.
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>