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

io.ebean.config.dbplatform.mysql.MySqlBlob Maven / Gradle / Ivy

package io.ebean.config.dbplatform.mysql;

import io.ebean.config.dbplatform.DbPlatformType;

/**
 * Support for blob, mediumblob or longblob selection based on the deployment
 * length.
 * 

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy