# Reveng.hibernate.xml meta tag attributes are visible in hbm2java ftl templates for auto-generated @Embeddable class?

**URL:** <https://discourse.hibernate.org/t/reveng-hibernate-xml-meta-tag-attributes-are-visible-in-hbm2java-ftl-templates-for-auto-generated-embeddable-class/10623>\
**Category:** Hibernate Tools\
**Created:** [November 16, 2024, 5:17pm UTC](https://discourse.hibernate.org/t/reveng-hibernate-xml-meta-tag-attributes-are-visible-in-hbm2java-ftl-templates-for-auto-generated-embeddable-class/10623 "2024-11-16T17:17:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sisco70](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/sisco70/32/3608_2.png) [@sisco70](https://discourse.hibernate.org/u/sisco70)\
**Post date:** [November 16, 2024, 5:17pm UTC](https://discourse.hibernate.org/t/reveng-hibernate-xml-meta-tag-attributes-are-visible-in-hbm2java-ftl-templates-for-auto-generated-embeddable-class/10623/1 "2024-11-16T17:17:52Z")

</div>

Hello, everyone,

I am using reverse engineering Hibernate ( **hbm2java** ) via Maven and hibernate.reveng.xml.  
One of my tables has a primary key consisting of two fields.

I would like to add a custom annotation to one of these fields.

```auto
<table schema=“biva” name=“tbiv09_con_eve” class=“it.test.prod.entity.EventConnected”>
     <meta attribute=“test”>my value</meta>
</table>

```

Since I use the meta tag to customize the generation of my entity files, using modified ftl templates (taken from hibernate-tools-orm-X.X.x.Final.jar) I would have liked to do that here as well.

But unfortunately I have a problem, I can’t display or check for the presence of a meta tag within an autogenerated class annotated with **@Embeddable** , for example **EventConnectedId**

If I add this line in **PojoFields.ftl**

`==><#if pojo.hasMetaAttribute(“test”)>OK!</#if><==`

And try to check the generated entity **EventConnected** , I have correctly:

`==>OK!<==`

But, if I check **EventConnectedId** :

`==><==`

Is it a bug? Is it an intended behavior?  
Is there a way to be able to use the meta tag in this context?

Thanks,  
Francesco

---

<div class="post-metadata">

**Author:** ![alagappanseth](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@alagappanseth](https://discourse.hibernate.org/u/alagappanseth)\
**Post date:** [June 10, 2025, 8:26pm UTC](https://discourse.hibernate.org/t/reveng-hibernate-xml-meta-tag-attributes-are-visible-in-hbm2java-ftl-templates-for-auto-generated-embeddable-class/10623/2 "2025-06-10T20:26:15Z")

</div>

If you are using Hibernate for reverse engineering (hbm2java) and your table has a composite primary key consisting of two fields, don’t worry.  
Create a class that contains all the fields from your Entity class. Add the @Id annotation to each field in the class. This method is easier if you don’t want to create a separate class for the key.

Remember to configure hibernate.reveng.xml to generate the correct annotations. This file contains special tags for configuring table and key processing.

If you run into any issues, check out this link: [https://stackoverflow.com/questions/tagged/hbm2java](https://stackoverflow.com/questions/tagged/hbm2java).
