Example usage for org.springframework.dao IncorrectUpdateSemanticsDataAccessException IncorrectUpdateSemanticsDataAccessException

List of usage examples for org.springframework.dao IncorrectUpdateSemanticsDataAccessException IncorrectUpdateSemanticsDataAccessException

Introduction

In this page you can find the example usage for org.springframework.dao IncorrectUpdateSemanticsDataAccessException IncorrectUpdateSemanticsDataAccessException.

Prototype

public IncorrectUpdateSemanticsDataAccessException(String msg) 

Source Link

Document

Constructor for IncorrectUpdateSemanticsDataAccessException.

Usage

From source file:org.dcache.chimera.PgSQLFsSqlDriver.java

@Override
protected FsInode createInodeInParent(FsInode parent, String name, String id, int owner, int group, int mode,
        int type, int nlink, long size) {
    Timestamp now = new Timestamp(System.currentTimeMillis());

    Long inumber = _jdbc.query("SELECT f_create_inode(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", cs -> {
        cs.setLong(1, parent.ino());/*  w ww. j a  va2  s . co m*/
        cs.setString(2, name);
        cs.setString(3, id);
        cs.setInt(4, type);
        cs.setInt(5, mode & UnixPermission.S_PERMS);
        cs.setInt(6, nlink);
        cs.setInt(7, owner);
        cs.setInt(8, group);
        cs.setLong(9, size);
        cs.setInt(10, _ioMode);
        cs.setTimestamp(11, now);
    }, rs -> rs.next() ? rs.getLong(1) : null);
    if (inumber == null) {
        throw new IncorrectUpdateSemanticsDataAccessException("f_create_inode failed to return an inumber.");
    }

    Stat stat = new Stat();
    stat.setIno(inumber);
    stat.setId(id);
    stat.setCrTime(now.getTime());
    stat.setGeneration(0);
    stat.setSize(size);
    stat.setATime(now.getTime());
    stat.setCTime(now.getTime());
    stat.setMTime(now.getTime());
    stat.setUid(owner);
    stat.setGid(group);
    stat.setMode(mode & UnixPermission.S_PERMS | type);
    stat.setNlink(nlink);
    stat.setDev(17);
    stat.setRdev(13);

    return new FsInode(parent.getFs(), inumber, FsInodeType.INODE, 0, stat);
}