| Code: |
|
drop table SENSOR_DATA if exists; drop table SENSORS if exists; create table "SENSORS"( "SID" INTEGER(0) not null, "NAME" VARCHAR(16) not null, "DESCRIPTION" VARCHAR(0), "TYPE" VARCHAR(0) not null, "UNIT" VARCHAR(4)not null, "PORT" VARCHAR(5) not null, primary key (sid) ) create table "SENSOR_DATA"( "ID" INTEGER(0) not null, "SID" INTEGER(0) not null, "TIME" TIMESTAMP default 'now', "VALUE" DOUBLE not null, primary key(id), foreign key(sid) references SENSORS(sid) ) insert into SENSORS(sid,name,description,type,unit,port) values (1,'Temp1','Server room temperature','TEMP','DEGC','COM6'); |
| Quote: |
|
*** Date: Wed Mar 15 22:15:19 WST 2006 *** System properties: OS=WindowsXP OS version=5.1 Java version=1.5.0_04 *** MyEclipse details: MyEclipse Enterprise Workbench Version: 4.1.1 GA Build id: 20060228-4.1.1-GA *** Eclipse details: Eclipse SDK Version: 3.1.0 Build id: I20050627-1435 Eclipse Platform Version: 3.1.0 Build id: I20050627-1435 Eclipse RCP Version: 3.1.0 Build id: I20050627-1435 Eclipse Java Development Tools Version: 3.1.0 Build id: I20050627-1435 Eclipse Plug-in Development Environment Version: 3.1.0 Build id: I20050627-1435 Eclipse Project SDK Version: 3.1.0 Build id: I20050627-1435 Eclipse startup command=-os win32 -ws win32 -arch x86 -launcher C:\java\eclipse_3_1\eclipse.exe -name Eclipse -showsplash 600 -exitdata 1398_44 -vm C:\WINDOWS\SYSTEM32\javaw.exe |
| Code: |
| Code: |
| Code: |
|
drop table SENSOR_DATA if exists; drop table SENSORS if exists; create table "SENSORS"( "SID" INTEGER not null, "NAME" VARCHAR(16) not null, "DESCRIPTION" VARCHAR(20), "TYPE" VARCHAR(20) not null, "UNIT" VARCHAR(4)not null, "PORT" VARCHAR(5) not null, primary key (sid) ) create table "SENSOR_DATA"( "ID" INTEGER not null, "SID" INTEGER not null, "TIME" TIMESTAMP default 'now', "VALUE" DOUBLE not null, primary key(id), foreign key(sid) references SENSORS(sid) ) insert into SENSORS(sid,name,description,type,unit,port) values (1,'Temp1','Server room temperature','TEMP','DEGC','COM6'); |
| Code: |
|
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Mapping file autogenerated by MyEclipse - Hibernate Tools --> <hibernate-mapping> <class name="test.Sensors" table="SENSORS" schema="PUBLIC"> <id name="sid" type="integer"> <column name="SID" /> <generator class="assigned" /> </id> <property name="name" type="string"> <column name="NAME" length="16" not-null="true" /> </property> <property name="description" type="string"> <column name="DESCRIPTION" length="20" /> </property> <property name="type" type="string"> <column name="TYPE" length="20" not-null="true" /> </property> <property name="unit" type="string"> <column name="UNIT" length="4" not-null="true" /> </property> <property name="port" type="string"> <column name="PORT" length="5" not-null="true" /> </property> <set name="sensorDatas" inverse="true"> <key> <column name="SID" not-null="true" /> </key> <one-to-many class="test.SensorData" /> </set> </class> </hibernate-mapping> <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Mapping file autogenerated by MyEclipse - Hibernate Tools --> <hibernate-mapping> <class name="test.SensorData" table="SENSOR_DATA" schema="PUBLIC"> <id name="id" type="integer"> <column name="ID" /> <generator class="assigned" /> </id> <many-to-one name="sensors" class="test.Sensors" fetch="select"> <column name="SID" not-null="true" /> </many-to-one> <property name="time" type="timestamp"> <column name="TIME" length="6" /> </property> <property name="value" type="double"> <column name="VALUE" precision="0" scale="0" not-null="true" /> </property> </class> </hibernate-mapping> |
| Quote: |
|
*** Date: Thu Mar 16 12:29:01 WST 2006 *** System properties: OS=WindowsXP OS version=5.1 Java version=1.5.0_04 *** MyEclipse details: MyEclipse Enterprise Workbench Version: 4.1.1 GA Build id: 20060309-4.1.1-GA *** Eclipse details: Eclipse SDK Version: 3.1.2 Build id: M20060118-1600 Eclipse Platform Version: 3.1.2 Build id: M20060118-1600 Eclipse RCP Version: 3.1.2 Build id: M20060118-1600 Eclipse Java Development Tools Version: 3.1.2 Build id: M20060118-1600 Eclipse Plug-in Development Environment Version: 3.1.2 Build id: M20060118-1600 Eclipse Project SDK Version: 3.1.2 Build id: M20060118-1600 Eclipse startup command=-os win32 -ws win32 -arch x86 -launcher C:\java\eclipse\eclipse.exe -name Eclipse -showsplash 600 -exitdata 11f0_3c -vm C:\WINDOWS\SYSTEM32\javaw.exe |