please review HHH-2962
by Julius Stroffek
Hi All,
I have attached a patch also with a test case for HHH-2962 and since I
do not have enough rights in JIRA to change the issue status from
'Awaiting Test Case' to something that people would have a notice on it,
I am posting a message to the list. Please review the patch and provide
some comments. Thanks.
Cheers
Julo
16 years, 10 months
Re: [hibernate-dev] annotation for adding column comments for hbm2doc - done!!
by Prasanna Kothandaraman
Hi all,
Today I made the relevant code changes in AnnotationBinder.java,
EJB3Column.java and table.ftl. Its worked like dream.Just I couldn't believe
myself.
Please take diff from the existing file and let me know your comments.
Sorry I could not send the diff.
Changes made:
Classs Name: EJB3Column.java
Methods: initMappingColumn,buildColumnFromAnnotation (with additional
parameter
String columncomment).
Class Name: AnnotationBinder.java
Methods: processElementAnnotations
Regards,
Prasanna
On 1/29/08, Prasanna Kothandaraman <prkothan(a)gmail.com> wrote:
>
> Hi all,
>
> Got the breakthru in problem I narrated in my earlier mail. Its because of
> my ignorance ;-).
>
> Column annotations are controlled via "XProperty property". Soon I should
> start thinking about presentation layer modifications.
>
> Please let me know if you have any inputs.
>
> Regards,
> Prasanna
>
>
> On 1/29/08, Prasanna Kothandaraman <prkothan(a)gmail.com> wrote:
> >
> > Hi all,
> >
> > I have done the following
> >
> > 1. Created org.hibernate.annotations.Column.java
> > (Well, I know its very minor task ;-) )
> >
> >
> > 2. Understood code flow from
> >
> > AnnotationConfiguration --> AnnotationBinder (bindClass and
> > EJB3Column.buildColumnFromAnnotation)-->
> > EntityBinder(processComplementaryTableDefinitions).
> >
> > 3. Specifically I understood how org.hibernate.annotations.Table(comment) works
> >
> >
> > Hence I tried to add column comment in similar fashion. The first hurdle
> > I am facing is, the ColumnAnnotation class is not available at bindClass().
> >
> >
> > Here the code:
> >
> > AnnotationBinder.java {
> >
> > ---
> > bindClass(..) {
> >
> > ----
> > ---
> >
> > //add process complementary Table definition (index & all)
> >
> > entityBinder.processComplementaryTableDefinitions(
> > annotatedClass.getAnnotation( org.hibernate.annotations.
> > Table.*class* ) );
> >
> > //Prasanna
> >
> > org.hibernate.annotations.
> > Table tablecomment = annotatedClass.getAnnotation(
> > org.hibernate.annotations.Table.*class* ) ;
> >
> > *if*(*null* == tablecomment)
> >
> > System.
> > *out*.println("Table annotation class not available");
> >
> > *else* *if*(*null*!=tablecomment && *null*!=tablecomment.comment())
> >
> > System.
> > *out*.println(" tablecomment :"+tablecomment.comment());
> >
> > *else*
> >
> > System.
> > *out*.println(" tablecomment not available");
> >
> > org.hibernate.annotations.
> > Column columncomment = annotatedClass.getAnnotation(
> > org.hibernate.annotations.Column.*class* ) ;
> >
> > *if*(*null* == columncomment)
> >
> > System.
> > *out*.println(" Column Annotation class not available");
> >
> > *else* *if*(*null* != columncomment && *null*!=columncomment.comment())
> >
> > System.
> > *out*.println(" columncomment :"+columncomment.comment());
> >
> > *else*
> >
> > System.
> > *out*.println(" column comment not available");
> >
> > entityBinder.processComplementaryTableDefinitions(
> > annotatedClass.getAnnotation( org.hibernate.annotations.
> > Tables.*class* ) );
> > }
> >
> >
> >
> > }
> >
> >
> >
> > Here I always get "Column Annotation class not available". But not so in
> > case in table annotation. It perfectly works.
> >
> > I tried adding Column Annotation class using AnnotationConfiguration -->
> > addAnnotatedClass(..). But it didn't worked.
> >
> > Please see the attachment for the relevant files.
> > Regards,
> > Prasanna
> >
> >
> >
> >
> > On 1/28/08, Emmanuel Bernard <emmanuel(a)hibernate.org> wrote:
> > >
> > > While not strictly useful for the comment feature, I want to add a
> > > @ColumnOrFormula annotation to be able to support mixing formula and
> > > columns in a user type (and a FK definition). Let's say it's a
> > > lightly correlated feature.
> > >
> > > On Jan 27, 2008, at 19:17, Oliver B. Fischer wrote:
> > >
> > > > Hello,
> > > >
> > > > I am also still interessted in contributing to this enhancement, but
> > > > didn't find enough time until now.
> > > >
> > > > Emmanuel, in your comment on ANN-537, you suggested an
> > > > @ColumnOrFormula annotation. Could you explain your idea a little
> > > bit
> > > > more?
> > > >
> > > > Prasanna, may we can share the work on this?
> > > >
> > > > Bye,
> > > >
> > > > Oliver
> > > >
> > > > Prasanna Kothandaraman schrieb:
> > > >> Hi,
> > > >> I am looking for annotation to add column comments specifically
> > > >> for documentation (hbm2doc). I understand that there is no support
> > > >> for this currently.
> > > >> http://opensource.atlassian.com/projects/hibernate/browse/ANN-537
> > > >> I am interested in contributing towards this.
> > > >> I had hard look at the source code (especially
> > > >> AnnotationBinder.java, EJB3Column.java etc, table.ftl,
> > > >> DocExporter.java), but still I could not figure how to provide
> > > >> this support.
> > > >> Please let me know how many days it will take.
> > > >> I have more than 8 years of Java development experience, and I
> > > >> can pickup things quickly. Please guide me.
> > > >> Thanks & Regards,
> > > >> Prasanna
> > > >>
> > > >>
> > > ---------------------------------------------------------------------
> > > >> ---
> > > >> _______________________________________________
> > > >> hibernate-dev mailing list
> > > >> hibernate-dev(a)lists.jboss.org
> > > >> https://lists.jboss.org/mailman/listinfo/hibernate-dev
> > > >
> > > > --
> > > > Oliver B. Fischer Tel. +49 (0)30 44 79 32 51
> > > > Schönhauser Allee 64 Mobil: +49 (0)178 7903538
> > > > D-10437 Berlin mailto:o.b.fischer@gmx.de
> > > >
> > > > _______________________________________________
> > > > hibernate-dev mailing list
> > > > hibernate-dev(a)lists.jboss.org
> > > > https://lists.jboss.org/mailman/listinfo/hibernate-dev
> > >
> > >
> >
> >
>
16 years, 10 months
annotation for adding column comments for hbm2doc
by Prasanna Kothandaraman
Hi,
I am looking for annotation to add column comments specifically for
documentation (hbm2doc). I understand that there is no support for this
currently.
http://opensource.atlassian.com/projects/hibernate/browse/ANN-537
I am interested in contributing towards this.
I had hard look at the source code (especially AnnotationBinder.java,
EJB3Column.java etc, table.ftl, DocExporter.java), but still I could not
figure how to provide this support.
Please let me know how many days it will take.
I have more than 8 years of Java development experience, and I can pickup
things quickly. Please guide me.
Thanks & Regards,
Prasanna
16 years, 10 months
uppercase support in like Expressions
by andrea tomassi
Hi,
first of all please excuse me for my poor english.
i am a java developer, and i'm using hibernate to implement persistence.
Using Expression.ilike method i had some compatibility problem becouse of
the fixed behaviour of converting fields to lowercase.
So i modified org.hibernate.Criteria.LikeExpression and also
org.hibernate.Criteria.LikeExpressionIlikeExpression classes, to implement
the possibility of choosing the preferred converting mode:
either uppercase or lowercase.
So what i obtained is something like this:
CLASS: org.hibernate.Criteria.IlikeExpression
....
@Deprecated
protected IlikeExpression(String propertyName, String value, MatchMode
matchMode) {
this( propertyName, matchMode.toMatchString(value),
CONVERT_MODE_LOWER_CASE);
}
protected IlikeExpression(String propertyName, String value, MatchMode
matchMode, int CONVERT_MODE) {
this( propertyName, matchMode.toMatchString(value), CONVERT_MODE);
}
....
CLASS: org.hibernate.Criteria.LikeExpression
protected LikeExpression(String propertyName, String value,
MatchMode matchMode, Character escapeChar, boolean ignoreCase,
int CONVERT_MODE) {
this(propertyName, matchMode.toMatchString(value), escapeChar,
ignoreCase, CONVERT_MODE);
}
@Deprecated
protected LikeExpression(String propertyName, String value,
MatchMode matchMode, Character escapeChar, boolean ignoreCase) {
this(propertyName, matchMode.toMatchString(value), escapeChar,
ignoreCase, LikeExpression.CONVERT_MODE_LOWER_CASE);
}
both solutions are compatible with the old behaviour, but now i can choose
between uppercase or lowercse convertion.
If you think this could be a correct approach to this problem, please answer
me and i will give you the whole source code reguarding the modify.
Thanks for your attention.
Best Regards
--
Andrea Tomassi
16 years, 10 months
Re: [hibernate-dev] Can't get trunk version to build
by Steve Ebersole
Argh. Somehow the parent pom got published incorrectly to the JBoss
maven repo. I do not have time to fix this right now.
For the time being grab the parent pom from svn and "install" it
locally on your box.
On Jan 29, 2008, at 8:39 AM, Matthew Fleming wrote:
> I haven't modified any of the files in source-- I just did a check
> out, then tried to build. Attached is the core pom.
>
> -Matt
> <pom.xml>
> On Jan 29, 2008, at 6:20 AM, Steve Ebersole wrote:
>
>> Oddly enough those are all set in the dependencyManagement section
>> of the parent pom. Did you change the core pom to not reference
>> the parent?
>>
>>
>> On Jan 28, 2008, at 1:44 PM, Matthew Fleming wrote:
>>
>>> I'm using maven 2.0.8. Here's what I get when I attempt to run:
>>> mvn package
>>> [INFO] Scanning for projects...
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [ERROR] FATAL ERROR
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] Error building POM (may not be this project's POM).
>>>
>>>
>>> Project ID: org.hibernate:hibernate-core
>>> POM Location: /Users/matt/Documents/development/java/hibernate/
>>> core/pom.xml
>>> Validation Messages:
>>>
>>> [0] 'dependencies.dependency.version' is missing for commons-
>>> collections:commons-collections
>>> [1] 'dependencies.dependency.version' is missing for dom4j:dom4j
>>> [2] 'dependencies.dependency.version' is missing for antlr:antlr
>>>
>>>
>>> Reason: Failed to validate POM for project org.hibernate:hibernate-
>>> core
>>>
>>> Any ideas?
>>>
>>> -Matt
>>> _______________________________________________
>>> hibernate-dev mailing list
>>> hibernate-dev(a)lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>
>>
>> -----------------------------------------
>> Steve Ebersole
>>
>> Project Lead
>> http://hibernate.org
>> steve(a)hibernate.org
>>
>>
>>
>>
>>
>> --------------------------------
>> Spam/Virus scanning by CanIt Pro
>>
>> For more information see
>> http://www.kgbinternet.com/SpamFilter.htm
>>
>> To control your spam filter, log in at
>> http://filter.kgbinternet.com
>
-----------------------------------------
Steve Ebersole
Project Lead
http://hibernate.org
steve(a)hibernate.org
16 years, 10 months
Can't get trunk version to build
by Matthew Fleming
I'm using maven 2.0.8. Here's what I get when I attempt to run:
mvn package
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.hibernate:hibernate-core
POM Location: /Users/matt/Documents/development/java/hibernate/core/
pom.xml
Validation Messages:
[0] 'dependencies.dependency.version' is missing for commons-
collections:commons-collections
[1] 'dependencies.dependency.version' is missing for dom4j:dom4j
[2] 'dependencies.dependency.version' is missing for antlr:antlr
Reason: Failed to validate POM for project org.hibernate:hibernate-core
Any ideas?
-Matt
16 years, 10 months
CGLIBLazyInitializer and proxy= configuration
by Benjamin Lerman
Hi all,
The line 118 of CGLIBLazyInitializer is:
e.setSuperclass( interfaces.length == 1 ? persistentClass : null );
That means that, when a proxy="foo" is added on the hibernate
configuration, the proxy generated do not anymore extends the concrete
class.
Is there a particular reason for this ?
The reason I ask, is because in particular circumstances, I can have:
session.createQuery("FROM Foo").list()
returns a List of objects that are not of class Foo.
I change the line in question with:
e.setSuperclass(persistentClass)
and I can use my proxy as well as the expected base class in my code,
so I'd like to know why this is not the default comportment and what is
the disadvantage to always have the proxy extends the base class.
--
Benjamin LERMAN
16 years, 10 months
Dev. Environment for Hibernate Annotations
by Oliver B. Fischer
Hello,
I would like to setup an development environment for Annotations to
contribute ANN-537.
The build.xml of the doc directory references an property
hibernate-cvs.doc.reference, which seems to reference an checkout of
the annotations manual. Does someone know how to configure my
environment in such a way, that I am able to build the whole
Annotations distribution?
Bye,
Oliver
--
Oliver B. Fischer Tel. +49 (0)30 44 79 32 51
Schönhauser Allee 64 Mobil: +49 (0)178 7903538
D-10437 Berlin mailto:o.b.fischer@gmx.de
16 years, 11 months