On Mon, Jan 25, 2010 at 10:47 AM, gilbertoca <[email protected]> wrote:

>
> environment:
> OpenSuse 11.0
> Jdk:  1.6.0_17
> openjpa: OpenJPA 2.0.0-M3
>
> Hi, I'm using just the orm.xml file[1] and the java code has no
> annotation[2]. My persistence.xml file[3] has no special properties as
> well.
> As you can see below it generates my tables correctly with exception the
> legal_entity table. In the legal_entity table it generates one strange
> column: PARKINGCOLLECTION OTHER. Maybe trying to identify one relationship
> that I've not specified yet.
>

Yeah, something's not fully specified yet.  Legal_entity defined the
following attribute, but I don't see Parking defined anywhere.  At least not
in the information you provided.

    private Collection<Parking> parkingCollection;

If you don't have Parking defined yet, then I would say to specify
@Transient until it is defined.  This would remove that question until you
are ready for it.

Other thing, in the test when I try
> [quote]
> NaturalPerson nP = em.find(NaturalPerson.class, 1000);
>  [/quote]
> it doesn't use the discriminator-column that in my case is
> CHAR(2)//NATURALPERSON(NP) OR LEGALENTITY(LE):
> [quote]
>

Note sure I follow this.  According to the SQL traced below, I see the
p_type column being used in the query.

Did these tests used to work?  On previous 2.0.0 Milestone drivers?  Or, 1.x
drivers?

Just not sure what problem or question is being asked...

Thanks,
Kevin


> [INFO] Surefire report directory:
> /home/gilberto/dev/netbeans-config/park-jpa/core/target/surefire-reports
>
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running park.model.NaturalPersonTest
> 714  parkPU  INFO   [main] openjpa.Runtime - OpenJPA dynamically loaded the
> class enhancer. Any classes that were not enhanced at build time will be
> enhanced when they are loaded by the JVM.
> 787  parkPU  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.0.0-M3
> 2062  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 14418997>
> executing prepstmnt 19306178 SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM
> INFORMATION_SCHEMA.SEQUENCES
> 2063  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 14418997>
> [0
> ms] spent
> 2596  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 2342353>
> executing stmnt 33039485 DROP TABLE legal_entity
> 2603  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 2342353> [7
> ms] spent
> 2712  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 12171472>
> executing stmnt 20194874 DROP TABLE natural_person
> 2713  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 12171472>
> [1
> ms] spent
> 2786  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 13320911>
> executing stmnt 28713819 DROP TABLE person
> 2787  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 13320911>
> [1
> ms] spent
> 2860  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 23360120>
> executing prepstmnt 3658896 SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM
> INFORMATION_SCHEMA.SEQUENCES
> 2861  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 23360120>
> [1
> ms] spent
> 3237  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 6848169>
> executing stmnt 26108059 CREATE TABLE legal_entity (id_person INTEGER NOT
> NULL, dt_foundation DATE, taxpayers_id VARCHAR(20), PARKINGCOLLECTION
> OTHER,
> PRIMARY KEY (id_person))
> 3240  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 6848169> [1
> ms] spent
> 3288  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 25935701>
> executing stmnt 2870450 CREATE TABLE natural_person (id_person INTEGER NOT
> NULL, dt_birth DATE, legal_document VARCHAR(20), PRIMARY KEY (id_person))
> 3290  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 25935701>
> [1
> ms] spent
> 3390  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 32112901>
> executing stmnt 29948747 CREATE TABLE person (id_person INTEGER NOT NULL
> IDENTITY, address VARCHAR(100), name VARCHAR(100), p_type CHAR(2), version
> INTEGER)
> 3392  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 32112901>
> [2
> ms] spent
> 3462  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 7789321>
> executing stmnt 9876930 CREATE INDEX I_PERSON_DTYPE ON person (p_type)
> 3463  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 7789321> [1
> ms] spent
> 2010-01-25 12:12:18,190 [main] WARN
> org.dbunit.dataset.AbstractTableMetaData - Potential problem found: The
> configured data type factory 'class
> org.dbunit.dataset.datatype.DefaultDataTypeFactory' might cause problems
> with the current database 'H2' (e.g. some datatypes may not be supported
> properly). In rare cases you might see this message because the list of
> supported database products is incomplete (list=[derby]). If so please
> request a java-class update via the forums.If you are using your own
> IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override
> getValidDbProducts() to specify the supported database products.
> 2010-01-25 12:12:18,207 [main] WARN
> org.dbunit.dataset.AbstractTableMetaData - Potential problem found: The
> configured data type factory 'class
> org.dbunit.dataset.datatype.DefaultDataTypeFactory' might cause problems
> with the current database 'H2' (e.g. some datatypes may not be supported
> properly). In rare cases you might see this message because the list of
> supported database products is incomplete (list=[derby]). If so please
> request a java-class update via the forums.If you are using your own
> IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override
> getValidDbProducts() to specify the supported database products.
> 2010-01-25 12:12:18,218 [main] DEBUG park.model.NaturalPersonTest -
> Getting an Natural Person by ID.
>
> 4122  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 19492125>
> executing prepstmnt 22199751 SELECT t1.p_type, t1.version, t1.address,
> t1.name, t0.dt_birth, t0.legal_document FROM natural_person t0 INNER JOIN
> person t1 ON t0.id_person = t1.id_person WHERE t1.p_type = ? AND
> t0.id_person = ? [params=(int) 78, (int) 1000]
> 4123  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 19492125>
> [0
> ms] spent
> 4134  parkPU  WARN   [main] openjpa.Runtime - Finder for
> "park.model.NaturalPerson" is not cachable.
> 2010-01-25 12:12:18,461 [main] DEBUG park.model.NaturalPersonTest - Object
> loaded:
> null
> 4402  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 272782>
> executing prepstmnt 19679080 SELECT t1.id_person, t1.p_type, t1.version,
> t1.address, t1.name, t0.dt_birth, t0.legal_document FROM natural_person t0
> INNER JOIN person t1 ON t0.id_person = t1.id_person WHERE t1.p_type = ?
> [params=(int) 78]
> 4404  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 7577407, conn 272782> [2
> ms] spent
> Tests run: 2, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 4.876 sec
> <<< FAILURE!
>
> Results :
>
> Failed tests:
>  findAll(park.model.NaturalPersonTest)
>
> Tests in error:
>  GetNaturalPersonById(park.model.NaturalPersonTest)
>
> Tests run: 2, Failures: 1, Errors: 1, Skipped: 0
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [/quote]
>
> Any tip here?
>
> Gilberto
>
>
> [1]  http://n2.nabble.com/file/n4455011/orm.xml orm.xml
> [2] http://n2.nabble.com/file/n4455011/Person.java Person.java
>     http://n2.nabble.com/file/n4455011/NaturalPerson.java
> NaturalPerson.java
>     http://n2.nabble.com/file/n4455011/LegalEntity.java LegalEntity.java
> [3] http://n2.nabble.com/file/n4455011/persistence.xml persistence.xml
> --
> View this message in context:
> http://n2.nabble.com/orm-xml-discriminator-column-strange-column-tp4455011p4455011.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Reply via email to