| Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo/Hibernate Column Annotation Column
 Goto Forum:| 
| Teneo/Hibernate Column Annotation Column [message #95247] | Sat, 01 September 2007 04:00  |  | 
| Eclipse User  |  |  |  |  | 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 06:01   |  | 
| Eclipse User  |  |  |  |  | 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] | Sun, 02 September 2007 23:34   |  | 
| Eclipse User  |  |  |  |  | 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 05:17   |  | 
| Eclipse User  |  |  |  |  | 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="mybooktable")"/>
 </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="titel" unique="true" length="25")"/>
 </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="false" insertable="false")"/>
 </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="gewicht" nullable="true" precision="5" scale="2")"/>
 </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 10:46   |  | 
| Eclipse User  |  |  |  |  | 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="mybooktable")"/>
 >    </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="titel"
 > unique="true" length="25")"/>
 >      </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="false"
 > insertable="false")"/>
 >      </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="gewicht"
 > nullable="true" precision="5" scale="2")"/>
 >      </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 13:48   |  | 
| Eclipse User  |  |  |  |  | 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="mybooktable")"/>
 >>    </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="titel"
 >> unique="true" length="25")"/>
 >>      </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="false"
 >> insertable="false")"/>
 >>      </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="gewicht"
 >> nullable="true" precision="5" scale="2")"/>
 >>      </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] | Mon, 03 September 2007 23:30  |  | 
| Eclipse User  |  |  |  |  | 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="mybooktable")"/>
 >>>    </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="titel"
 >>> unique="true" length="25")"/>
 >>>      </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="false"
 >>> insertable="false")"/>
 >>>      </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="gewicht"
 >>> nullable="true" precision="5"
 >>> scale="2")"/>
 >>>      </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 06:01  |  | 
| Eclipse User  |  |  |  |  | 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] | Sun, 02 September 2007 23:34  |  | 
| Eclipse User  |  |  |  |  | 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 05:17  |  | 
| Eclipse User  |  |  |  |  | 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="mybooktable")"/>
 </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="titel" unique="true" length="25")"/>
 </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="false" insertable="false")"/>
 </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="gewicht" nullable="true" precision="5" scale="2")"/>
 </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 10:46  |  | 
| Eclipse User  |  |  |  |  | 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="mybooktable")"/>
 >    </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="titel"
 > unique="true" length="25")"/>
 >      </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="false"
 > insertable="false")"/>
 >      </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="gewicht"
 > nullable="true" precision="5" scale="2")"/>
 >      </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 13:48  |  | 
| Eclipse User  |  |  |  |  | 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="mybooktable")"/>
 >>    </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="titel"
 >> unique="true" length="25")"/>
 >>      </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="false"
 >> insertable="false")"/>
 >>      </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="gewicht"
 >> nullable="true" precision="5" scale="2")"/>
 >>      </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] | Mon, 03 September 2007 23:30  |  | 
| Eclipse User  |  |  |  |  | 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="mybooktable")"/>
 >>>    </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="titel"
 >>> unique="true" length="25")"/>
 >>>      </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="false"
 >>> insertable="false")"/>
 >>>      </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="gewicht"
 >>> nullable="true" precision="5"
 >>> scale="2")"/>
 >>>      </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
 |  |  |  | 
 
 
 Current Time: Fri Oct 31 05:54:07 EDT 2025 
 Powered by FUDForum . Page generated in 0.75577 seconds |