Coder Social home page Coder Social logo

hs4j's Introduction

  • 👋 Hi, I’m @zhongl ...

hs4j's People

Contributors

killme2008 avatar zope avatar

Stargazers

 avatar

Watchers

 avatar  avatar

hs4j's Issues

when entity with a composite key is pass to update, only the first column is collect as the key

example:
@HandlerSocket(UPDATE)
boolean update(Block block) throws IOException;
Block is a self-defined type, includes some member variables, and the primary key of indicated table block_t is a composite key: id and datanode_id.
when update is executed, only the id is passed as the key, i read the code in KIT and found the reason:
Collector<String[]> com.github.zhongl.hs4j.kit.proxy.UpdateHandler.keysCollector is initialized as "new EntityCollector(KEYS)", so toStringArray(fieldValues[PRIMARY]) will generate the key, and only the (CollectStrategy.PRIMARY = 0) is used to collect the key.

ReturnType.toUserFriendlyObject(ResultSet result)对于返回的null类型<太友好了>,如果非基本类型直接设置为null会更好一点。比如对于Integer类型,如果返回值之null不要转换为0,直接设置为null会更好

ReturnType.toUserFriendlyObject(ResultSet result)对于返回的null类型<太友好了>,如果非基本类型直接设置为null会更好一点。比如对于Integer类型,如果返回值之null不要转换为0,直接设置为null会更好

准确说,这个bug来自于HS4J本身,对于Integer等类型的null值备自动设置为0了,0和null实际上是不同的结果

Support User-friendly return type

ResultItertor is friendly to Resultset but not to users.
So, primitive, string, entity or collection would be better, like as:

interface UserRepository {
  User findById(long value);
  Collection<User> findByName(String value);
  Collection<Integer> findAgesOfUserByName(String value);
}

Use customized Exception instead UndeclaredThrowableException

A UndeclaredThrowableException maybe throwed by proxy from hs4j , that is not good for using.
By declaring Exception on method, or an option can be set to ProxyFactory, a customized Exception can be throwed instead of UndeclaredThrowableException.

Support separate read and write

HandlerSocket open two port to separate read and write, so it would be better that HandlerSocketProxyFactory can support read by readable HsClient, and write by writable HsClient.

Update error with entity Object

@HandlerSocket(UPDATE)
public void update(User user);

hs4j-kit would open index with columns are all the fields of User, but UpdateHandler send the values not include id's .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.