- This topic has 7 replies, 4 voices, and was last updated 19 years, 9 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
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.
carlosmoraesMemberAll right.
I’m trying to manage thing manually by now.Thanks for the reply.
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?).
carlosmoraesMemberI hope you achieve this soon.
It would be great!Keep up the good work.
Best regards,
Carlos
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
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.
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