Merge remote-tracking branch 'upstream/main' into wip/6.0_merge_main_7
This commit is contained in:
commit
8c40de9cff
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.userguide.jmx;
|
||||
|
||||
import java.util.Map;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
import org.hibernate.cfg.AvailableSettings;
|
||||
import org.hibernate.orm.test.jpa.BaseEntityManagerFunctionalTestCase;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
|
||||
|
||||
/**
|
||||
* @author Vlad Mihalcea
|
||||
*/
|
||||
public class JmxTest extends BaseEntityManagerFunctionalTestCase {
|
||||
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
return new Class<?>[] {
|
||||
Person.class,
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map buildSettings() {
|
||||
Map properties = super.buildSettings();
|
||||
properties.put( AvailableSettings.GENERATE_STATISTICS, Boolean.TRUE.toString());
|
||||
properties.put( AvailableSettings.JMX_ENABLED, Boolean.TRUE.toString());
|
||||
properties.put( AvailableSettings.JMX_DOMAIN_NAME, "test");
|
||||
return properties;
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-7405" )
|
||||
public void test() {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
Person person = new Person();
|
||||
person.id = 1L;
|
||||
entityManager.persist(person);
|
||||
});
|
||||
}
|
||||
|
||||
@Entity(name = "Person")
|
||||
public static class Person {
|
||||
|
||||
@Id
|
||||
private Long id;
|
||||
|
||||
private String firstName;
|
||||
|
||||
private String lastName;
|
||||
}
|
||||
}
|
|
@ -47,7 +47,7 @@ ext {
|
|||
jakartaJaxbRuntimeVersion = '3.0.2'
|
||||
|
||||
//GraalVM
|
||||
graalvmVersion = '19.3.1'
|
||||
graalvmVersion = '21.2.0'
|
||||
|
||||
antlrVersion = '4.9.1'
|
||||
|
||||
|
|
|
@ -1847,13 +1847,6 @@ public interface AvailableSettings {
|
|||
*/
|
||||
String HBM2DDL_DEFAULT_CONSTRAINT_MODE = "hibernate.hbm2ddl.default_constraint_mode";
|
||||
|
||||
String JMX_ENABLED = "hibernate.jmx.enabled";
|
||||
String JMX_PLATFORM_SERVER = "hibernate.jmx.usePlatformServer";
|
||||
String JMX_AGENT_ID = "hibernate.jmx.agentId";
|
||||
String JMX_DOMAIN_NAME = "hibernate.jmx.defaultDomain";
|
||||
String JMX_SF_NAME = "hibernate.jmx.sessionFactoryName";
|
||||
String JMX_DEFAULT_OBJ_NAME_DOMAIN = "org.hibernate.core";
|
||||
|
||||
/**
|
||||
* Setting to identify a {@link org.hibernate.CustomEntityDirtinessStrategy} to use. May point to
|
||||
* either a class name or instance.
|
||||
|
|
|
@ -42,7 +42,10 @@ public abstract class AbstractPreDatabaseOperationEvent extends AbstractEvent {
|
|||
* Retrieves the entity involved in the database operation.
|
||||
*
|
||||
* @return The entity.
|
||||
*
|
||||
* @deprecated Support for JACC will be removed in 6.0
|
||||
*/
|
||||
@Deprecated
|
||||
public Object getEntity() {
|
||||
return entity;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue