Hi together,
I'm creating a new database table using DBF_JDBC43.jar and hibernate.jar in a Spring Boot application, using native query. I wan't to transform a NUMERIC(5,3) column to VFP datatype 'N'. After creating the table and opening it in VFP 9.0 it shows that column is set to Float. Is there any reason for it or is it configurable?
Spring datasource is set up as following:
spring.datasource.url=jdbc:dbf:///?charSet=Cp1252
spring.datasource.driver-class-name=com.hxtt.sql.dbf.DBFDriver
spring.jpa.database-platform=com.hxtt.support.hibernate.HxttDbfDialect
Thanks and best regards!
|
Are you using
@Column(name = "YourColumn", precision = 5, scale = 3)
private BigDecimal variable4YourColumn;
|
Hi, yes I'm using BigDecimal with @Column definition
Native Query excerpt:
@Query(value = "CREATE TABLE IF NOT EXISTS TPDISS_STR (" +
...
"ENTF_I DECIMAL(5,3)," +
...
")", nativeQuery = true)
void createTable();
Entity definition excerpt:
@Entity
@Table(name = "")
public class Streckenabschnitt {
...
@Column(name = "ENTF_I", precision = 6, scale = 3)
private BigDecimal entfernungGfdI;
...
}
Re:Re:NUMERIC datatype with decimal places is transformed to FLOAT on table creation |
Christian Metzner |
2019-07-11 07:23:12 |
I'm sorry, query type is "NUMERIC". It was just another try...
|
Re:Re:Re:Re:NUMERIC datatype with decimal places is transformed to FLOAT on table creation |
HXTT Support |
2019-07-11 09:18:48 |
>After creating the table and opening it in VFP 9.0 it shows that column is set to Float. Is there any reason for it or is it configurable?
Checked. VFP provides two types (N, F), which supports precision/scale. HXTT DBF use Float as default type for CREATE table.
The latest package has enabled N for Numeric.
|
Re:NUMERIC datatype with decimal places is transformed to FLOAT on table creation |
Christian Metzner |
2019-07-11 12:48:41 |
Hi, I've just downloaded the latest package and it works now. Thanks a lot!
|
|
|