Author Topic: Java code generation - incorrect data types  (Read 6207 times)

Laurent_F

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • EA registered user!
    • View Profile
Java code generation - incorrect data types
« on: February 16, 2004, 11:37:34 am »
How can I generate a Java class where the fields have a datatype mapped to the appropriate Java type instead of the database type? i.e. :


public class Stuff {

     private String test;

     public Stuff(){

     }

     public String gettest(){
           return test;
     }

     public void settest(String newVal){
           test = newVal;
     }

}

instead of what EA generates:

public class Stuff {

     private varchar test;

     public Stuff(){

     }

     public varchar gettest(){
           return test;
     }

     public void settest(varchar newVal){
           test = newVal;
     }

}

Setting up a type mapping under Configuration -> Language Datatypes -> Java

doesn't work.

ravi11

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Java code generation - incorrect data types
« Reply #1 on: February 19, 2004, 03:55:46 pm »
in the datatype drop down you need not choose an existing entry. you can type your own.

in your case type "String" directly into the box.

this will compile right off the bat since String is part of the default java.lang package.

Laurent_F

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • EA registered user!
    • View Profile
Re: Java code generation - incorrect data types
« Reply #2 on: February 20, 2004, 06:20:32 am »
my point is that even when you pick String, it's not the type that gets used by EA.