- This topic has 7 replies, 4 voices, and was last updated 20 years, 5 months ago by
Robert Varga.
-
AuthorPosts
-
carlosmoraesMemberHi there.
Is it posible to map a “One table per class hierarchy” approach using the MyEclipse hibernate tool?
In case I’m not clear (my english maybe bad), here is how the mapping file looks (but I shouldn’t do this manually, right?):<hibernate-mapping package="com.carlosmoraes.hibernate"> <class name="Pessoa" table="PESSOA"> <id name="nupessoa" column="NUPESSOA" type="integer"> <generator class="identity"/> </id> <discriminator name="className" column="CLASS_NAME" type="string" /> <property name="nomepessoa" column="NOMEPESSOA" type="string" not-null="true" /> <property name="email" column="EMAIL" type="string" /> <property name="obs" column="OBS" type="serializable" /> <subclass name="PessoaFisica" discriminator-value="PF"> <property name="cpf" column="CPF" type="string" /> <property name="rg" column="RG" type="string" /> <property name="orgexp" column="ORGEXP" type="string" /> <property name="dtnasc" column="DTNASC" type="date" /> <property name="sexo" column="SEXO" type="string" /> </subclass> <subclass name="PessoaJuridica" discriminator-value="PJ"> <property name="nomeempresa" column="NOMEEMPRESA" type="string" /> <property name="razaosocial" column="RAZAOSOCIAL" type="string" /> <property name="cnpj" column="CNPJ" type="string" /> <property name="inscestadual" column="INSCESTADUAL" type="string" /> <property name="nomecontato" column="NOMECONTATO" type="integer" /> </subclass> <property name="dtcadastro" column="DTCADASTRO" type="date" /> <property name="dtultmod" column="DTULTMOD" type="date" /> <many-to-one name="conhecimento" column="CONHECIMENTO_FKNUCONHECIMENTO" class="Conhecimento" not-null="true" /> <many-to-one name="fone" column="FONE_FKNUFONE" class="Fone" not-null="true" /> <many-to-one name="estcivil" column="ESTCIVIL_FKNUESTCIVIL" class="Estcivil" not-null="true" /> <many-to-one name="endereco" column="ENDERECO_FKNUENDERECO" class="Endereco" not-null="true" /> </class> </hibernate-mapping>
Any ideas?
Thanks in advance,
Carlos
February 9, 2005 at 11:37 pm #224833
Riyad KallaMemberCarlos,
We don’t currently support class hierarchies like this, it would just map to one giant class… but I am double checking with the developer on this just incase I am wrong.February 9, 2005 at 11:44 pm #224834
carlosmoraesMemberAll right.
I’m trying to manage thing manually by now.Thanks for the reply.
February 10, 2005 at 4:42 pm #224935
support-jeffMemberMy master plan includes support for this kind of mapping (in fact, all three ways to map inheritance hierarchies), but it will probably not make the next major release (3.9?).
February 10, 2005 at 5:03 pm #224942
carlosmoraesMemberI hope you achieve this soon.
It would be great!Keep up the good work.
Best regards,
Carlos
February 14, 2005 at 1:26 pm #225114
Robert VargaParticipantMy master plan includes support for this kind of mapping (in fact, all three ways to map inheritance hierarchies), but it will probably not make the next major release (3.9?).
This is not a trivial request, since it needs info which can only be set manually. It might be worth looking at the Hibernate capabilities, if there are some other manually settable info already present? 🙂
Is there a doc on what it is currently capable of?
Regards,
Robert
February 14, 2005 at 5:13 pm #225150
support-jeffMemberrobert –
I am not following you on the first part of your message. Is there a question here?
As for documentation, the only docs available at this time are here:
http://www.myeclipseide.com/ContentExpress-display-ceid-61.html
These are very out of data. I did an update of them last year, but I do not know why the update has not been uploaded yet. I will have to check on that.February 15, 2005 at 7:33 am #225175
Robert VargaParticipant@support-jeff wrote:
robert –
I am not following you on the first part of your message. Is there a question here?
Not really… it was just a remark, that probably it is worth looking at it… 🙂
I thought it is just capable of generating some mapping from the database but no manual influence or intervention on it… But it might be otherwise… 🙂 Anyway an up-to-date documentation would be more than welcome…
Regards,
Robert Varga
-
AuthorPosts