db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hardy" <derek.ha...@teknosys.co.uk>
Subject RE: Adding new columns
Date Thu, 12 Jun 2003 09:36:44 GMT

This is an extract from the schema.xml file, is this what you meant?

	<table name="Property" javaName="Property">
		<column name="property_id" type="INTEGER" size="10" primaryKey="true"
required="true" autoIncrement="true"/>
		<column name="status_code" type="INTEGER" size="2" required="true"/>
		<column name="status_change_date" type="DATE" required="true" />
		<column name="store_id" type="INTEGER" size="10" required="true"/>
		<column name="category_id" type="INTEGER" size="10" required="true"/>
		<column name="property_ref" type="VARCHAR" size="20" required="true"/>
		<column name="date_found" type="DATE" required="true"/>
		<column name="date_posted" type="DATE" required="true"/>
		<column name="property_name" type="VARCHAR" size="60" required="true"/>
		<column name="contact" type="VARCHAR" size="50"/>
		<column name="telephone" type="VARCHAR" size="30"/>
		<column name="manufacturer" type="VARCHAR" size="60" required="true"/>
		<column name="colour" type="VARCHAR" size="60"/>
		<column name="description" type="CLOB"/>
		<column name="distinguishing_features" type="CLOB"/>
		<column name="highlight_item" type="CHAR" size="1"/>
		<foreign-key foreignTable="Property_Status_Codes">
			<reference local="status_code" foreign="status_code"/>
		<foreign-key foreignTable="Property_Stores">
			<reference local="store_id" foreign="store_id"/>
		<foreign-key foreignTable="Property_Categories">
			<reference local="category_id" foreign="category_id"/>

I've added the column status_change_date and have definately set it's value
in my java code. However when the data is written to the MySQL database
there isn't any value in that column.

I'm populating it like this,

prop.setStatusChangeDate(new java.util.Date(System.currentTimeMillis()));

Then initiating the update, using the save() method.

I've tried retrieving the record first, and forcing the update without
retrieving the record using the setNew(false) method.



-----Original Message-----
From: Eric Emminger [mailto:eric@ericemminger.com]
Sent: 11 June 2003 14:49
To: Turbine Torque Users List
Subject: Re: Adding new columns


Derek Hardy wrote:
> Hi
> I've recently added a new column to an existing table and regenerated the
> classes.
> If then use the column in my code, it doesn't seem to populate/update the
> value within the database.
> Do I need to do something else when adding new columns to existing Torque
> structures?

Should work. Can you provide the relevant part of your schema.xml file?


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

View raw message