Skip to content

Param Annotation

The @Param annotation is used to specify a name for method parameters so they can be bound in SQL queries.

Parameters

ParameterTypeDefaultDescription
valueString(required)The name of the method parameter to be used in SQL bind

Usage Example

java
import com.tang.kite.annotation.Param;
import com.tang.kite.mapper.BaseMapper;

public interface UserMapper extends BaseMapper<User> {

    @Select("select id, username from account where username = #{username}")
    Account selectByUsername(@Param("username") String username);

}
java
import com.tang.kite.annotation.id.Id;
import com.tang.kite.annotation.id.IdType;

public class Account {

    @Id(type = IdType.AUTO)
    private Long id;

    private String username;

}

Built with ❤️ by Tang