-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok there is large learning curve to move from data base thinking to
Ofbiz thinking.
Entities are used to Define what is stored in A database.
if you are going to attach an already existing Database then you will
need to define the ofbiz style entities.
before you start this endeavor I really suggest you get familiar with
ofbiz coding practices, and design.
http://docs.ofbiz.org/display/OFBIZ/OFBiz+Beginner%27s+Development+Guide+Using+Practice+Application



Jack Liu sent the following on 2/11/2009 1:01 AM:
> There is no enun in ofbiz, but my database uses it.
> 
> For example there is a field named "test" in the table enum_test and it's 
> type is enum('one','two','three').
> 
> In entitymodel.xml
>      <entity entity-name="EnmuTest"
>             package-name="com.aicent.ccb"
>             title="test enum type in mysql">
>                 <field name="id" type="id" /> 
>         <field name="test" type="enumtest" /> 
>         <prim-key field="id" /> 
>     </entity>
> 
> Field test's type is enumtest.
> 
> In fieldtypemysql.xml
> <field-type-def type="enumtest" sql-type="enum('one','two','three')" 
> java-type="String[]"></field-type-def>
> 
> Then I execute command "ant run-install" in root directory of ofbiz.
> It creates table enum_test successfully but when I start ofbiz
> There are two errors:
> 
> 2009-02-11 16:38:49,452 (main) [       DatabaseUtil.java:988:INFO ] Getting 
> Column Info From Database
> 2009-02-11 16:38:49,577 (main) [       DatabaseUtil.java:236:ERROR] 
> ---- runtime exception report 
> --------------------------------------------------
> Exception: java.lang.NumberFormatException
> Message: For input string: "'one'"
> ---- stack trace 
> ---------------------------------------------------------------
> java.lang.NumberFormatException: For input string: "'one'"
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> java.lang.Integer.parseInt(Integer.java:447)
> java.lang.Integer.parseInt(Integer.java:497)
> org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:234)
> org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:125)
> org.ofbiz.entity.datasource.GenericDAO.checkDb(GenericDAO.java:1099)
> org.ofbiz.entity.datasource.GenericHelperDAO.checkDataSource(GenericHelperDAO.java:198)
> org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:185)
> org.ofbiz.entity.GenericDelegator.getGenericDelegator(GenericDelegator.java:117)
> org.ofbiz.catalina.container.CatalinaContainer.init(CatalinaContainer.java:165)
> org.ofbiz.base.container.ContainerLoader.loadContainer(ContainerLoader.java:141)
> org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:65)
> org.ofbiz.base.start.Start.initStartLoaders(Start.java:248)
> org.ofbiz.base.start.Start.init(Start.java:87)
> org.ofbiz.base.start.Start.main(Start.java:403)
> --------------------------------------------------------------------------------
> 
> 2009-02-11 16:38:49,577 (main) [       DatabaseUtil.java:243:ERROR] 
> ---- runtime exception report 
> --------------------------------------------------
> Exception: java.lang.NumberFormatException
> Message: For input string: "'two','three'"
> ---- stack trace 
> ---------------------------------------------------------------
> java.lang.NumberFormatException: For input string: "'two','three'"
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> java.lang.Integer.parseInt(Integer.java:447)
> java.lang.Integer.parseInt(Integer.java:497)
> org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:241)
> org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:125)
> org.ofbiz.entity.datasource.GenericDAO.checkDb(GenericDAO.java:1099)
> org.ofbiz.entity.datasource.GenericHelperDAO.checkDataSource(GenericHelperDAO.java:198)
> org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:185)
> org.ofbiz.entity.GenericDelegator.getGenericDelegator(GenericDelegator.java:117)
> org.ofbiz.catalina.container.CatalinaContainer.init(CatalinaContainer.java:165)
> org.ofbiz.base.container.ContainerLoader.loadContainer(ContainerLoader.java:141)
> org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:65)
> org.ofbiz.base.start.Start.initStartLoaders(Start.java:248)
> org.ofbiz.base.start.Start.init(Start.java:87)
> org.ofbiz.base.start.Start.main(Start.java:403)
> ---------------------------------------------------------------------------
> 
> How should I solve this problem?
> Thank you all!
> 
> -----Original Message-----
> From: BJ Freeman [mailto:[email protected]] 
> Sent: 2009年2月10日 21:24
> To: [email protected]
> Subject: Re: Does OFBiz support mysql data type enum?
> 
> not sure what you are asking
> where did you find enum in the file?
> 
> Jack Liu sent the following on 2/10/2009 5:04 AM:
>> I knew that, but did you test it for data type enum in mysql?
> 
>> -----Original Message-----
>> From: BJ Freeman [mailto:[email protected]] 
>> Sent: 2009t210
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJkqgrrP3NbaWWqE4RAnneAJoClcEx6GtQkAiyKo0bMiHIwaktowCeN2Dq
2cR6Lez0iKf2YPWLldzN5Ec=
=zLG+
-----END PGP SIGNATURE-----

Reply via email to