diff --git a/framework/build.xml b/framework/build.xml
index 516feec6e5..ce38f846dc 100644
--- a/framework/build.xml
+++ b/framework/build.xml
@@ -283,26 +283,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/framework/dependencies.yml b/framework/dependencies.yml
index 782c1075c8..6ccb21d7ac 100644
--- a/framework/dependencies.yml
+++ b/framework/dependencies.yml
@@ -8,8 +8,6 @@ transitiveDependencies: false
# This core dependencies are required by Play framework
require: &allDependencies
- antlr 2.7.7
- - com.mchange -> c3p0 0.9.5.5
- - com.zaxxer -> HikariCP 5.1.0
- org.ow2.asm -> asm 9.6
- org.ow2.asm -> asm-commons 9.6
- org.ow2.asm -> asm-util 9.6
@@ -29,7 +27,6 @@ require: &allDependencies
- org.apache.commons -> commons-text 1.11.0
- commons-logging 1.3.0
- org.dom4j -> dom4j 2.1.4
- - com.h2database -> h2 1.4.200
- javax.activation -> javax.activation-api 1.2.0
- com.sun.mail -> javax.mail 1.6.2
- jakarta.inject -> jakarta.inject-api 1.0
@@ -56,11 +53,7 @@ require: &allDependencies
- org.codehaus.groovy -> groovy-xml 3.0.20
- org.eclipse.jdt -> org.eclipse.jdt.core 3.33.0
- org.eclipse.jdt -> ecj 3.33.0
- - org.hibernate -> hibernate-core 5.6.5.Final.patched
- net.bytebuddy -> byte-buddy 1.14.12
- - javax.persistence -> javax.persistence-api 2.2
- - org.hibernate.common -> hibernate-commons-annotations 5.1.2.Final
- - org.hibernate -> hibernate-validator 5.4.3.Final
- io.smallrye -> jandex 3.1.6
- org.jboss.logging -> jboss-logging 3.5.3.Final
- org.jboss.spec.javax.transaction -> jboss-transaction-api_1.2_spec 1.1.1.Final
@@ -68,8 +61,6 @@ require: &allDependencies
- javax.xml.bind -> jaxb-api 2.3.1
- org.glassfish.jaxb -> jaxb-runtime 2.3.9
- com.fasterxml -> classmate 1.7.0
- - org.hibernate -> hibernate-c3p0 5.6.15.Final
- - org.hibernate -> hibernate-ehcache 5.6.15.Final
- com.mchange -> mchange-commons-java 0.2.20
- org.javassist -> javassist 3.30.2-GA
- io.netty -> netty 3.10.6.Final
@@ -80,7 +71,7 @@ require: &allDependencies
- net.spy -> spymemcached 2.12.3
- com.thoughtworks.xstream -> xstream 1.4.20
- xmlpull 1.1.3.4d_b4_min
- - org.apache.logging.log4j -> log4j-web 2.18.0
+
# Default repositories, used for all projects
repositories:
diff --git a/framework/gradle/wrapper/gradle-wrapper.jar b/framework/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000000..d64cd49177
Binary files /dev/null and b/framework/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/framework/gradle/wrapper/gradle-wrapper.properties b/framework/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000000..1af9e0930b
--- /dev/null
+++ b/framework/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/framework/lib/commons-collections-3.2.2.jar b/framework/lib/commons-collections-3.2.2.jar
deleted file mode 100644
index fa5df82a63..0000000000
Binary files a/framework/lib/commons-collections-3.2.2.jar and /dev/null differ
diff --git a/framework/src/play.plugins b/framework/src/play.plugins
index 9ceb7f1fc1..bca273a62e 100644
--- a/framework/src/play.plugins
+++ b/framework/src/play.plugins
@@ -2,10 +2,6 @@
1:play.ConfigurationChangeWatcherPlugin
100:play.data.parsing.TempFilePlugin
200:play.data.validation.ValidationPlugin
-300:play.db.DBPlugin
-301:play.db.DBBrowserPlugin
-400:play.db.jpa.JPAPlugin
-450:play.db.Evolutions
500:play.i18n.MessagesPlugin
600:play.libs.WS
700:play.jobs.JobsPlugin
diff --git a/framework/src/play/PlayPlugin.java b/framework/src/play/PlayPlugin.java
index ccdebe9f0e..e012daba4f 100644
--- a/framework/src/play/PlayPlugin.java
+++ b/framework/src/play/PlayPlugin.java
@@ -14,7 +14,6 @@
import play.classloading.ApplicationClasses.ApplicationClass;
import play.data.binding.RootParamNode;
-import play.db.Model;
import play.libs.F;
import play.mvc.Http.Request;
import play.mvc.Http.Response;
@@ -416,15 +415,6 @@ public void compileAll(List classes) {
public void routeRequest(Request request) {
}
- /**
- * @param modelClass
- * class of the model
- * @return the Model factory
- */
- public Model.Factory modelFactory(Class extends Model> modelClass) {
- return null;
- }
-
public void afterFixtureLoad() {
}
diff --git a/framework/src/play/data/binding/AnnotationHelper.java b/framework/src/play/data/binding/AnnotationHelper.java
index ec1f904124..e0b7bf2c3f 100644
--- a/framework/src/play/data/binding/AnnotationHelper.java
+++ b/framework/src/play/data/binding/AnnotationHelper.java
@@ -11,7 +11,6 @@
import play.data.binding.types.DateBinder;
import play.i18n.Lang;
import play.libs.I18N;
-import play.test.Fixtures;
public class AnnotationHelper {
@@ -37,10 +36,7 @@ public static Date getDateAs(Annotation[] annotations, String value) throws Pars
Locale locale = Lang.getLocale();
String format = as.value()[0];
// According to Binder.java line 328 : Fixtures can use (iso) dates as default
- if (format != null && format.equals(Fixtures.PROFILE_NAME)) {
- format = DateBinder.ISO8601;
- locale = null;
- } else if (!StringUtils.isEmpty(format)) {
+ if (!StringUtils.isEmpty(format)) {
// This can be comma separated
Tuple tuple = getLocale(as.lang());
if (tuple != null) {
diff --git a/framework/src/play/data/binding/Binder.java b/framework/src/play/data/binding/Binder.java
index 3a8b775a19..ef1cf88773 100644
--- a/framework/src/play/data/binding/Binder.java
+++ b/framework/src/play/data/binding/Binder.java
@@ -40,7 +40,6 @@ public abstract class Binder {
supportedTypes.put(LocalDateTime.class, new LocalDateTimeBinder());
supportedTypes.put(LocalDate.class, new LocalDateBinder());
supportedTypes.put(LocalTime.class, new LocalTimeBinder());
- supportedTypes.put(Model.BinaryField.class, new BinaryBinder());
supportedTypes.put(Upload.class, new UploadBinder());
supportedTypes.put(Upload[].class, new UploadArrayBinder());
supportedTypes.put(Calendar.class, new CalendarBinder());
diff --git a/framework/src/play/data/binding/types/BinaryBinder.java b/framework/src/play/data/binding/types/BinaryBinder.java
deleted file mode 100644
index 50bfaa67b8..0000000000
--- a/framework/src/play/data/binding/types/BinaryBinder.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package play.data.binding.types;
-
-import play.data.binding.Binder;
-import play.data.binding.TypeBinder;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.List;
-import play.data.Upload;
-import play.db.Model;
-import play.exceptions.UnexpectedException;
-import play.mvc.Http.Request;
-import play.mvc.Scope.Params;
-
-public class BinaryBinder implements TypeBinder {
-
- @SuppressWarnings("unchecked")
- @Override
- public Object bind(String name, Annotation[] annotations, String value, Class actualClass, Type genericType) {
- if (value == null || value.trim().length() == 0) {
- return null;
- }
- try {
- Request req = Request.current();
- if (req != null && req.args != null) {
- Model.BinaryField b = (Model.BinaryField) actualClass.newInstance();
- List uploads = (List) req.args.get("__UPLOADS");
- if(uploads != null){
- for (Upload upload : uploads) {
- if (upload.getFieldName().equals(value) && upload.getFileName().trim().length() > 0) {
- b.set(upload.asStream(), upload.getContentType());
- return b;
- }
- }
- }
- }
-
- if (Params.current() != null && Params.current().get(value + "_delete_") != null) {
- return null;
- }
- return Binder.MISSING;
- } catch (Exception e) {
- throw new UnexpectedException(e);
- }
- }
-}
diff --git a/framework/src/play/data/validation/Unique.java b/framework/src/play/data/validation/Unique.java
deleted file mode 100644
index 70e1d8f98a..0000000000
--- a/framework/src/play/data/validation/Unique.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package play.data.validation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import net.sf.oval.configuration.annotation.Constraint;
-import play.db.jpa.GenericModel;
-
-/**
- * Check that a field or or field in a context is unique.
- * You set the context as a list (comma, semicolon or space separated)
- * of properties of your {@link GenericModel}.
- *
- * Message key: validation.unique
- * $1: field name
- * $2: properties which define a context in which the column must be unique
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.FIELD, ElementType.PARAMETER})
-@Constraint(checkWith = UniqueCheck.class)
-public @interface Unique {
- String value() default "";
- String message() default UniqueCheck.mes;
-}
\ No newline at end of file
diff --git a/framework/src/play/data/validation/UniqueCheck.java b/framework/src/play/data/validation/UniqueCheck.java
deleted file mode 100755
index fc4613616d..0000000000
--- a/framework/src/play/data/validation/UniqueCheck.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package play.data.validation;
-
-import net.sf.oval.Validator;
-import net.sf.oval.configuration.annotation.AbstractAnnotationCheck;
-import net.sf.oval.context.FieldContext;
-import net.sf.oval.context.OValContext;
-import play.db.jpa.GenericModel;
-import play.db.jpa.JPQL;
-import play.db.jpa.Model;
-import play.exceptions.UnexpectedException;
-
-import java.lang.reflect.Field;
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * Check which proof if one or a set of properties is unique.
- *
- */
-public class UniqueCheck extends AbstractAnnotationCheck {
-
- static final String mes = "validation.unique";
- private String uniqueKeyContext = null;
-
- @Override
- public void configure(Unique constraintAnnotation) {
- uniqueKeyContext = constraintAnnotation.value();
- setMessage(constraintAnnotation.message());
- }
-
- @Override
- public Map createMessageVariables() {
- Map messageVariables = new TreeMap<>();
- messageVariables.put("2-properties", uniqueKeyContext);
- return messageVariables;
- }
-
- private String[] getPropertyNames(String uniqueKey) {
- String completeUniqueKey;
- if (uniqueKeyContext.length() > 0) {
- completeUniqueKey = uniqueKeyContext + ";" + uniqueKey;
- } else {
- completeUniqueKey = uniqueKey;
- }
- return completeUniqueKey.split("[,;\\s][\\s]*");
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- public boolean isSatisfied(Object validatedObject, Object value,
- OValContext context, Validator validator) {
- requireMessageVariablesRecreation();
- if (value == null) {
- return true;
- }
- String[] propertyNames = getPropertyNames(
- ((FieldContext) context).getField().getName());
- GenericModel model = (GenericModel) validatedObject;
- Model.Factory factory = Model.Manager.factoryFor(model.getClass());
- String keyProperty = factory.keyName();
- Object keyValue = factory.keyValue(model);
- //In case of an update make sure that we won't read the current record from database.
- boolean isUpdate = (keyValue != null);
- String entityName = model.getClass().getName();
- StringBuilder jpql = new StringBuilder("SELECT COUNT(o) FROM ");
- jpql.append(entityName).append(" AS o where ");
- Object[] values = new Object[isUpdate ? propertyNames.length + 1 :
- propertyNames.length];
- Class clazz = validatedObject.getClass();
- int index = 1;
- for (int i = 0; i < propertyNames.length; i++) {
- Field field = getField(clazz, propertyNames[i]);
- field.setAccessible(true);
- try {
- values[i] = field.get(model);
- } catch (Exception ex) {
- throw new UnexpectedException(ex);
- }
- if (i > 0) {
- jpql.append(" And ");
- }
- jpql.append("o.").append(propertyNames[i]).append(" = ?").append(String.valueOf(index++)).append(" ");
- }
- if (isUpdate) {
- values[propertyNames.length] = keyValue;
- jpql.append(" and o.").append(keyProperty).append(" <> ?").append(String.valueOf(index++)).append(" ");
- }
- return JPQL.instance.count(entityName, jpql.toString(), values) == 0L;
- }
-
- private Field getField(Class clazz, String fieldName) {
- Class c = clazz;
- try {
- while (!c.equals(Object.class)) {
- try {
- return c.getDeclaredField(fieldName);
- } catch (NoSuchFieldException e) {
- c = c.getSuperclass();
- }
- }
- } catch (Exception e) {
- throw new UnexpectedException("Error while determining the field " +
- fieldName + " for an object of type " + clazz, e);
- }
- throw new UnexpectedException("Cannot get the field " + fieldName +
- " for an object of type " + clazz);
- }
-}
\ No newline at end of file
diff --git a/framework/src/play/db/Configuration.java b/framework/src/play/db/Configuration.java
deleted file mode 100644
index 5adc079fce..0000000000
--- a/framework/src/play/db/Configuration.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package play.db;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-
-import jregex.Matcher;
-import jregex.Pattern;
-import play.Play;
-
-public class Configuration {
-
- /** definition of regex to filter db related settings. */
- final String regexDbRelatedSettings = "^(db|javax\\.persistence|jpa|(?:org\\.)?hibernate){1}";
-
- /** compiled regex as a pattern for reuse to filter all db related settings. */
- final java.util.regex.Pattern compiledRegexDbRelatedSettings = java.util.regex.Pattern.compile(regexDbRelatedSettings +".*");
-
- public final String configName;
-
- public boolean isDefault() {
- return DB.DEFAULT.equals(this.configName);
- }
-
- public Configuration(String configurationName) {
- this.configName = configurationName;
- }
-
- public static Set getDbNames() {
- TreeSet dbNames = new TreeSet<>();
- // search for case db= or db.url= as at least one of these property is required
- String DB_CONFIG_PATTERN = "^db\\.([^\\.]*)$|^db\\.([^\\.]*)\\.url$";
- Pattern pattern = new jregex.Pattern(DB_CONFIG_PATTERN);
-
- // List of properties with 2 words
- List dbProperties = Arrays.asList("db.driver", "db.url", "db.user", "db.pass", "db.isolation", "db.destroyMethod",
- "db.testquery", "db.factory");
-
- for (String property : Play.configuration.stringPropertyNames()) {
- Matcher m = pattern.matcher(property);
- if (m.matches() && !dbProperties.contains(property)) {
- String dbName = (m.group(1) != null ? m.group(1) : m.group(2));
- dbNames.add(dbName);
- }
- // Special case db=... and
- if ("db".equals(property) || "db.url".equals(property)) {
- dbNames.add("default");
- }
- }
- return new TreeSet<>(dbNames);
- }
-
- public String getProperty(String key) {
- return this.getProperty(key, null);
- }
-
- public String getProperty(String key, String defaultString) {
- if (key != null) {
- String newKey = generateKey(key);
- Object value = Play.configuration.get(newKey);
- if (value == null && this.isDefault()) {
- value = Play.configuration.get(key);
- }
- if (value != null) {
- return value.toString();
- }
- }
-
- return defaultString;
- }
-
- /**
- * Add a parameter in the configuration
- *
- * @param key
- * the key of the parameter
- * @param value
- * the value of the parameter
- * @return the previous value of the specified key in this hashtable, or null if it did not have one
- */
- public Object put(String key, String value) {
- if (key != null) {
- return Play.configuration.put(generateKey(key), value);
- }
- return null;
- }
-
- String generateKey(String key) {
- Pattern pattern = new Pattern(regexDbRelatedSettings + "(\\.?[\\da-zA-Z\\.-_]*)$");
- Matcher m = pattern.matcher(key);
- if (m.matches()) {
- return m.group(1) + "." + this.configName + m.group(2);
- }
- return key;
- }
-
- public Map getProperties() {
- Map properties = new HashMap<>();
- Properties props = Play.configuration;
-
- for (Object key : Collections.list(props.keys())) {
- String keyName = key.toString();
-
- final java.util.regex.Matcher matcher = compiledRegexDbRelatedSettings.matcher(keyName);
- if (matcher.matches()) {
- final String key_prefix_for_db_related_setting = matcher.group(1);
- if (keyName.startsWith(key_prefix_for_db_related_setting + "." + this.configName)) {
- String newKey = key_prefix_for_db_related_setting;
- if (keyName.length() > (key_prefix_for_db_related_setting + "." + this.configName).length()) {
- newKey += "." + keyName.substring((key_prefix_for_db_related_setting + "." + this.configName).length() + 1);
- }
- properties.put(newKey, props.get(key).toString());
- } else if (this.isDefault()) {
- boolean isDefaultProperty = true;
- Set dBNames = Configuration.getDbNames();
- for (String dbName : dBNames) {
- if (keyName.startsWith("db." + dbName) ||
- keyName.startsWith("hibernate." + dbName)) {
- isDefaultProperty = false;
- break;
- }
- }
- if (isDefaultProperty) {
- properties.put(keyName, props.get(key).toString());
- }
- }
- }
- }
- return properties;
- }
-}
diff --git a/framework/src/play/db/DB.java b/framework/src/play/db/DB.java
deleted file mode 100644
index 8c2de5eaee..0000000000
--- a/framework/src/play/db/DB.java
+++ /dev/null
@@ -1,337 +0,0 @@
-package play.db;
-
-import java.lang.reflect.Method;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.sql.DataSource;
-import javax.sql.RowSet;
-import javax.sql.rowset.CachedRowSet;
-import javax.sql.rowset.RowSetProvider;
-
-import org.hibernate.internal.SessionImpl;
-
-import play.Logger;
-import play.db.jpa.JPA;
-import play.exceptions.DatabaseException;
-
-/**
- * Database connection utilities.
- */
-public class DB {
-
- /**
- * The loaded datasource.
- *
- * @see ExtendedDatasource
- */
- protected static final Map datasources = new ConcurrentHashMap<>();
-
- public static class ExtendedDatasource {
-
- /**
- * Connection to the physical data source
- */
- private final DataSource datasource;
-
- /**
- * The method used to destroy the data source
- */
- private final String destroyMethod;
-
- public ExtendedDatasource(DataSource ds, String destroyMethod) {
- this.datasource = ds;
- this.destroyMethod = destroyMethod;
- }
-
- public String getDestroyMethod() {
- return destroyMethod;
- }
-
- public DataSource getDataSource() {
- return datasource;
- }
-
- }
-
- /**
- * @deprecated Use datasources instead
- * @since 1.3.0
- * @see #datasources
- * @see ExtendedDatasource
- */
- @Deprecated
- public static DataSource datasource = null;
- /**
- * The method used to destroy the datasource
- *
- * @deprecated Use datasources instead
- * @since 1.3.0
- * @see #datasources
- * @see ExtendedDatasource
- */
- @Deprecated
- public static String destroyMethod = "";
-
- public static final String DEFAULT = "default";
-
- static final ThreadLocal