Search in sources :

Example 1 with LobStorageInterface

use of org.h2.store.LobStorageInterface in project h2database by h2database.

the class ValueClob method copy.

@Override
public ValueLob copy(DataHandler database, int tableId) {
    if (lobData instanceof LobDataInMemory) {
        byte[] small = ((LobDataInMemory) lobData).getSmall();
        if (small.length > database.getMaxLengthInplaceLob()) {
            LobStorageInterface s = database.getLobStorage();
            ValueClob v = s.createClob(getReader(), charLength);
            ValueLob v2 = v.copy(database, tableId);
            v.remove();
            return v2;
        }
        return this;
    } else if (lobData instanceof LobDataDatabase) {
        return database.getLobStorage().copyLob(this, tableId);
    } else {
        throw new UnsupportedOperationException();
    }
}
Also used : LobDataInMemory(org.h2.value.lob.LobDataInMemory) LobStorageInterface(org.h2.store.LobStorageInterface) LobDataDatabase(org.h2.value.lob.LobDataDatabase)

Example 2 with LobStorageInterface

use of org.h2.store.LobStorageInterface in project SpringStudy by myounghaklee.

the class ValueClob method copy.

@Override
public ValueLob copy(DataHandler database, int tableId) {
    if (lobData instanceof LobDataInMemory) {
        byte[] small = ((LobDataInMemory) lobData).getSmall();
        if (small.length > database.getMaxLengthInplaceLob()) {
            LobStorageInterface s = database.getLobStorage();
            ValueClob v = s.createClob(getReader(), charLength);
            ValueLob v2 = v.copy(database, tableId);
            v.remove();
            return v2;
        }
        return this;
    } else if (lobData instanceof LobDataDatabase) {
        return database.getLobStorage().copyLob(this, tableId);
    } else {
        throw new UnsupportedOperationException();
    }
}
Also used : LobDataInMemory(org.h2.value.lob.LobDataInMemory) LobStorageInterface(org.h2.store.LobStorageInterface) LobDataDatabase(org.h2.value.lob.LobDataDatabase)

Example 3 with LobStorageInterface

use of org.h2.store.LobStorageInterface in project 468H2Project by lukeunderwood42.

the class ValueClob method copy.

@Override
public ValueLob copy(DataHandler database, int tableId) {
    if (lobData instanceof LobDataInMemory) {
        byte[] small = ((LobDataInMemory) lobData).getSmall();
        if (small.length > database.getMaxLengthInplaceLob()) {
            LobStorageInterface s = database.getLobStorage();
            ValueClob v = s.createClob(getReader(), charLength);
            ValueLob v2 = v.copy(database, tableId);
            v.remove();
            return v2;
        }
        return this;
    } else if (lobData instanceof LobDataDatabase) {
        return database.getLobStorage().copyLob(this, tableId);
    } else {
        throw new UnsupportedOperationException();
    }
}
Also used : LobDataInMemory(org.h2.value.lob.LobDataInMemory) LobStorageInterface(org.h2.store.LobStorageInterface) LobDataDatabase(org.h2.value.lob.LobDataDatabase)

Example 4 with LobStorageInterface

use of org.h2.store.LobStorageInterface in project h2database by h2database.

the class ValueBlob method copy.

@Override
public ValueLob copy(DataHandler database, int tableId) {
    if (lobData instanceof LobDataInMemory) {
        byte[] small = ((LobDataInMemory) lobData).getSmall();
        if (small.length > database.getMaxLengthInplaceLob()) {
            LobStorageInterface s = database.getLobStorage();
            ValueBlob v = s.createBlob(getInputStream(), octetLength);
            ValueLob v2 = v.copy(database, tableId);
            v.remove();
            return v2;
        }
        return this;
    } else if (lobData instanceof LobDataDatabase) {
        return database.getLobStorage().copyLob(this, tableId);
    } else {
        throw new UnsupportedOperationException();
    }
}
Also used : LobDataInMemory(org.h2.value.lob.LobDataInMemory) LobStorageInterface(org.h2.store.LobStorageInterface) LobDataDatabase(org.h2.value.lob.LobDataDatabase)

Example 5 with LobStorageInterface

use of org.h2.store.LobStorageInterface in project SpringStudy by myounghaklee.

the class ValueBlob method copy.

@Override
public ValueLob copy(DataHandler database, int tableId) {
    if (lobData instanceof LobDataInMemory) {
        byte[] small = ((LobDataInMemory) lobData).getSmall();
        if (small.length > database.getMaxLengthInplaceLob()) {
            LobStorageInterface s = database.getLobStorage();
            ValueBlob v = s.createBlob(getInputStream(), octetLength);
            ValueLob v2 = v.copy(database, tableId);
            v.remove();
            return v2;
        }
        return this;
    } else if (lobData instanceof LobDataDatabase) {
        return database.getLobStorage().copyLob(this, tableId);
    } else {
        throw new UnsupportedOperationException();
    }
}
Also used : LobDataInMemory(org.h2.value.lob.LobDataInMemory) LobStorageInterface(org.h2.store.LobStorageInterface) LobDataDatabase(org.h2.value.lob.LobDataDatabase)

Aggregations

LobStorageInterface (org.h2.store.LobStorageInterface)6 LobDataDatabase (org.h2.value.lob.LobDataDatabase)6 LobDataInMemory (org.h2.value.lob.LobDataInMemory)6