Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo/Hibernate Column Annotation Column
Teneo/Hibernate Column Annotation Column [message #95247] Sat, 01 September 2007 08:00 Go to next message
Phaneesh is currently offline PhaneeshFriend
Messages: 16
Registered: July 2009
Junior Member
Hi,

I am trying to use the column annotation to change the length. The attribute
datatype is EString and the Class that has this attribute is in a
sub-package. I tried the model annotation. Through the generated code has
the annotation it is not getting picked up. The column length remains the
same. I also tries to use the JPA annotation directly on the getter method
for that attribute. This also has no effect.
Here is the details of methods that I have tried.
1. Model Annotation:
Source : http://annotation.elver.org/Column
Key: length
Value: 500

In the generated code I see this:
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(String)
* @see
org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
* @model annotation="http://annotation.elver.org/Column length='500'"
* @generated
*/
String getValue();

2. JPA annotation
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(String)
* @see
org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
*/
@Column(length=500)
String getValue();

Both of these methods fail to change the column length. Please help me in
resolving this issue.

Regards
Phaneesh
Re: Teneo/Hibernate Column Annotation Column [message #95423 is a reply to message #95247] Sun, 02 September 2007 10:01 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Phaneesh,
The first method you tried did not follow the format (source should be teneo.jpa, key should be
value) as described here:
http://www.elver.org/hibernate/ejb3_format.html

Your second method won't work with Teneo, tou have to set the annotation in the ecore model (or xsd)
or in a separate xml file (see also the link noted above).

gr. Martin

Phaneesh wrote:
> Hi,
>
> I am trying to use the column annotation to change the length. The attribute
> datatype is EString and the Class that has this attribute is in a
> sub-package. I tried the model annotation. Through the generated code has
> the annotation it is not getting picked up. The column length remains the
> same. I also tries to use the JPA annotation directly on the getter method
> for that attribute. This also has no effect.
> Here is the details of methods that I have tried.
> 1. Model Annotation:
> Source : http://annotation.elver.org/Column
> Key: length
> Value: 500
>
> In the generated code I see this:
> /**
> * Returns the value of the '<em><b>Value</b></em>' attribute.
> * <!-- begin-user-doc -->
> * <p>
> * If the meaning of the '<em>Value</em>' attribute isn't clear,
> * there really should be more of a description here...
> * </p>
> * <!-- end-user-doc -->
> * @return the value of the '<em>Value</em>' attribute.
> * @see #setValue(String)
> * @see
> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
> * @model annotation="http://annotation.elver.org/Column length='500'"
> * @generated
> */
> String getValue();
>
> 2. JPA annotation
> /**
> * Returns the value of the '<em><b>Value</b></em>' attribute.
> * <!-- begin-user-doc -->
> * <p>
> * If the meaning of the '<em>Value</em>' attribute isn't clear,
> * there really should be more of a description here...
> * </p>
> * <!-- end-user-doc -->
> * @return the value of the '<em>Value</em>' attribute.
> * @see #setValue(String)
> * @see
> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
> */
> @Column(length=500)
> String getValue();
>
> Both of these methods fail to change the column length. Please help me in
> resolving this issue.
>
> Regards
> Phaneesh
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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/Hibernate Column Annotation Column [message #95576 is a reply to message #95423] Mon, 03 September 2007 03:34 Go to previous messageGo to next message
Phaneesh is currently offline PhaneeshFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

I tried source=teneo.jpa and value=@Column(length=500) and source=teneo.jpa
appinfo=@Column(length=500) both these have no effect on the teneo created
hibernate mapping file. It does not put the length attribute to the target
column.

The generated model code in both cases:
1. Source=teneo.jpa and value=@Column(length=500)
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(String)
* @see
org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
* @model annotation="teneo.jpa value='@Column(length=500)'"
* @generated
*/
String getValue();

2. Source=teneo.jpa and appinfo=@Column(length=500)
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(String)
* @see
org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
* @model annotation="teneo.jpa appinfo='@Column(length=500)'"
* @generated
*/
String getValue();

Here is the generated mapping file for the same:
<property name="value" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`VALUE`"/>
</property>

Please tell me if I am missing something.

Regards
Phaneesh

"Martin Taal" <mtaal@elver.org> wrote in message
news:fbe1m9$a8q$1@build.eclipse.org...
> Hi Phaneesh,
> The first method you tried did not follow the format (source should be
> teneo.jpa, key should be value) as described here:
> http://www.elver.org/hibernate/ejb3_format.html
>
> Your second method won't work with Teneo, tou have to set the annotation
> in the ecore model (or xsd) or in a separate xml file (see also the link
> noted above).
>
> gr. Martin
>
> Phaneesh wrote:
>> Hi,
>>
>> I am trying to use the column annotation to change the length. The
>> attribute datatype is EString and the Class that has this attribute is in
>> a sub-package. I tried the model annotation. Through the generated code
>> has the annotation it is not getting picked up. The column length remains
>> the same. I also tries to use the JPA annotation directly on the getter
>> method for that attribute. This also has no effect.
>> Here is the details of methods that I have tried.
>> 1. Model Annotation:
>> Source : http://annotation.elver.org/Column
>> Key: length
>> Value: 500
>>
>> In the generated code I see this:
>> /**
>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>> * <!-- begin-user-doc -->
>> * <p>
>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>> * there really should be more of a description here...
>> * </p>
>> * <!-- end-user-doc -->
>> * @return the value of the '<em>Value</em>' attribute.
>> * @see #setValue(String)
>> * @see
>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>> * @model annotation="http://annotation.elver.org/Column length='500'"
>> * @generated
>> */
>> String getValue();
>>
>> 2. JPA annotation
>> /**
>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>> * <!-- begin-user-doc -->
>> * <p>
>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>> * there really should be more of a description here...
>> * </p>
>> * <!-- end-user-doc -->
>> * @return the value of the '<em>Value</em>' attribute.
>> * @see #setValue(String)
>> * @see
>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>> */
>> @Column(length=500)
>> String getValue();
>>
>> Both of these methods fail to change the column length. Please help me in
>> resolving this issue.
>>
>> Regards
>> Phaneesh
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> 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/Hibernate Column Annotation Column [message #95617 is a reply to message #95576] Mon, 03 September 2007 09:17 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070501080601070404000102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Phaneesh,
I have attached the ecore file which is used (in Teneo) as a testcase for the column annotation.
This works for Teneo. Can you check if you have specified the annotation in the same way (in the
ecore file or xsd)?

gr. Martin

Phaneesh wrote:
> Hi Martin,
>
> I tried source=teneo.jpa and value=@Column(length=500) and source=teneo.jpa
> appinfo=@Column(length=500) both these have no effect on the teneo created
> hibernate mapping file. It does not put the length attribute to the target
> column.
>
> The generated model code in both cases:
> 1. Source=teneo.jpa and value=@Column(length=500)
> /**
> * Returns the value of the '<em><b>Value</b></em>' attribute.
> * <!-- begin-user-doc -->
> * <p>
> * If the meaning of the '<em>Value</em>' attribute isn't clear,
> * there really should be more of a description here...
> * </p>
> * <!-- end-user-doc -->
> * @return the value of the '<em>Value</em>' attribute.
> * @see #setValue(String)
> * @see
> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
> * @model annotation="teneo.jpa value='@Column(length=500)'"
> * @generated
> */
> String getValue();
>
> 2. Source=teneo.jpa and appinfo=@Column(length=500)
> /**
> * Returns the value of the '<em><b>Value</b></em>' attribute.
> * <!-- begin-user-doc -->
> * <p>
> * If the meaning of the '<em>Value</em>' attribute isn't clear,
> * there really should be more of a description here...
> * </p>
> * <!-- end-user-doc -->
> * @return the value of the '<em>Value</em>' attribute.
> * @see #setValue(String)
> * @see
> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
> * @model annotation="teneo.jpa appinfo='@Column(length=500)'"
> * @generated
> */
> String getValue();
>
> Here is the generated mapping file for the same:
> <property name="value" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`VALUE`"/>
> </property>
>
> Please tell me if I am missing something.
>
> Regards
> Phaneesh
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:fbe1m9$a8q$1@build.eclipse.org...
>> Hi Phaneesh,
>> The first method you tried did not follow the format (source should be
>> teneo.jpa, key should be value) as described here:
>> http://www.elver.org/hibernate/ejb3_format.html
>>
>> Your second method won't work with Teneo, tou have to set the annotation
>> in the ecore model (or xsd) or in a separate xml file (see also the link
>> noted above).
>>
>> gr. Martin
>>
>> Phaneesh wrote:
>>> Hi,
>>>
>>> I am trying to use the column annotation to change the length. The
>>> attribute datatype is EString and the Class that has this attribute is in
>>> a sub-package. I tried the model annotation. Through the generated code
>>> has the annotation it is not getting picked up. The column length remains
>>> the same. I also tries to use the JPA annotation directly on the getter
>>> method for that attribute. This also has no effect.
>>> Here is the details of methods that I have tried.
>>> 1. Model Annotation:
>>> Source : http://annotation.elver.org/Column
>>> Key: length
>>> Value: 500
>>>
>>> In the generated code I see this:
>>> /**
>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>> * <!-- begin-user-doc -->
>>> * <p>
>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>> * there really should be more of a description here...
>>> * </p>
>>> * <!-- end-user-doc -->
>>> * @return the value of the '<em>Value</em>' attribute.
>>> * @see #setValue(String)
>>> * @see
>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>> * @model annotation="http://annotation.elver.org/Column length='500'"
>>> * @generated
>>> */
>>> String getValue();
>>>
>>> 2. JPA annotation
>>> /**
>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>> * <!-- begin-user-doc -->
>>> * <p>
>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>> * there really should be more of a description here...
>>> * </p>
>>> * <!-- end-user-doc -->
>>> * @return the value of the '<em>Value</em>' attribute.
>>> * @see #setValue(String)
>>> * @see
>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>> */
>>> @Column(length=500)
>>> String getValue();
>>>
>>> Both of these methods fail to change the column length. Please help me in
>>> resolving this issue.
>>>
>>> Regards
>>> Phaneesh
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> 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
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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

--------------070501080601070404000102
Content-Type: text/xml;
name="column.ecore"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="column.ecore"

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="column"
nsURI=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/col umn" nsPrefix="column">
<eClassifiers xsi:type="ecore:EClass" name="Book">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Table(name=&quot;mybooktable&quot;)"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="Book"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title" unique="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Column(name=&quot;titel&quot; unique=&quot;true&quot; length=&quot;25&quot;)"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="title"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="pages" unique="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Column(updatable=&quot;false&quot; insertable=&quot;false&quot;)"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="pages"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="weight" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Decimal">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Column(name=&quot;gewicht&quot; nullable=&quot;true&quot; precision=&quot;5&quot; scale=&quot;2&quot;)"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="weight"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="author" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="author"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>

--------------070501080601070404000102--
Re: Teneo/Hibernate Column Annotation Column [message #95747 is a reply to message #95617] Mon, 03 September 2007 14:46 Go to previous messageGo to next message
Phaneesh is currently offline PhaneeshFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

Thanks for the update. I was using a single quote in the annotation.
Instead of @Column(length=500) I was using @Column(length='500').
Now it is working!!. The hibernate mapping file has the length attribute set
to the target column. But, the problem now is the schema is not getting
updated.
I have hibernate.hbm2ddl.auto = update in hbernate configuration, and in
teneo config I have set teneo.runtime.update_schema=true. But the table is
not getting updated in the database. I am using oracle 10 database. If I
change the hibernate.hbm2ddl.auto to create and then run it on a new schema
the column length is set to the desired value. May be there is a sync issue.
Please tell me whether I have set any other option in teneo?
Regards

Phaneesh




"Martin Taal" <mtaal@elver.org> wrote in message
news:fbgjf0$snn$1@build.eclipse.org...
> Hi Phaneesh,
> I have attached the ecore file which is used (in Teneo) as a testcase for
> the column annotation.
> This works for Teneo. Can you check if you have specified the annotation
> in the same way (in the
> ecore file or xsd)?
>
> gr. Martin
>
> Phaneesh wrote:
>> Hi Martin,
>>
>> I tried source=teneo.jpa and value=@Column(length=500) and
>> source=teneo.jpa
>> appinfo=@Column(length=500) both these have no effect on the teneo
>> created
>> hibernate mapping file. It does not put the length attribute to the
>> target
>> column.
>>
>> The generated model code in both cases:
>> 1. Source=teneo.jpa and value=@Column(length=500)
>> /**
>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>> * <!-- begin-user-doc -->
>> * <p>
>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>> * there really should be more of a description here...
>> * </p>
>> * <!-- end-user-doc -->
>> * @return the value of the '<em>Value</em>' attribute.
>> * @see #setValue(String)
>> * @see
>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>> * @model annotation="teneo.jpa value='@Column(length=500)'"
>> * @generated
>> */
>> String getValue();
>>
>> 2. Source=teneo.jpa and appinfo=@Column(length=500)
>> /**
>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>> * <!-- begin-user-doc -->
>> * <p>
>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>> * there really should be more of a description here...
>> * </p>
>> * <!-- end-user-doc -->
>> * @return the value of the '<em>Value</em>' attribute.
>> * @see #setValue(String)
>> * @see
>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>> * @model annotation="teneo.jpa appinfo='@Column(length=500)'"
>> * @generated
>> */
>> String getValue();
>>
>> Here is the generated mapping file for the same:
>> <property name="value" lazy="false" insert="true" update="true"
>> not-null="false" unique="false" type="java.lang.String">
>> <column not-null="false" unique="false" name="`VALUE`"/>
>> </property>
>>
>> Please tell me if I am missing something.
>>
>> Regards
>> Phaneesh
>>
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:fbe1m9$a8q$1@build.eclipse.org...
>>> Hi Phaneesh,
>>> The first method you tried did not follow the format (source should be
>>> teneo.jpa, key should be value) as described here:
>>> http://www.elver.org/hibernate/ejb3_format.html
>>>
>>> Your second method won't work with Teneo, tou have to set the annotation
>>> in the ecore model (or xsd) or in a separate xml file (see also the link
>>> noted above).
>>>
>>> gr. Martin
>>>
>>> Phaneesh wrote:
>>>> Hi,
>>>>
>>>> I am trying to use the column annotation to change the length. The
>>>> attribute datatype is EString and the Class that has this attribute is
>>>> in
>>>> a sub-package. I tried the model annotation. Through the generated code
>>>> has the annotation it is not getting picked up. The column length
>>>> remains
>>>> the same. I also tries to use the JPA annotation directly on the getter
>>>> method for that attribute. This also has no effect.
>>>> Here is the details of methods that I have tried.
>>>> 1. Model Annotation:
>>>> Source : http://annotation.elver.org/Column
>>>> Key: length
>>>> Value: 500
>>>>
>>>> In the generated code I see this:
>>>> /**
>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>> * <!-- begin-user-doc -->
>>>> * <p>
>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>> * there really should be more of a description here...
>>>> * </p>
>>>> * <!-- end-user-doc -->
>>>> * @return the value of the '<em>Value</em>' attribute.
>>>> * @see #setValue(String)
>>>> * @see
>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>> * @model annotation="http://annotation.elver.org/Column length='500'"
>>>> * @generated
>>>> */
>>>> String getValue();
>>>>
>>>> 2. JPA annotation
>>>> /**
>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>> * <!-- begin-user-doc -->
>>>> * <p>
>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>> * there really should be more of a description here...
>>>> * </p>
>>>> * <!-- end-user-doc -->
>>>> * @return the value of the '<em>Value</em>' attribute.
>>>> * @see #setValue(String)
>>>> * @see
>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>> */
>>>> @Column(length=500)
>>>> String getValue();
>>>>
>>>> Both of these methods fail to change the column length. Please help me
>>>> in
>>>> resolving this issue.
>>>>
>>>> Regards
>>>> Phaneesh
>>>
>>> --
>>>
>>> With Regards, Martin Taal
>>>
>>> Springsite/Elver.org
>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>> The Netherlands
>>> 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
>>
>>
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> 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
>


------------------------------------------------------------ --------------------


> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="column"
> nsURI=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/col umn"
> nsPrefix="column">
> <eClassifiers xsi:type="ecore:EClass" name="Book">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Table(name=&quot;mybooktable&quot;)"/>
> </eAnnotations>
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="Book"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="title"
> unique="false" lowerBound="1"
> eType="ecore:EDataType
> http://www.eclipse.org/emf/2003/XMLType#//String">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Column(name=&quot;titel&quot;
> unique=&quot;true&quot; length=&quot;25&quot;)"/>
> </eAnnotations>
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="title"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="pages"
> unique="false" lowerBound="1"
> eType="ecore:EDataType
> http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Column(updatable=&quot;false&quot;
> insertable=&quot;false&quot;)"/>
> </eAnnotations>
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="pages"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="weight"
> unique="false"
> lowerBound="1" eType="ecore:EDataType
> http://www.eclipse.org/emf/2003/XMLType#//Decimal">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Column(name=&quot;gewicht&quot;
> nullable=&quot;true&quot; precision=&quot;5&quot; scale=&quot;2&quot;)"/>
> </eAnnotations>
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="weight"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="author"
> unique="false"
> lowerBound="1" eType="ecore:EDataType
> http://www.eclipse.org/emf/2003/XMLType#//String">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="author"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> </ecore:EPackage>
>
Re: Teneo/Hibernate Column Annotation Column [message #95781 is a reply to message #95747] Mon, 03 September 2007 17:48 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Phaneesh
I don't think that this has to do with Teneo but more with how hibernate updates the schema. For
example my experience is that new indexes are also only added in a create mode. So it seems to be a
hibernate 'feature'.

gr. Martin

Phaneesh wrote:
> Hi Martin,
>
> Thanks for the update. I was using a single quote in the annotation.
> Instead of @Column(length=500) I was using @Column(length='500').
> Now it is working!!. The hibernate mapping file has the length attribute set
> to the target column. But, the problem now is the schema is not getting
> updated.
> I have hibernate.hbm2ddl.auto = update in hbernate configuration, and in
> teneo config I have set teneo.runtime.update_schema=true. But the table is
> not getting updated in the database. I am using oracle 10 database. If I
> change the hibernate.hbm2ddl.auto to create and then run it on a new schema
> the column length is set to the desired value. May be there is a sync issue.
> Please tell me whether I have set any other option in teneo?
> Regards
>
> Phaneesh
>
>
>
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:fbgjf0$snn$1@build.eclipse.org...
>> Hi Phaneesh,
>> I have attached the ecore file which is used (in Teneo) as a testcase for
>> the column annotation.
>> This works for Teneo. Can you check if you have specified the annotation
>> in the same way (in the
>> ecore file or xsd)?
>>
>> gr. Martin
>>
>> Phaneesh wrote:
>>> Hi Martin,
>>>
>>> I tried source=teneo.jpa and value=@Column(length=500) and
>>> source=teneo.jpa
>>> appinfo=@Column(length=500) both these have no effect on the teneo
>>> created
>>> hibernate mapping file. It does not put the length attribute to the
>>> target
>>> column.
>>>
>>> The generated model code in both cases:
>>> 1. Source=teneo.jpa and value=@Column(length=500)
>>> /**
>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>> * <!-- begin-user-doc -->
>>> * <p>
>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>> * there really should be more of a description here...
>>> * </p>
>>> * <!-- end-user-doc -->
>>> * @return the value of the '<em>Value</em>' attribute.
>>> * @see #setValue(String)
>>> * @see
>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>> * @model annotation="teneo.jpa value='@Column(length=500)'"
>>> * @generated
>>> */
>>> String getValue();
>>>
>>> 2. Source=teneo.jpa and appinfo=@Column(length=500)
>>> /**
>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>> * <!-- begin-user-doc -->
>>> * <p>
>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>> * there really should be more of a description here...
>>> * </p>
>>> * <!-- end-user-doc -->
>>> * @return the value of the '<em>Value</em>' attribute.
>>> * @see #setValue(String)
>>> * @see
>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>> * @model annotation="teneo.jpa appinfo='@Column(length=500)'"
>>> * @generated
>>> */
>>> String getValue();
>>>
>>> Here is the generated mapping file for the same:
>>> <property name="value" lazy="false" insert="true" update="true"
>>> not-null="false" unique="false" type="java.lang.String">
>>> <column not-null="false" unique="false" name="`VALUE`"/>
>>> </property>
>>>
>>> Please tell me if I am missing something.
>>>
>>> Regards
>>> Phaneesh
>>>
>>> "Martin Taal" <mtaal@elver.org> wrote in message
>>> news:fbe1m9$a8q$1@build.eclipse.org...
>>>> Hi Phaneesh,
>>>> The first method you tried did not follow the format (source should be
>>>> teneo.jpa, key should be value) as described here:
>>>> http://www.elver.org/hibernate/ejb3_format.html
>>>>
>>>> Your second method won't work with Teneo, tou have to set the annotation
>>>> in the ecore model (or xsd) or in a separate xml file (see also the link
>>>> noted above).
>>>>
>>>> gr. Martin
>>>>
>>>> Phaneesh wrote:
>>>>> Hi,
>>>>>
>>>>> I am trying to use the column annotation to change the length. The
>>>>> attribute datatype is EString and the Class that has this attribute is
>>>>> in
>>>>> a sub-package. I tried the model annotation. Through the generated code
>>>>> has the annotation it is not getting picked up. The column length
>>>>> remains
>>>>> the same. I also tries to use the JPA annotation directly on the getter
>>>>> method for that attribute. This also has no effect.
>>>>> Here is the details of methods that I have tried.
>>>>> 1. Model Annotation:
>>>>> Source : http://annotation.elver.org/Column
>>>>> Key: length
>>>>> Value: 500
>>>>>
>>>>> In the generated code I see this:
>>>>> /**
>>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>>> * <!-- begin-user-doc -->
>>>>> * <p>
>>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>>> * there really should be more of a description here...
>>>>> * </p>
>>>>> * <!-- end-user-doc -->
>>>>> * @return the value of the '<em>Value</em>' attribute.
>>>>> * @see #setValue(String)
>>>>> * @see
>>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>>> * @model annotation="http://annotation.elver.org/Column length='500'"
>>>>> * @generated
>>>>> */
>>>>> String getValue();
>>>>>
>>>>> 2. JPA annotation
>>>>> /**
>>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>>> * <!-- begin-user-doc -->
>>>>> * <p>
>>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>>> * there really should be more of a description here...
>>>>> * </p>
>>>>> * <!-- end-user-doc -->
>>>>> * @return the value of the '<em>Value</em>' attribute.
>>>>> * @see #setValue(String)
>>>>> * @see
>>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>>> */
>>>>> @Column(length=500)
>>>>> String getValue();
>>>>>
>>>>> Both of these methods fail to change the column length. Please help me
>>>>> in
>>>>> resolving this issue.
>>>>>
>>>>> Regards
>>>>> Phaneesh
>>>> --
>>>>
>>>> With Regards, Martin Taal
>>>>
>>>> Springsite/Elver.org
>>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>>> The Netherlands
>>>> 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
>>>
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> 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
>>
>
>
> ------------------------------------------------------------ --------------------
>
>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <ecore:EPackage xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="column"
>> nsURI=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/col umn"
>> nsPrefix="column">
>> <eClassifiers xsi:type="ecore:EClass" name="Book">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Table(name=&quot;mybooktable&quot;)"/>
>> </eAnnotations>
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value="Book"/>
>> <details key="kind" value="elementOnly"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="title"
>> unique="false" lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Column(name=&quot;titel&quot;
>> unique=&quot;true&quot; length=&quot;25&quot;)"/>
>> </eAnnotations>
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="title"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="pages"
>> unique="false" lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Column(updatable=&quot;false&quot;
>> insertable=&quot;false&quot;)"/>
>> </eAnnotations>
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="pages"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="weight"
>> unique="false"
>> lowerBound="1" eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//Decimal">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Column(name=&quot;gewicht&quot;
>> nullable=&quot;true&quot; precision=&quot;5&quot; scale=&quot;2&quot;)"/>
>> </eAnnotations>
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="weight"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="author"
>> unique="false"
>> lowerBound="1" eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="author"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> </ecore:EPackage>
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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/Hibernate Column Annotation Column [message #95797 is a reply to message #95781] Tue, 04 September 2007 03:30 Go to previous message
Phaneesh is currently offline PhaneeshFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

Thanks for the info. Infact the hibernate schema updates happens only for
new objects that gets added and for new/changed relationships. Hibernate FAQ
itself says schema update tool comes with no warranties. Here is the link
which gives more info on Hibernate SchemaUpdate Tool.
http://www.hibernate.org/119.html#A9
Once again thanks for all the help. My life would have been a real hell
without without Teneo. Teneo really rocks!!

Regards
Phaneesh

"Martin Taal" <mtaal@elver.org> wrote in message
news:fbhhe0$rr6$1@build.eclipse.org...
> Hi Phaneesh
> I don't think that this has to do with Teneo but more with how hibernate
> updates the schema. For example my experience is that new indexes are also
> only added in a create mode. So it seems to be a hibernate 'feature'.
>
> gr. Martin
>
> Phaneesh wrote:
>> Hi Martin,
>>
>> Thanks for the update. I was using a single quote in the annotation.
>> Instead of @Column(length=500) I was using @Column(length='500').
>> Now it is working!!. The hibernate mapping file has the length attribute
>> set to the target column. But, the problem now is the schema is not
>> getting updated.
>> I have hibernate.hbm2ddl.auto = update in hbernate configuration, and in
>> teneo config I have set teneo.runtime.update_schema=true. But the table
>> is not getting updated in the database. I am using oracle 10 database. If
>> I change the hibernate.hbm2ddl.auto to create and then run it on a new
>> schema the column length is set to the desired value. May be there is a
>> sync issue. Please tell me whether I have set any other option in teneo?
>> Regards
>>
>> Phaneesh
>>
>>
>>
>>
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:fbgjf0$snn$1@build.eclipse.org...
>>> Hi Phaneesh,
>>> I have attached the ecore file which is used (in Teneo) as a testcase
>>> for the column annotation.
>>> This works for Teneo. Can you check if you have specified the annotation
>>> in the same way (in the
>>> ecore file or xsd)?
>>>
>>> gr. Martin
>>>
>>> Phaneesh wrote:
>>>> Hi Martin,
>>>>
>>>> I tried source=teneo.jpa and value=@Column(length=500) and
>>>> source=teneo.jpa
>>>> appinfo=@Column(length=500) both these have no effect on the teneo
>>>> created
>>>> hibernate mapping file. It does not put the length attribute to the
>>>> target
>>>> column.
>>>>
>>>> The generated model code in both cases:
>>>> 1. Source=teneo.jpa and value=@Column(length=500)
>>>> /**
>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>> * <!-- begin-user-doc -->
>>>> * <p>
>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>> * there really should be more of a description here...
>>>> * </p>
>>>> * <!-- end-user-doc -->
>>>> * @return the value of the '<em>Value</em>' attribute.
>>>> * @see #setValue(String)
>>>> * @see
>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>> * @model annotation="teneo.jpa value='@Column(length=500)'"
>>>> * @generated
>>>> */
>>>> String getValue();
>>>>
>>>> 2. Source=teneo.jpa and appinfo=@Column(length=500)
>>>> /**
>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>> * <!-- begin-user-doc -->
>>>> * <p>
>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>> * there really should be more of a description here...
>>>> * </p>
>>>> * <!-- end-user-doc -->
>>>> * @return the value of the '<em>Value</em>' attribute.
>>>> * @see #setValue(String)
>>>> * @see
>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>> * @model annotation="teneo.jpa appinfo='@Column(length=500)'"
>>>> * @generated
>>>> */
>>>> String getValue();
>>>>
>>>> Here is the generated mapping file for the same:
>>>> <property name="value" lazy="false" insert="true" update="true"
>>>> not-null="false" unique="false" type="java.lang.String">
>>>> <column not-null="false" unique="false" name="`VALUE`"/>
>>>> </property>
>>>>
>>>> Please tell me if I am missing something.
>>>>
>>>> Regards
>>>> Phaneesh
>>>>
>>>> "Martin Taal" <mtaal@elver.org> wrote in message
>>>> news:fbe1m9$a8q$1@build.eclipse.org...
>>>>> Hi Phaneesh,
>>>>> The first method you tried did not follow the format (source should be
>>>>> teneo.jpa, key should be value) as described here:
>>>>> http://www.elver.org/hibernate/ejb3_format.html
>>>>>
>>>>> Your second method won't work with Teneo, tou have to set the
>>>>> annotation
>>>>> in the ecore model (or xsd) or in a separate xml file (see also the
>>>>> link
>>>>> noted above).
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Phaneesh wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am trying to use the column annotation to change the length. The
>>>>>> attribute datatype is EString and the Class that has this attribute
>>>>>> is in
>>>>>> a sub-package. I tried the model annotation. Through the generated
>>>>>> code
>>>>>> has the annotation it is not getting picked up. The column length
>>>>>> remains
>>>>>> the same. I also tries to use the JPA annotation directly on the
>>>>>> getter
>>>>>> method for that attribute. This also has no effect.
>>>>>> Here is the details of methods that I have tried.
>>>>>> 1. Model Annotation:
>>>>>> Source : http://annotation.elver.org/Column
>>>>>> Key: length
>>>>>> Value: 500
>>>>>>
>>>>>> In the generated code I see this:
>>>>>> /**
>>>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>>>> * <!-- begin-user-doc -->
>>>>>> * <p>
>>>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>>>> * there really should be more of a description here...
>>>>>> * </p>
>>>>>> * <!-- end-user-doc -->
>>>>>> * @return the value of the '<em>Value</em>' attribute.
>>>>>> * @see #setValue(String)
>>>>>> * @see
>>>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>>>> * @model annotation="http://annotation.elver.org/Column
>>>>>> length='500'"
>>>>>> * @generated
>>>>>> */
>>>>>> String getValue();
>>>>>>
>>>>>> 2. JPA annotation
>>>>>> /**
>>>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>>>> * <!-- begin-user-doc -->
>>>>>> * <p>
>>>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>>>> * there really should be more of a description here...
>>>>>> * </p>
>>>>>> * <!-- end-user-doc -->
>>>>>> * @return the value of the '<em>Value</em>' attribute.
>>>>>> * @see #setValue(String)
>>>>>> * @see
>>>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>>>> */
>>>>>> @Column(length=500)
>>>>>> String getValue();
>>>>>>
>>>>>> Both of these methods fail to change the column length. Please help
>>>>>> me in
>>>>>> resolving this issue.
>>>>>>
>>>>>> Regards
>>>>>> Phaneesh
>>>>> --
>>>>>
>>>>> With Regards, Martin Taal
>>>>>
>>>>> Springsite/Elver.org
>>>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>>>> The Netherlands
>>>>> 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
>>>>
>>>
>>> --
>>>
>>> With Regards, Martin Taal
>>>
>>> Springsite/Elver.org
>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>> The Netherlands
>>> 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
>>>
>>
>>
>> ------------------------------------------------------------ --------------------
>>
>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <ecore:EPackage xmi:version="2.0"
>>> xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="column"
>>>
>>> nsURI=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/col umn"
>>> nsPrefix="column">
>>> <eClassifiers xsi:type="ecore:EClass" name="Book">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo"
>>> value="@Table(name=&quot;mybooktable&quot;)"/>
>>> </eAnnotations>
>>> <eAnnotations
>>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>>> <details key="name" value="Book"/>
>>> <details key="kind" value="elementOnly"/>
>>> </eAnnotations>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="title"
>>> unique="false" lowerBound="1"
>>> eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2003/XMLType#//String">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@Column(name=&quot;titel&quot;
>>> unique=&quot;true&quot; length=&quot;25&quot;)"/>
>>> </eAnnotations>
>>> <eAnnotations
>>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>>> <details key="kind" value="element"/>
>>> <details key="name" value="title"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="pages"
>>> unique="false" lowerBound="1"
>>> eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@Column(updatable=&quot;false&quot;
>>> insertable=&quot;false&quot;)"/>
>>> </eAnnotations>
>>> <eAnnotations
>>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>>> <details key="kind" value="element"/>
>>> <details key="name" value="pages"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="weight"
>>> unique="false"
>>> lowerBound="1" eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2003/XMLType#//Decimal">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@Column(name=&quot;gewicht&quot;
>>> nullable=&quot;true&quot; precision=&quot;5&quot;
>>> scale=&quot;2&quot;)"/>
>>> </eAnnotations>
>>> <eAnnotations
>>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>>> <details key="kind" value="element"/>
>>> <details key="name" value="weight"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="author"
>>> unique="false"
>>> lowerBound="1" eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2003/XMLType#//String">
>>> <eAnnotations
>>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>>> <details key="kind" value="element"/>
>>> <details key="name" value="author"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> </eClassifiers>
>>> </ecore:EPackage>
>>>
>>
>>
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> 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/Hibernate Column Annotation Column [message #609615 is a reply to message #95247] Sun, 02 September 2007 10:01 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Phaneesh,
The first method you tried did not follow the format (source should be teneo.jpa, key should be
value) as described here:
http://www.elver.org/hibernate/ejb3_format.html

Your second method won't work with Teneo, tou have to set the annotation in the ecore model (or xsd)
or in a separate xml file (see also the link noted above).

gr. Martin

Phaneesh wrote:
> Hi,
>
> I am trying to use the column annotation to change the length. The attribute
> datatype is EString and the Class that has this attribute is in a
> sub-package. I tried the model annotation. Through the generated code has
> the annotation it is not getting picked up. The column length remains the
> same. I also tries to use the JPA annotation directly on the getter method
> for that attribute. This also has no effect.
> Here is the details of methods that I have tried.
> 1. Model Annotation:
> Source : http://annotation.elver.org/Column
> Key: length
> Value: 500
>
> In the generated code I see this:
> /**
> * Returns the value of the '<em><b>Value</b></em>' attribute.
> * <!-- begin-user-doc -->
> * <p>
> * If the meaning of the '<em>Value</em>' attribute isn't clear,
> * there really should be more of a description here...
> * </p>
> * <!-- end-user-doc -->
> * @return the value of the '<em>Value</em>' attribute.
> * @see #setValue(String)
> * @see
> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
> * @model annotation="http://annotation.elver.org/Column length='500'"
> * @generated
> */
> String getValue();
>
> 2. JPA annotation
> /**
> * Returns the value of the '<em><b>Value</b></em>' attribute.
> * <!-- begin-user-doc -->
> * <p>
> * If the meaning of the '<em>Value</em>' attribute isn't clear,
> * there really should be more of a description here...
> * </p>
> * <!-- end-user-doc -->
> * @return the value of the '<em>Value</em>' attribute.
> * @see #setValue(String)
> * @see
> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
> */
> @Column(length=500)
> String getValue();
>
> Both of these methods fail to change the column length. Please help me in
> resolving this issue.
>
> Regards
> Phaneesh
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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/Hibernate Column Annotation Column [message #609625 is a reply to message #95423] Mon, 03 September 2007 03:34 Go to previous message
Phaneesh is currently offline PhaneeshFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

I tried source=teneo.jpa and value=@Column(length=500) and source=teneo.jpa
appinfo=@Column(length=500) both these have no effect on the teneo created
hibernate mapping file. It does not put the length attribute to the target
column.

The generated model code in both cases:
1. Source=teneo.jpa and value=@Column(length=500)
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(String)
* @see
org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
* @model annotation="teneo.jpa value='@Column(length=500)'"
* @generated
*/
String getValue();

2. Source=teneo.jpa and appinfo=@Column(length=500)
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(String)
* @see
org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
* @model annotation="teneo.jpa appinfo='@Column(length=500)'"
* @generated
*/
String getValue();

Here is the generated mapping file for the same:
<property name="value" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`VALUE`"/>
</property>

Please tell me if I am missing something.

Regards
Phaneesh

"Martin Taal" <mtaal@elver.org> wrote in message
news:fbe1m9$a8q$1@build.eclipse.org...
> Hi Phaneesh,
> The first method you tried did not follow the format (source should be
> teneo.jpa, key should be value) as described here:
> http://www.elver.org/hibernate/ejb3_format.html
>
> Your second method won't work with Teneo, tou have to set the annotation
> in the ecore model (or xsd) or in a separate xml file (see also the link
> noted above).
>
> gr. Martin
>
> Phaneesh wrote:
>> Hi,
>>
>> I am trying to use the column annotation to change the length. The
>> attribute datatype is EString and the Class that has this attribute is in
>> a sub-package. I tried the model annotation. Through the generated code
>> has the annotation it is not getting picked up. The column length remains
>> the same. I also tries to use the JPA annotation directly on the getter
>> method for that attribute. This also has no effect.
>> Here is the details of methods that I have tried.
>> 1. Model Annotation:
>> Source : http://annotation.elver.org/Column
>> Key: length
>> Value: 500
>>
>> In the generated code I see this:
>> /**
>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>> * <!-- begin-user-doc -->
>> * <p>
>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>> * there really should be more of a description here...
>> * </p>
>> * <!-- end-user-doc -->
>> * @return the value of the '<em>Value</em>' attribute.
>> * @see #setValue(String)
>> * @see
>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>> * @model annotation="http://annotation.elver.org/Column length='500'"
>> * @generated
>> */
>> String getValue();
>>
>> 2. JPA annotation
>> /**
>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>> * <!-- begin-user-doc -->
>> * <p>
>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>> * there really should be more of a description here...
>> * </p>
>> * <!-- end-user-doc -->
>> * @return the value of the '<em>Value</em>' attribute.
>> * @see #setValue(String)
>> * @see
>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>> */
>> @Column(length=500)
>> String getValue();
>>
>> Both of these methods fail to change the column length. Please help me in
>> resolving this issue.
>>
>> Regards
>> Phaneesh
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> 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/Hibernate Column Annotation Column [message #609627 is a reply to message #95576] Mon, 03 September 2007 09:17 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070501080601070404000102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Phaneesh,
I have attached the ecore file which is used (in Teneo) as a testcase for the column annotation.
This works for Teneo. Can you check if you have specified the annotation in the same way (in the
ecore file or xsd)?

gr. Martin

Phaneesh wrote:
> Hi Martin,
>
> I tried source=teneo.jpa and value=@Column(length=500) and source=teneo.jpa
> appinfo=@Column(length=500) both these have no effect on the teneo created
> hibernate mapping file. It does not put the length attribute to the target
> column.
>
> The generated model code in both cases:
> 1. Source=teneo.jpa and value=@Column(length=500)
> /**
> * Returns the value of the '<em><b>Value</b></em>' attribute.
> * <!-- begin-user-doc -->
> * <p>
> * If the meaning of the '<em>Value</em>' attribute isn't clear,
> * there really should be more of a description here...
> * </p>
> * <!-- end-user-doc -->
> * @return the value of the '<em>Value</em>' attribute.
> * @see #setValue(String)
> * @see
> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
> * @model annotation="teneo.jpa value='@Column(length=500)'"
> * @generated
> */
> String getValue();
>
> 2. Source=teneo.jpa and appinfo=@Column(length=500)
> /**
> * Returns the value of the '<em><b>Value</b></em>' attribute.
> * <!-- begin-user-doc -->
> * <p>
> * If the meaning of the '<em>Value</em>' attribute isn't clear,
> * there really should be more of a description here...
> * </p>
> * <!-- end-user-doc -->
> * @return the value of the '<em>Value</em>' attribute.
> * @see #setValue(String)
> * @see
> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
> * @model annotation="teneo.jpa appinfo='@Column(length=500)'"
> * @generated
> */
> String getValue();
>
> Here is the generated mapping file for the same:
> <property name="value" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`VALUE`"/>
> </property>
>
> Please tell me if I am missing something.
>
> Regards
> Phaneesh
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:fbe1m9$a8q$1@build.eclipse.org...
>> Hi Phaneesh,
>> The first method you tried did not follow the format (source should be
>> teneo.jpa, key should be value) as described here:
>> http://www.elver.org/hibernate/ejb3_format.html
>>
>> Your second method won't work with Teneo, tou have to set the annotation
>> in the ecore model (or xsd) or in a separate xml file (see also the link
>> noted above).
>>
>> gr. Martin
>>
>> Phaneesh wrote:
>>> Hi,
>>>
>>> I am trying to use the column annotation to change the length. The
>>> attribute datatype is EString and the Class that has this attribute is in
>>> a sub-package. I tried the model annotation. Through the generated code
>>> has the annotation it is not getting picked up. The column length remains
>>> the same. I also tries to use the JPA annotation directly on the getter
>>> method for that attribute. This also has no effect.
>>> Here is the details of methods that I have tried.
>>> 1. Model Annotation:
>>> Source : http://annotation.elver.org/Column
>>> Key: length
>>> Value: 500
>>>
>>> In the generated code I see this:
>>> /**
>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>> * <!-- begin-user-doc -->
>>> * <p>
>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>> * there really should be more of a description here...
>>> * </p>
>>> * <!-- end-user-doc -->
>>> * @return the value of the '<em>Value</em>' attribute.
>>> * @see #setValue(String)
>>> * @see
>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>> * @model annotation="http://annotation.elver.org/Column length='500'"
>>> * @generated
>>> */
>>> String getValue();
>>>
>>> 2. JPA annotation
>>> /**
>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>> * <!-- begin-user-doc -->
>>> * <p>
>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>> * there really should be more of a description here...
>>> * </p>
>>> * <!-- end-user-doc -->
>>> * @return the value of the '<em>Value</em>' attribute.
>>> * @see #setValue(String)
>>> * @see
>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>> */
>>> @Column(length=500)
>>> String getValue();
>>>
>>> Both of these methods fail to change the column length. Please help me in
>>> resolving this issue.
>>>
>>> Regards
>>> Phaneesh
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> 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
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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

--------------070501080601070404000102
Content-Type: text/xml;
name="column.ecore"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="column.ecore"

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="column"
nsURI=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/col umn" nsPrefix="column">
<eClassifiers xsi:type="ecore:EClass" name="Book">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Table(name=&quot;mybooktable&quot;)"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="Book"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title" unique="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Column(name=&quot;titel&quot; unique=&quot;true&quot; length=&quot;25&quot;)"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="title"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="pages" unique="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Column(updatable=&quot;false&quot; insertable=&quot;false&quot;)"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="pages"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="weight" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Decimal">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Column(name=&quot;gewicht&quot; nullable=&quot;true&quot; precision=&quot;5&quot; scale=&quot;2&quot;)"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="weight"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="author" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="author"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>

--------------070501080601070404000102--
Re: Teneo/Hibernate Column Annotation Column [message #609634 is a reply to message #95617] Mon, 03 September 2007 14:46 Go to previous message
Phaneesh is currently offline PhaneeshFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

Thanks for the update. I was using a single quote in the annotation.
Instead of @Column(length=500) I was using @Column(length='500').
Now it is working!!. The hibernate mapping file has the length attribute set
to the target column. But, the problem now is the schema is not getting
updated.
I have hibernate.hbm2ddl.auto = update in hbernate configuration, and in
teneo config I have set teneo.runtime.update_schema=true. But the table is
not getting updated in the database. I am using oracle 10 database. If I
change the hibernate.hbm2ddl.auto to create and then run it on a new schema
the column length is set to the desired value. May be there is a sync issue.
Please tell me whether I have set any other option in teneo?
Regards

Phaneesh




"Martin Taal" <mtaal@elver.org> wrote in message
news:fbgjf0$snn$1@build.eclipse.org...
> Hi Phaneesh,
> I have attached the ecore file which is used (in Teneo) as a testcase for
> the column annotation.
> This works for Teneo. Can you check if you have specified the annotation
> in the same way (in the
> ecore file or xsd)?
>
> gr. Martin
>
> Phaneesh wrote:
>> Hi Martin,
>>
>> I tried source=teneo.jpa and value=@Column(length=500) and
>> source=teneo.jpa
>> appinfo=@Column(length=500) both these have no effect on the teneo
>> created
>> hibernate mapping file. It does not put the length attribute to the
>> target
>> column.
>>
>> The generated model code in both cases:
>> 1. Source=teneo.jpa and value=@Column(length=500)
>> /**
>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>> * <!-- begin-user-doc -->
>> * <p>
>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>> * there really should be more of a description here...
>> * </p>
>> * <!-- end-user-doc -->
>> * @return the value of the '<em>Value</em>' attribute.
>> * @see #setValue(String)
>> * @see
>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>> * @model annotation="teneo.jpa value='@Column(length=500)'"
>> * @generated
>> */
>> String getValue();
>>
>> 2. Source=teneo.jpa and appinfo=@Column(length=500)
>> /**
>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>> * <!-- begin-user-doc -->
>> * <p>
>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>> * there really should be more of a description here...
>> * </p>
>> * <!-- end-user-doc -->
>> * @return the value of the '<em>Value</em>' attribute.
>> * @see #setValue(String)
>> * @see
>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>> * @model annotation="teneo.jpa appinfo='@Column(length=500)'"
>> * @generated
>> */
>> String getValue();
>>
>> Here is the generated mapping file for the same:
>> <property name="value" lazy="false" insert="true" update="true"
>> not-null="false" unique="false" type="java.lang.String">
>> <column not-null="false" unique="false" name="`VALUE`"/>
>> </property>
>>
>> Please tell me if I am missing something.
>>
>> Regards
>> Phaneesh
>>
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:fbe1m9$a8q$1@build.eclipse.org...
>>> Hi Phaneesh,
>>> The first method you tried did not follow the format (source should be
>>> teneo.jpa, key should be value) as described here:
>>> http://www.elver.org/hibernate/ejb3_format.html
>>>
>>> Your second method won't work with Teneo, tou have to set the annotation
>>> in the ecore model (or xsd) or in a separate xml file (see also the link
>>> noted above).
>>>
>>> gr. Martin
>>>
>>> Phaneesh wrote:
>>>> Hi,
>>>>
>>>> I am trying to use the column annotation to change the length. The
>>>> attribute datatype is EString and the Class that has this attribute is
>>>> in
>>>> a sub-package. I tried the model annotation. Through the generated code
>>>> has the annotation it is not getting picked up. The column length
>>>> remains
>>>> the same. I also tries to use the JPA annotation directly on the getter
>>>> method for that attribute. This also has no effect.
>>>> Here is the details of methods that I have tried.
>>>> 1. Model Annotation:
>>>> Source : http://annotation.elver.org/Column
>>>> Key: length
>>>> Value: 500
>>>>
>>>> In the generated code I see this:
>>>> /**
>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>> * <!-- begin-user-doc -->
>>>> * <p>
>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>> * there really should be more of a description here...
>>>> * </p>
>>>> * <!-- end-user-doc -->
>>>> * @return the value of the '<em>Value</em>' attribute.
>>>> * @see #setValue(String)
>>>> * @see
>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>> * @model annotation="http://annotation.elver.org/Column length='500'"
>>>> * @generated
>>>> */
>>>> String getValue();
>>>>
>>>> 2. JPA annotation
>>>> /**
>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>> * <!-- begin-user-doc -->
>>>> * <p>
>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>> * there really should be more of a description here...
>>>> * </p>
>>>> * <!-- end-user-doc -->
>>>> * @return the value of the '<em>Value</em>' attribute.
>>>> * @see #setValue(String)
>>>> * @see
>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>> */
>>>> @Column(length=500)
>>>> String getValue();
>>>>
>>>> Both of these methods fail to change the column length. Please help me
>>>> in
>>>> resolving this issue.
>>>>
>>>> Regards
>>>> Phaneesh
>>>
>>> --
>>>
>>> With Regards, Martin Taal
>>>
>>> Springsite/Elver.org
>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>> The Netherlands
>>> 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
>>
>>
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> 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
>


------------------------------------------------------------ --------------------


> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="column"
> nsURI=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/col umn"
> nsPrefix="column">
> <eClassifiers xsi:type="ecore:EClass" name="Book">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Table(name=&quot;mybooktable&quot;)"/>
> </eAnnotations>
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="Book"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="title"
> unique="false" lowerBound="1"
> eType="ecore:EDataType
> http://www.eclipse.org/emf/2003/XMLType#//String">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Column(name=&quot;titel&quot;
> unique=&quot;true&quot; length=&quot;25&quot;)"/>
> </eAnnotations>
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="title"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="pages"
> unique="false" lowerBound="1"
> eType="ecore:EDataType
> http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Column(updatable=&quot;false&quot;
> insertable=&quot;false&quot;)"/>
> </eAnnotations>
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="pages"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="weight"
> unique="false"
> lowerBound="1" eType="ecore:EDataType
> http://www.eclipse.org/emf/2003/XMLType#//Decimal">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Column(name=&quot;gewicht&quot;
> nullable=&quot;true&quot; precision=&quot;5&quot; scale=&quot;2&quot;)"/>
> </eAnnotations>
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="weight"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="author"
> unique="false"
> lowerBound="1" eType="ecore:EDataType
> http://www.eclipse.org/emf/2003/XMLType#//String">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="author"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> </ecore:EPackage>
>
Re: Teneo/Hibernate Column Annotation Column [message #609636 is a reply to message #95747] Mon, 03 September 2007 17:48 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Phaneesh
I don't think that this has to do with Teneo but more with how hibernate updates the schema. For
example my experience is that new indexes are also only added in a create mode. So it seems to be a
hibernate 'feature'.

gr. Martin

Phaneesh wrote:
> Hi Martin,
>
> Thanks for the update. I was using a single quote in the annotation.
> Instead of @Column(length=500) I was using @Column(length='500').
> Now it is working!!. The hibernate mapping file has the length attribute set
> to the target column. But, the problem now is the schema is not getting
> updated.
> I have hibernate.hbm2ddl.auto = update in hbernate configuration, and in
> teneo config I have set teneo.runtime.update_schema=true. But the table is
> not getting updated in the database. I am using oracle 10 database. If I
> change the hibernate.hbm2ddl.auto to create and then run it on a new schema
> the column length is set to the desired value. May be there is a sync issue.
> Please tell me whether I have set any other option in teneo?
> Regards
>
> Phaneesh
>
>
>
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:fbgjf0$snn$1@build.eclipse.org...
>> Hi Phaneesh,
>> I have attached the ecore file which is used (in Teneo) as a testcase for
>> the column annotation.
>> This works for Teneo. Can you check if you have specified the annotation
>> in the same way (in the
>> ecore file or xsd)?
>>
>> gr. Martin
>>
>> Phaneesh wrote:
>>> Hi Martin,
>>>
>>> I tried source=teneo.jpa and value=@Column(length=500) and
>>> source=teneo.jpa
>>> appinfo=@Column(length=500) both these have no effect on the teneo
>>> created
>>> hibernate mapping file. It does not put the length attribute to the
>>> target
>>> column.
>>>
>>> The generated model code in both cases:
>>> 1. Source=teneo.jpa and value=@Column(length=500)
>>> /**
>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>> * <!-- begin-user-doc -->
>>> * <p>
>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>> * there really should be more of a description here...
>>> * </p>
>>> * <!-- end-user-doc -->
>>> * @return the value of the '<em>Value</em>' attribute.
>>> * @see #setValue(String)
>>> * @see
>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>> * @model annotation="teneo.jpa value='@Column(length=500)'"
>>> * @generated
>>> */
>>> String getValue();
>>>
>>> 2. Source=teneo.jpa and appinfo=@Column(length=500)
>>> /**
>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>> * <!-- begin-user-doc -->
>>> * <p>
>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>> * there really should be more of a description here...
>>> * </p>
>>> * <!-- end-user-doc -->
>>> * @return the value of the '<em>Value</em>' attribute.
>>> * @see #setValue(String)
>>> * @see
>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>> * @model annotation="teneo.jpa appinfo='@Column(length=500)'"
>>> * @generated
>>> */
>>> String getValue();
>>>
>>> Here is the generated mapping file for the same:
>>> <property name="value" lazy="false" insert="true" update="true"
>>> not-null="false" unique="false" type="java.lang.String">
>>> <column not-null="false" unique="false" name="`VALUE`"/>
>>> </property>
>>>
>>> Please tell me if I am missing something.
>>>
>>> Regards
>>> Phaneesh
>>>
>>> "Martin Taal" <mtaal@elver.org> wrote in message
>>> news:fbe1m9$a8q$1@build.eclipse.org...
>>>> Hi Phaneesh,
>>>> The first method you tried did not follow the format (source should be
>>>> teneo.jpa, key should be value) as described here:
>>>> http://www.elver.org/hibernate/ejb3_format.html
>>>>
>>>> Your second method won't work with Teneo, tou have to set the annotation
>>>> in the ecore model (or xsd) or in a separate xml file (see also the link
>>>> noted above).
>>>>
>>>> gr. Martin
>>>>
>>>> Phaneesh wrote:
>>>>> Hi,
>>>>>
>>>>> I am trying to use the column annotation to change the length. The
>>>>> attribute datatype is EString and the Class that has this attribute is
>>>>> in
>>>>> a sub-package. I tried the model annotation. Through the generated code
>>>>> has the annotation it is not getting picked up. The column length
>>>>> remains
>>>>> the same. I also tries to use the JPA annotation directly on the getter
>>>>> method for that attribute. This also has no effect.
>>>>> Here is the details of methods that I have tried.
>>>>> 1. Model Annotation:
>>>>> Source : http://annotation.elver.org/Column
>>>>> Key: length
>>>>> Value: 500
>>>>>
>>>>> In the generated code I see this:
>>>>> /**
>>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>>> * <!-- begin-user-doc -->
>>>>> * <p>
>>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>>> * there really should be more of a description here...
>>>>> * </p>
>>>>> * <!-- end-user-doc -->
>>>>> * @return the value of the '<em>Value</em>' attribute.
>>>>> * @see #setValue(String)
>>>>> * @see
>>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>>> * @model annotation="http://annotation.elver.org/Column length='500'"
>>>>> * @generated
>>>>> */
>>>>> String getValue();
>>>>>
>>>>> 2. JPA annotation
>>>>> /**
>>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>>> * <!-- begin-user-doc -->
>>>>> * <p>
>>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>>> * there really should be more of a description here...
>>>>> * </p>
>>>>> * <!-- end-user-doc -->
>>>>> * @return the value of the '<em>Value</em>' attribute.
>>>>> * @see #setValue(String)
>>>>> * @see
>>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>>> */
>>>>> @Column(length=500)
>>>>> String getValue();
>>>>>
>>>>> Both of these methods fail to change the column length. Please help me
>>>>> in
>>>>> resolving this issue.
>>>>>
>>>>> Regards
>>>>> Phaneesh
>>>> --
>>>>
>>>> With Regards, Martin Taal
>>>>
>>>> Springsite/Elver.org
>>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>>> The Netherlands
>>>> 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
>>>
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> 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
>>
>
>
> ------------------------------------------------------------ --------------------
>
>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <ecore:EPackage xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="column"
>> nsURI=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/col umn"
>> nsPrefix="column">
>> <eClassifiers xsi:type="ecore:EClass" name="Book">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Table(name=&quot;mybooktable&quot;)"/>
>> </eAnnotations>
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value="Book"/>
>> <details key="kind" value="elementOnly"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="title"
>> unique="false" lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Column(name=&quot;titel&quot;
>> unique=&quot;true&quot; length=&quot;25&quot;)"/>
>> </eAnnotations>
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="title"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="pages"
>> unique="false" lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Column(updatable=&quot;false&quot;
>> insertable=&quot;false&quot;)"/>
>> </eAnnotations>
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="pages"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="weight"
>> unique="false"
>> lowerBound="1" eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//Decimal">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Column(name=&quot;gewicht&quot;
>> nullable=&quot;true&quot; precision=&quot;5&quot; scale=&quot;2&quot;)"/>
>> </eAnnotations>
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="weight"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="author"
>> unique="false"
>> lowerBound="1" eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="author"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> </ecore:EPackage>
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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/Hibernate Column Annotation Column [message #609637 is a reply to message #95781] Tue, 04 September 2007 03:30 Go to previous message
Phaneesh is currently offline PhaneeshFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Martin,

Thanks for the info. Infact the hibernate schema updates happens only for
new objects that gets added and for new/changed relationships. Hibernate FAQ
itself says schema update tool comes with no warranties. Here is the link
which gives more info on Hibernate SchemaUpdate Tool.
http://www.hibernate.org/119.html#A9
Once again thanks for all the help. My life would have been a real hell
without without Teneo. Teneo really rocks!!

Regards
Phaneesh

"Martin Taal" <mtaal@elver.org> wrote in message
news:fbhhe0$rr6$1@build.eclipse.org...
> Hi Phaneesh
> I don't think that this has to do with Teneo but more with how hibernate
> updates the schema. For example my experience is that new indexes are also
> only added in a create mode. So it seems to be a hibernate 'feature'.
>
> gr. Martin
>
> Phaneesh wrote:
>> Hi Martin,
>>
>> Thanks for the update. I was using a single quote in the annotation.
>> Instead of @Column(length=500) I was using @Column(length='500').
>> Now it is working!!. The hibernate mapping file has the length attribute
>> set to the target column. But, the problem now is the schema is not
>> getting updated.
>> I have hibernate.hbm2ddl.auto = update in hbernate configuration, and in
>> teneo config I have set teneo.runtime.update_schema=true. But the table
>> is not getting updated in the database. I am using oracle 10 database. If
>> I change the hibernate.hbm2ddl.auto to create and then run it on a new
>> schema the column length is set to the desired value. May be there is a
>> sync issue. Please tell me whether I have set any other option in teneo?
>> Regards
>>
>> Phaneesh
>>
>>
>>
>>
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:fbgjf0$snn$1@build.eclipse.org...
>>> Hi Phaneesh,
>>> I have attached the ecore file which is used (in Teneo) as a testcase
>>> for the column annotation.
>>> This works for Teneo. Can you check if you have specified the annotation
>>> in the same way (in the
>>> ecore file or xsd)?
>>>
>>> gr. Martin
>>>
>>> Phaneesh wrote:
>>>> Hi Martin,
>>>>
>>>> I tried source=teneo.jpa and value=@Column(length=500) and
>>>> source=teneo.jpa
>>>> appinfo=@Column(length=500) both these have no effect on the teneo
>>>> created
>>>> hibernate mapping file. It does not put the length attribute to the
>>>> target
>>>> column.
>>>>
>>>> The generated model code in both cases:
>>>> 1. Source=teneo.jpa and value=@Column(length=500)
>>>> /**
>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>> * <!-- begin-user-doc -->
>>>> * <p>
>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>> * there really should be more of a description here...
>>>> * </p>
>>>> * <!-- end-user-doc -->
>>>> * @return the value of the '<em>Value</em>' attribute.
>>>> * @see #setValue(String)
>>>> * @see
>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>> * @model annotation="teneo.jpa value='@Column(length=500)'"
>>>> * @generated
>>>> */
>>>> String getValue();
>>>>
>>>> 2. Source=teneo.jpa and appinfo=@Column(length=500)
>>>> /**
>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>> * <!-- begin-user-doc -->
>>>> * <p>
>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>> * there really should be more of a description here...
>>>> * </p>
>>>> * <!-- end-user-doc -->
>>>> * @return the value of the '<em>Value</em>' attribute.
>>>> * @see #setValue(String)
>>>> * @see
>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>> * @model annotation="teneo.jpa appinfo='@Column(length=500)'"
>>>> * @generated
>>>> */
>>>> String getValue();
>>>>
>>>> Here is the generated mapping file for the same:
>>>> <property name="value" lazy="false" insert="true" update="true"
>>>> not-null="false" unique="false" type="java.lang.String">
>>>> <column not-null="false" unique="false" name="`VALUE`"/>
>>>> </property>
>>>>
>>>> Please tell me if I am missing something.
>>>>
>>>> Regards
>>>> Phaneesh
>>>>
>>>> "Martin Taal" <mtaal@elver.org> wrote in message
>>>> news:fbe1m9$a8q$1@build.eclipse.org...
>>>>> Hi Phaneesh,
>>>>> The first method you tried did not follow the format (source should be
>>>>> teneo.jpa, key should be value) as described here:
>>>>> http://www.elver.org/hibernate/ejb3_format.html
>>>>>
>>>>> Your second method won't work with Teneo, tou have to set the
>>>>> annotation
>>>>> in the ecore model (or xsd) or in a separate xml file (see also the
>>>>> link
>>>>> noted above).
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Phaneesh wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am trying to use the column annotation to change the length. The
>>>>>> attribute datatype is EString and the Class that has this attribute
>>>>>> is in
>>>>>> a sub-package. I tried the model annotation. Through the generated
>>>>>> code
>>>>>> has the annotation it is not getting picked up. The column length
>>>>>> remains
>>>>>> the same. I also tries to use the JPA annotation directly on the
>>>>>> getter
>>>>>> method for that attribute. This also has no effect.
>>>>>> Here is the details of methods that I have tried.
>>>>>> 1. Model Annotation:
>>>>>> Source : http://annotation.elver.org/Column
>>>>>> Key: length
>>>>>> Value: 500
>>>>>>
>>>>>> In the generated code I see this:
>>>>>> /**
>>>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>>>> * <!-- begin-user-doc -->
>>>>>> * <p>
>>>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>>>> * there really should be more of a description here...
>>>>>> * </p>
>>>>>> * <!-- end-user-doc -->
>>>>>> * @return the value of the '<em>Value</em>' attribute.
>>>>>> * @see #setValue(String)
>>>>>> * @see
>>>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>>>> * @model annotation="http://annotation.elver.org/Column
>>>>>> length='500'"
>>>>>> * @generated
>>>>>> */
>>>>>> String getValue();
>>>>>>
>>>>>> 2. JPA annotation
>>>>>> /**
>>>>>> * Returns the value of the '<em><b>Value</b></em>' attribute.
>>>>>> * <!-- begin-user-doc -->
>>>>>> * <p>
>>>>>> * If the meaning of the '<em>Value</em>' attribute isn't clear,
>>>>>> * there really should be more of a description here...
>>>>>> * </p>
>>>>>> * <!-- end-user-doc -->
>>>>>> * @return the value of the '<em>Value</em>' attribute.
>>>>>> * @see #setValue(String)
>>>>>> * @see
>>>>>> org.eclipse.hyades.models.common.interactions.Common_Behavio r_InteractionsPackage#getBVRArgument_Value()
>>>>>> */
>>>>>> @Column(length=500)
>>>>>> String getValue();
>>>>>>
>>>>>> Both of these methods fail to change the column length. Please help
>>>>>> me in
>>>>>> resolving this issue.
>>>>>>
>>>>>> Regards
>>>>>> Phaneesh
>>>>> --
>>>>>
>>>>> With Regards, Martin Taal
>>>>>
>>>>> Springsite/Elver.org
>>>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>>>> The Netherlands
>>>>> 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
>>>>
>>>
>>> --
>>>
>>> With Regards, Martin Taal
>>>
>>> Springsite/Elver.org
>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>> The Netherlands
>>> 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
>>>
>>
>>
>> ------------------------------------------------------------ --------------------
>>
>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <ecore:EPackage xmi:version="2.0"
>>> xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="column"
>>>
>>> nsURI=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/col umn"
>>> nsPrefix="column">
>>> <eClassifiers xsi:type="ecore:EClass" name="Book">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo"
>>> value="@Table(name=&quot;mybooktable&quot;)"/>
>>> </eAnnotations>
>>> <eAnnotations
>>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>>> <details key="name" value="Book"/>
>>> <details key="kind" value="elementOnly"/>
>>> </eAnnotations>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="title"
>>> unique="false" lowerBound="1"
>>> eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2003/XMLType#//String">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@Column(name=&quot;titel&quot;
>>> unique=&quot;true&quot; length=&quot;25&quot;)"/>
>>> </eAnnotations>
>>> <eAnnotations
>>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>>> <details key="kind" value="element"/>
>>> <details key="name" value="title"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="pages"
>>> unique="false" lowerBound="1"
>>> eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@Column(updatable=&quot;false&quot;
>>> insertable=&quot;false&quot;)"/>
>>> </eAnnotations>
>>> <eAnnotations
>>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>>> <details key="kind" value="element"/>
>>> <details key="name" value="pages"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="weight"
>>> unique="false"
>>> lowerBound="1" eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2003/XMLType#//Decimal">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@Column(name=&quot;gewicht&quot;
>>> nullable=&quot;true&quot; precision=&quot;5&quot;
>>> scale=&quot;2&quot;)"/>
>>> </eAnnotations>
>>> <eAnnotations
>>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>>> <details key="kind" value="element"/>
>>> <details key="name" value="weight"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="author"
>>> unique="false"
>>> lowerBound="1" eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2003/XMLType#//String">
>>> <eAnnotations
>>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>>> <details key="kind" value="element"/>
>>> <details key="name" value="author"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> </eClassifiers>
>>> </ecore:EPackage>
>>>
>>
>>
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> 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:[CDO][0.8.0] Information about development
Next Topic:Re: Web-Frontend for EMF models
Goto Forum:
  


Current Time: Fri Aug 19 11:43:36 GMT 2022

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

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

Back to the top