Repository: quarkusio/quarkus
Issue: With AdditionalJpaModelBuildItem created Entity not working in dev mode

**Describe the bug**
I have created an own extension which contains a JPA entity and a CDI bean.
I have added the build steps according to the documentation:

@BuildStep
List<AdditionalJpaModelBuildItem> produceModel() {
    return Arrays.asList(new AdditionalJpaModelBuildItem(Entity.class));
}

@BuildStep
AdditionalBeanBuildItem registerBeans() {
    return AdditionalBeanBuildItem.builder()
            .addBeanClass(SomeBean.class)
            .build();
}


I instantiate and persist the entity in the mentioned CDI bean in the extension.

When i now use this extension in a quarkus app, for @QuarkusTest classes and normal application starts everything is working fine.
When i start the application in quarkus:dev mode i got this exception when i call the method which is instantiating and persisting the entity:

`
Caused by: org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.Long com.example.Entity.id] by reflection for persistent property [com.example.Entity#id] : Entity[id=null]
	at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:75)
	at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:223)
	at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:5102)
	at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:4802)
	at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:294)
	at org.hibernate.event.internal.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:517)
	at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:102)
	at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:62)
	at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:108)
	at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:702)
	... 78 more
`


`
Caused by: java.lang.IllegalArgumentException: Can not set java.lang.Long field com.example.Entity.id to com.example.Entity
        at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
        at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
        at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:58)
        at java.base/jdk.internal.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36)
        at java.base/java.lang.reflect.Field.get(Field.java:418)
        at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:71)
        ... 87 more
`

Also the excact same issue occurs also when i try to create a test in the extension itself with the QuarkusUnitTest junit extension.

**Expected behavior**
I would expect, that it is possible to instantiate a entity in a CDI bean in a quarkus extension and persist it there. And that the dev mode is beheaving in the same way like the production mode in this case.

**Actual behavior**
To instantiate a entity in a CDI bean in a quarkus extension and persist it there is only possible in production mode and @QuarkusTest classes, not in dev mode.


**To Reproduce**
Steps to reproduce the behavior:
1. Create an extension with a JPA entity and a CDI bean and create and persist the entity in the bean.
2. Use this extension in a quarkus app
3. Invoke the method of the CDI bean in production and dev mode

**Configuration**
```properties
No special configurations
```

**Screenshots**
(If applicable, add screenshots to help explain your problem.)

**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: 
 - Output of `java -version`: openjdk version "13" 2019-09-17
 - GraalVM version (if different from Java): not used
 - Quarkus version or git rev: 1.2.1.Final

**Additional context**
(Add any other context about the problem here.)


Changed files:
extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java

diff --git a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java
index 307c42e5c3e..e0d1b30c62e 100644
--- a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java
+++ b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java
@@ -760,7 +760,7 @@ private void enhanceEntities(final JpaEntitiesBuildItem domainObjects,
             try {
                 byte[] bytes = IoUtil.readClassAsBytes(HibernateOrmProcessor.class.getClassLoader(), className);
                 byte[] enhanced = hibernateEntityEnhancer.enhance(className, bytes);
-                additionalClasses.produce(new GeneratedClassBuildItem(true, className, enhanced != null ? enhanced : bytes));
+                additionalClasses.produce(new GeneratedClassBuildItem(false, className, enhanced != null ? enhanced : bytes));
             } catch (IOException e) {
                 throw new RuntimeException("Failed to read Model class", e);
             }