All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avaje.ebean.config.dbplatform.mysql.MySqlClob Maven / Gradle / Ivy

There is a newer version: 9.5.1
Show newest version
package com.avaje.ebean.config.dbplatform.mysql;

import com.avaje.ebean.config.dbplatform.DbPlatformType;

/**
 * Support for text, mediumtext or longtext selection based on the deployment
 * length.
 * 

* If no deployment length is defined longtext is used. *

*/ public class MySqlClob extends DbPlatformType { private static final int POWER_2_16 = 65536; private static final int POWER_2_24 = 16777216; public MySqlClob() { super("text"); } @Override public String renderType(int deployLength, int deployScale) { if (deployLength >= POWER_2_24) { return "longtext"; } if (deployLength >= POWER_2_16) { return "mediumtext"; } if (deployLength < 1) { // length not explicitly defined return "longtext"; } return "text"; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy