当前位置: 首页>>代码示例>>Java>>正文


Java Version类代码示例

本文整理汇总了Java中org.cubeengine.libcube.util.Version的典型用法代码示例。如果您正苦于以下问题:Java Version类的具体用法?Java Version怎么用?Java Version使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Version类属于org.cubeengine.libcube.util包,在下文中一共展示了Version类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
@Override
public void update(Connection connection, Version dbVersion) throws SQLException
{
    if (new Version(1).equals(dbVersion)) // Update to Version 2
    {
        // Remove mask;
        Statement stmt = connection.createStatement();
        stmt.execute("ALTER TABLE `"+ getName()+ "` ADD"
                + "( HIDDEN BOOLEAN, INVITE BOOLEAN, IS_UUID BOOLEAN)");
        stmt.execute("UPDATE TABLE `" + getName() + "` SET "
                        + "HIDDEN = MASK & 1 = 1,"
                        + "INVITE = MASK & 2 = 2,"
                        + "IS_UUID = MASK & 4 = 4");
        stmt.execute("ALTER TABLE `" + getName() +"` DROP COLUMN MASK");
    }
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:17,代码来源:TableAccount.java

示例2: TableBalance

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableBalance()
{
    super(BalanceModel.class, "conomy_balance", new Version(1));
    this.setPrimaryKey(ACCOUNT_ID, CURRENCY, CONTEXT);
    this.addFields(ACCOUNT_ID, CURRENCY, CONTEXT, BALANCE);
    this.addForeignKey(TABLE_ACCOUNT.getPrimaryKey(), ACCOUNT_ID);
    TABLE_BALANCE = this;
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:9,代码来源:TableBalance.java

示例3: TableAccount

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableAccount()
{
    super(AccountModel.class, "conomy_account", new Version(2));
    this.setPrimaryKey(ID);
    this.addUniqueKey(ID);
    this.addFields(ID, NAME, HIDDEN, INVITE, IS_UUID);
    TABLE_ACCOUNT = this;
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:9,代码来源:TableAccount.java

示例4: TableMail

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableMail()
{
    super(Mail.class, "mail", new Version(1));
    this.setPrimaryKey(ID);
    this.addFields(ID, MESSAGE, USERID, SENDERID);
    TABLE_MAIL = this;
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:8,代码来源:TableMail.java

示例5: updateTableStructure

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
private boolean updateTableStructure(TableUpdateCreator updater)
{
    Record1<String> result = getDSL().select(TABLE_VERSION.VERSION).from(TABLE_VERSION).where(TABLE_VERSION.NAME.eq(updater.getName())).fetchOne();
    if (result != null)
    {
        try
        {
            Version dbVersion = Version.fromString(result.value1());
            Version version = updater.getTableVersion();
            if (dbVersion.isNewerThan(version))
            {
                logger.info("table-version is newer than expected! {}: {} expected version: {}", updater.getName(),
                        dbVersion.toString(), version.toString());
            }
            else if (dbVersion.isOlderThan(updater.getTableVersion()))
            {
                logger.info("table-version is too old! Updating {} from {} to {}", updater.getName(),
                        dbVersion.toString(), version.toString());
                try (Connection connection = this.getConnection())
                {
                    updater.update(connection, dbVersion);
                }
                getDSL().mergeInto(TABLE_VERSION).values(updater.getName(), version.toString());
                logger.info("{} got updated to {}", updater.getName(), version.toString());
            }
            return true;
        }
        catch (SQLException e)
        {
            logger.warn(e, "Could not execute structure update for the table {}", updater.getName());
        }
    }
    return false;
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:35,代码来源:MySQLDatabase.java

示例6: TableLockLocations

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableLockLocations()
{
    super(LockLocationModel.class, "locker_locations", new Version(1));
    this.setPrimaryKey(ID);
    this.addIndex(CHUNKX, CHUNKZ);
    this.addUniqueKey(WORLD_ID, X, Y, Z);
    this.addForeignKey(TABLE_LOCKS.getPrimaryKey(), LOCK_ID);
    this.addFields(ID, WORLD_ID, X, Y, Z, CHUNKX, CHUNKZ, LOCK_ID);
    TABLE_LOCK_LOCATIONS = this;
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:11,代码来源:TableLockLocations.java

示例7: TableLocks

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableLocks()
{
    super(LockModel.class, "locker_locks", new Version(1));
    this.setPrimaryKey(ID);
    this.addUniqueKey(ENTITY_UUID);
    this.addFields(ID, OWNER_ID, FLAGS, PROTECTED_TYPE, LOCK_TYPE, PASSWORD, ENTITY_UUID, LAST_ACCESS, CREATED);
    TABLE_LOCKS = this;
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:9,代码来源:TableLocks.java

示例8: TableAccessList

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableAccessList()
{
    super(AccessListModel.class, "locker_accesslist", new Version(1));
    this.setPrimaryKey(ID);
    this.addUniqueKey(USER_ID, LOCK_ID);
    this.addUniqueKey(USER_ID, OWNER_ID);
    this.addForeignKey(TABLE_LOCKS.getPrimaryKey(), LOCK_ID);
    this.addFields(ID, USER_ID, LOCK_ID, LEVEL, OWNER_ID);
    TABLE_ACCESSLIST = this;
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:11,代码来源:TableAccessList.java

示例9: TableIgnorelist

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableIgnorelist()
{
    super(IgnoreList.class, "chat_ignores", new Version(1));
    this.setPrimaryKey(ID, IGNORE);
    this.addFields(ID, IGNORE);
    TABLE_IGNORE_LIST = this;
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:8,代码来源:TableIgnorelist.java

示例10: TableMuted

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableMuted()
{
    super(Muted.class, "mute", new Version(1));
    setPrimaryKey(ID);
    addFields(ID, MUTED);
    TABLE_MUTED = this;
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:8,代码来源:TableMuted.java

示例11: TableVote

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableVote()
{
    super(VoteModel.class, "votecount", new Version(1));
    this.setPrimaryKey(ID);
    this.addFields(ID, LASTVOTE, VOTEAMOUNT);
    TABLE_VOTE = this;
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:8,代码来源:TableVote.java

示例12: TableAuth

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableAuth()
{
    super(Auth.class, "auth", new Version(1));
    setPrimaryKey(ID);
    addFields(ID, PASSWD);
    TABLE_AUTH = this;
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:8,代码来源:TableAuth.java

示例13: TableRepairBlock

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public TableRepairBlock()
{
    super(RepairBlockModel.class, "itemrepair_blocks", new Version(1));
    this.setPrimaryKey(ID);
    this.addUniqueKey(WORLD, X, Y, Z);
    this.addFields(ID, WORLD, X, Y, Z, TYPE);
    TABLE_REPAIR_BLOCK = this;
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:9,代码来源:TableRepairBlock.java

示例14: Table

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
public Table(Class<R> model, String name, Version version)
{
    super(name);
    this.model = model;
    this.version = version;
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:7,代码来源:Table.java

示例15: getTableVersion

import org.cubeengine.libcube.util.Version; //导入依赖的package包/类
@Override
public final Version getTableVersion()
{
    return version;
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:6,代码来源:Table.java


注:本文中的org.cubeengine.libcube.util.Version类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。