- Original Message -
From: "Konstantin Priblouda" <[EMAIL PROTECTED]>
To: "Mauro Sergio Silva" <[EMAIL PROTECTED]>
Sent: Tuesday, December 16, 2003 9:07 AM
Subject: Re: [Hibernate] Xdoclet stuffs...
>
> --- Mauro Sergio Silva <[EMAIL PROTECTED]>
> wrote:
> > Hi Konstantin
>
> Hi Mario,
> I think we shall move this tread to hibernate forum.
> As you may see, we discussing this off the list, and
> hibernate folks can not correct us.
>
> ( I'm already discussing xdoclet stuff there )
>
>
> > - Original Message -
> > From: "Konstantin Priblouda" <[EMAIL PROTECTED]>
> > To: "Mauro Sergio Silva" <[EMAIL PROTECTED]>
> > Sent: Monday, December 15, 2003 11:55 AM
> > Subject: Re: [Hibernate] Xdoclet stuffs...
> >
> >
> > >
> > > --- Mauro Sergio Silva <[EMAIL PROTECTED]>
> > > wrote:
> > > > Sorry, I was thinking that it was an answer from
> > > > Hibernate-devel list(couse
> > > > the text appended in your e-mail)
> > >
> > > Yes it was. But I happen to be xdoclet comiter,
> > and
> > > I'm working on xdoclet2 plugin right now...
> > >
> > > > I think the confusion is couse the coment in
> > > > hibernate dtd.
> > >
> > > It's in deed somehow confusing...
> > >
> > > > The column element that could be placed in
> > propertys
> > > > and ids is the only
> > > > place where I could use the sql-type attribute.
> > > > Hibernate has a tool called schemaexport that
> > reads
> > > > the hbm.xmls and
> > > > generate the schema of your database using those
> > > > informations, there is
> > > > other tool called schema update that generate
> > the
> > > > update of your schema
> > > > based in jdbc metada. If you want to custumize
> > the
> > > > ddl generated based in
> > > > your mapping files you culd put some
> > informations in
> > > > your
> > > > schema like sql-type to custumize the generated
> > ddl.
> > > >
> > > > For example if you declare your id as an string
> > the
> > > > schemaexport will
> > > > generate your id as a varchar[255] for mysql
> > > > dialect. But if you use the
> > > > column element inside the id element and specify
> > the
> > > > sql-type attribute as
> > > > char[32], for example) the schema exprot will
> > > > generate your id column as a
> > > > varchar[32] for mysql dialect that is the right
> > > > column lenght to uuid.hex
> > > > ( 32 lenght id).
> > >
> > >
> > > I do not know much about schemaexport. But column
> > > elements are somehow tricky, and not well
> > supported by
> > > xdoclet. For nested column elements we will have
> > to
> > > specify additional xdoclet tags ( for example like
> > > @hibernate.key-column or @hibernate.index-column
> > )
> > >
> > > And as those column sepcifications are required
> > only
> > > for composite keys, alternative would be to look
> > up
> > > class in question, and proces his ID properties...
> > > ( this is even more tricky, and this class is may
> > be
> > > not available as source... )
> > >
> > This is exactly the point where we desagree. You
> > sad that column
> > specification is required only for composite keys,
> > but
> > there is other two situations where column element
> > is used in mapping files,
> > in both situations the column is used
> > to the same porpuse to custumize the ddl. I will use
> > some examples in the
> > ReferenceDocumentation 2.1 of Hibernate
> > to ilustrate what I'm talking about (the PDF version
> > to be much precise). I
> > know that you are not a Hibernate developer I'm
> > using the reference just to clarify my example.
> >
> > First in page 4 Section 1.3 Mapping the cat in the
> > id element you culd see a
> > nested element column, custumizing the way
> > the ddl will be genertated. You culd see in this
> > example that the column
> > element culd be used in the id element, not in
> > composite key.
> >
> > In the page 5 you culd see the same use of column
> > element inside the
> > property for the same porpouse.
> >
> > In chapter 5 section 5.4 it talks about Custumizing
> > the DDL and it talks
> > about the use of column element iside a property.
> > You can see that
> > in the secon example it doesn't refeare about
> > sql-type attribute, couse if
> > you see in the dtd there is only one place where the
> > sql-type
> > attribute culd be used that is in the column
> > element.
> >
> > On chapter 18 section 18.1.1 custumizing the schema
> > page 116 again you culd
> > see some examples using the column element.
> >
> > In the version 1.2 b4 you culd use columns elemnts
> > in propertys to generate
> > mapping files like in the examples above becouse
> > the properties.xsd the column is merged inside
> > property and it generate the
> > column attribute or the column element if you use
> > the
> > the hibenate.property and hibernate.column in the
> > same method,it works fine.
> > What i did was patch the column.xsd and merged
> > it in the id element changind the hibernate.xsd too.
> >
> > The point is if it is possible to use the colun
> > inside id ant property