Kevin Sutter wrote:
> 
>> 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.
> 
> 

Ok, I will do it for now, but isn't there a way to turn off this
auto-discovery?



Kevin Sutter wrote:
> 
>> [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]
>>
> 


Kevin Sutter wrote:
> 
> Note sure I follow this.  According to the SQL traced below, I see the
> p_type column being used in the query.
>> 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)
> .
> .
> .
> 
>  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]
> 

Can you see it (the problem)?
Querying NaturalPerson,  t1.p_type = ? should be 'NP', but it is 78 - an
integer.


Kevin Sutter wrote:
> 
>> 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]
> 
Again!
Querying LegalEntity,  t1.p_type = ? should be 'LE', but it is 78 - an
integer.

Thanks for help,

Gilberto


-- 
View this message in context: 
http://n2.nabble.com/orm-xml-discriminator-column-strange-column-tp4455011p4455404.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to