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

io.github.nichetoolkit.mybatis.MybatisAutoLogicMark Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package io.github.nichetoolkit.mybatis;

import io.github.nichetoolkit.rest.RestException;
import io.github.nichetoolkit.rest.identity.IdentityUtils;
import io.github.nichetoolkit.rice.DefaultLogicMark;
import io.github.nichetoolkit.rice.configure.RiceServiceProperties;
import org.springframework.stereotype.Component;

/**
 * MybatisAutoLogicMark
 * 

The mybatis auto logic mark class.

* @author Cyan ([email protected]) * @see io.github.nichetoolkit.rice.DefaultLogicMark * @see org.springframework.stereotype.Component * @since Jdk1.8 */ @Component public class MybatisAutoLogicMark extends DefaultLogicMark { /** * MybatisAutoLogicMark *

Instantiates a new mybatis auto logic mark.

* @param serviceProperties {@link io.github.nichetoolkit.rice.configure.RiceServiceProperties}

The service properties parameter is RiceServiceProperties type.

* @see io.github.nichetoolkit.rice.configure.RiceServiceProperties */ public MybatisAutoLogicMark(RiceServiceProperties serviceProperties) { super(serviceProperties); } @Override public Object getAutoMark() throws RestException { Object autoMark; switch (this.autoMark) { case DATETIME: autoMark = "now()"; break; case VERSION: autoMark = System.currentTimeMillis(); break; case IDENTITY: default: autoMark = IdentityUtils.valueOfString(); break; } return autoMark; } @Override public Object getAutoUnmark() throws RestException { return null; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy