2022-03-17 23:33

2020-12-10 15:39

@JFinal 可以考虑加这个jsonbody进去

2020-07-24 08:47

可以参考一下 jboot Db 增强这一块

2020-07-23 15:55

@heycm 看一下jboot的玩法吧。

2020-07-15 17:32

应用于 SQL 管理的 Engine 对象的配置在 configPlugin(Plugins me) 中进行:

public void configPlugin(Plugins me) {
ActiveRecordPlugin arp = new ActiveRecordPlugin(...);
Engine engine = arp.getEngine();

// 上面的代码获取到了用于 sql 管理功能的 Engine 对象,接着就可以开始配置了
engine.setToClassPathSourceFactory();
engine.addSharedMethod(new StrKit());

me.add(arp);
}
https://jfinal.com/doc/6-2

2020-03-26 08:55

如果是:Jackson的话配置一下即可

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.jfinal.plugin.activerecord.Record;

public class RecordJackSonSerializer extends JsonSerializer {

@Override
public void serialize(Record record, JsonGenerator gen, SerializerProvider serializers) throws IOException {
gen.writeObject(record.getColumns());
}
}


======================================================

import java.io.IOException;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.zalando.problem.ProblemModule;
import org.zalando.problem.violations.ConstraintViolationProblemModule;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.module.afterburner.AfterburnerModule;
import com.jfinal.plugin.activerecord.Record;

@Configuration
public class JacksonConfiguration {

/**
* Support for Java date and time API.
* @return the corresponding Jackson module.
*/
@Bean
public JavaTimeModule javaTimeModule() {
return new JavaTimeModule();
}

@Bean
public Jdk8Module jdk8TimeModule() {
return new Jdk8Module();
}

@Bean
@Primary
@ConditionalOnMissingBean(ObjectMapper.class)
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(Record.class,new RecordJackSonSerializer());
objectMapper.registerModule(simpleModule);

objectMapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer() {
@Override
public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
jsonGenerator.writeString("");
}
});
return objectMapper;
}


/*
* Jackson Afterburner module to speed up serialization/deserialization.
*/
@Bean
public AfterburnerModule afterburnerModule() {
return new AfterburnerModule();
}

/*
* Module for serialization/deserialization of RFC7807 Problem.
*/
@Bean
ProblemModule problemModule() {
return new ProblemModule();
}

/*
* Module for serialization/deserialization of ConstraintViolationProblem.
*/
@Bean
ConstraintViolationProblemModule constraintViolationProblemModule() {
return new ConstraintViolationProblemModule();
}

}

2020-03-17 09:08

quartz 挺好用的。集成也 简单。

2019-11-22 10:44

@JFinal 确实需要排序功能,排序的场景需求很大

2019-11-12 09:35

没有第三方的,需要自己改

2019-09-03 17:53

@JFinal 说白了,就是想拿到内容中原封不动的数据而已,通过Engin是可以做到

2019-09-03 17:51

@JFinal 我本来是先通过在模板中用参数符号,然后通过拿到模板中的sql和参数进行 renderToString,然后再拼接sql,通过Db.getSql之后,就替换成?了,我其实是想拿到sql中的内容而已

2019-09-03 17:29

@JFinal 正遇到这个问题,收藏了