Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Same flags in PersistanceOptions different outcome
[Teneo] Same flags in PersistanceOptions different outcome [message #797810] Mon, 13 February 2012 22:47 Go to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

I used these same flags for a couple of years now

Properties props = new Properties();
props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH,
"28");
props.setProperty(PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY,
"true");
props.setProperty(PersistenceOptions.DEFAULT_ID_FEATURE_NAME,
"id");

props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRATEGY, "simple");

props.setProperty(PersistenceOptions.JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS,
"false");
props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");

props.setProperty(PersistenceOptions.DISABLE_ECONTAINER_MAPPING, "true");
props.setProperty(PersistenceOptions.ALWAYS_VERSION, "false");
props.setProperty(PersistenceOptions.ALWAYS_MAP_LIST_AS_BAG,
"true");
props.setProperty(PersistenceOptions.INHERITANCE_MAPPING,
"JOINED");
props.setProperty(PersistenceOptions.XSDDATE_CLASS,
"java.util.Date");
//ManyToOne and OneToMany are normally fetch eagerly, only if
you do SET_PROXY=true then these are set to lazy
props.setProperty(PersistenceOptions.SET_PROXY, "true");

But now I am getting a column E_ID instead of the one to one join I used
to get using this:

<xsd:complexType name="DerivativeIssueData">
<xsd:sequence minOccurs="0" maxOccurs="1">
<xsd:element ecore:opposite="derivativeIssueData" minOccurs="0"
maxOccurs="1" type="xsd:anyURI" name="instrument"
ecore:reference="mddbyam:Instrument">
<xsd:annotation>
<xsd:appinfo source="teneo.jpa">@PrimaryKeyJoinColumn
@Column(name="instrument")</xsd:appinfo>
</xsd:annotation>
</xsd:element>

I have just added this and have several previous like it, they correctly
had the one to one between instrument and them. This does not? I cannot
see what is different? Any clues?

I added the @Column annotation, because the others came out with the
correct lowercase column name without it and this one comes out with an
upper case name, even after adding this annotation?

Thx.

David
Re: [Teneo] Same flags in PersistanceOptions different outcome [message #798130 is a reply to message #797810] Tue, 14 February 2012 09:28 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
I am old and grey, memory going. I forgot to add the attribute decl with
the @Id, so it works fine now that that is there.

David

On 13/02/12 22:47, David Wynter wrote:
> Hi,
>
> I used these same flags for a couple of years now
>
> Properties props = new Properties();
> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH, "28");
> props.setProperty(PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY, "true");
> props.setProperty(PersistenceOptions.DEFAULT_ID_FEATURE_NAME, "id");
> props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRATEGY,
> "simple");
> props.setProperty(PersistenceOptions.JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS,
> "false");
> props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");
> props.setProperty(PersistenceOptions.DISABLE_ECONTAINER_MAPPING, "true");
> props.setProperty(PersistenceOptions.ALWAYS_VERSION, "false");
> props.setProperty(PersistenceOptions.ALWAYS_MAP_LIST_AS_BAG, "true");
> props.setProperty(PersistenceOptions.INHERITANCE_MAPPING, "JOINED");
> props.setProperty(PersistenceOptions.XSDDATE_CLASS, "java.util.Date");
> //ManyToOne and OneToMany are normally fetch eagerly, only if you do
> SET_PROXY=true then these are set to lazy
> props.setProperty(PersistenceOptions.SET_PROXY, "true");
>
> But now I am getting a column E_ID instead of the one to one join I used
> to get using this:
>
> <xsd:complexType name="DerivativeIssueData">
> <xsd:sequence minOccurs="0" maxOccurs="1">
> <xsd:element ecore:opposite="derivativeIssueData" minOccurs="0"
> maxOccurs="1" type="xsd:anyURI" name="instrument"
> ecore:reference="mddbyam:Instrument">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">@PrimaryKeyJoinColumn
> @Column(name="instrument")</xsd:appinfo>
> </xsd:annotation>
> </xsd:element>
>
> I have just added this and have several previous like it, they correctly
> had the one to one between instrument and them. This does not? I cannot
> see what is different? Any clues?
>
> I added the @Column annotation, because the others came out with the
> correct lowercase column name without it and this one comes out with an
> upper case name, even after adding this annotation?
>
> Thx.
>
> David
Re: [Teneo] Same flags in PersistanceOptions different outcome [message #798317 is a reply to message #797810] Tue, 14 February 2012 14:24 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi David,
This could be a backward compatibility issue, from what version did you upgrade?

gr. Martin

On 02/13/2012 11:47 PM, David Wynter wrote:
> Hi,
>
> I used these same flags for a couple of years now
>
> Properties props = new Properties();
> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH, "28");
> props.setProperty(PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY, "true");
> props.setProperty(PersistenceOptions.DEFAULT_ID_FEATURE_NAME, "id");
> props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRATEGY, "simple");
> props.setProperty(PersistenceOptions.JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS, "false");
> props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");
> props.setProperty(PersistenceOptions.DISABLE_ECONTAINER_MAPPING, "true");
> props.setProperty(PersistenceOptions.ALWAYS_VERSION, "false");
> props.setProperty(PersistenceOptions.ALWAYS_MAP_LIST_AS_BAG, "true");
> props.setProperty(PersistenceOptions.INHERITANCE_MAPPING, "JOINED");
> props.setProperty(PersistenceOptions.XSDDATE_CLASS, "java.util.Date");
> //ManyToOne and OneToMany are normally fetch eagerly, only if you do SET_PROXY=true then these are set to lazy
> props.setProperty(PersistenceOptions.SET_PROXY, "true");
>
> But now I am getting a column E_ID instead of the one to one join I used to get using this:
>
> <xsd:complexType name="DerivativeIssueData">
> <xsd:sequence minOccurs="0" maxOccurs="1">
> <xsd:element ecore:opposite="derivativeIssueData" minOccurs="0" maxOccurs="1" type="xsd:anyURI" name="instrument"
> ecore:reference="mddbyam:Instrument">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">@PrimaryKeyJoinColumn @Column(name="instrument")</xsd:appinfo>
> </xsd:annotation>
> </xsd:element>
>
> I have just added this and have several previous like it, they correctly had the one to one between instrument and them.
> This does not? I cannot see what is different? Any clues?
>
> I added the @Column annotation, because the others came out with the correct lowercase column name without it and this
> one comes out with an upper case name, even after adding this annotation?
>
> Thx.
>
> David


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Same flags in PersistanceOptions different outcome [message #798344 is a reply to message #798317] Tue, 14 February 2012 15:02 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I am old and grey to :-) as I did not look at the last 10 posts in the newsgroup, so I missed your own solution.

gr. Martin

On 02/14/2012 03:24 PM, Martin Taal wrote:
> Hi David,
> This could be a backward compatibility issue, from what version did you upgrade?
>
> gr. Martin
>
> On 02/13/2012 11:47 PM, David Wynter wrote:
>> Hi,
>>
>> I used these same flags for a couple of years now
>>
>> Properties props = new Properties();
>> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH, "28");
>> props.setProperty(PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY, "true");
>> props.setProperty(PersistenceOptions.DEFAULT_ID_FEATURE_NAME, "id");
>> props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRATEGY, "simple");
>> props.setProperty(PersistenceOptions.JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS, "false");
>> props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");
>> props.setProperty(PersistenceOptions.DISABLE_ECONTAINER_MAPPING, "true");
>> props.setProperty(PersistenceOptions.ALWAYS_VERSION, "false");
>> props.setProperty(PersistenceOptions.ALWAYS_MAP_LIST_AS_BAG, "true");
>> props.setProperty(PersistenceOptions.INHERITANCE_MAPPING, "JOINED");
>> props.setProperty(PersistenceOptions.XSDDATE_CLASS, "java.util.Date");
>> //ManyToOne and OneToMany are normally fetch eagerly, only if you do SET_PROXY=true then these are set to lazy
>> props.setProperty(PersistenceOptions.SET_PROXY, "true");
>>
>> But now I am getting a column E_ID instead of the one to one join I used to get using this:
>>
>> <xsd:complexType name="DerivativeIssueData">
>> <xsd:sequence minOccurs="0" maxOccurs="1">
>> <xsd:element ecore:opposite="derivativeIssueData" minOccurs="0" maxOccurs="1" type="xsd:anyURI" name="instrument"
>> ecore:reference="mddbyam:Instrument">
>> <xsd:annotation>
>> <xsd:appinfo source="teneo.jpa">@PrimaryKeyJoinColumn @Column(name="instrument")</xsd:appinfo>
>> </xsd:annotation>
>> </xsd:element>
>>
>> I have just added this and have several previous like it, they correctly had the one to one between instrument and them.
>> This does not? I cannot see what is different? Any clues?
>>
>> I added the @Column annotation, because the others came out with the correct lowercase column name without it and this
>> one comes out with an upper case name, even after adding this annotation?
>>
>> Thx.
>>
>> David
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Binding: EMFProperties.list() with FeaturePath - Bug ?
Next Topic:[CDO] Performance Issues on loading large amount of data
Goto Forum:
  


Current Time: Wed Apr 24 22:31:43 GMT 2024

Powered by FUDForum. Page generated in 0.04054 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top