actframework / act-ebean

The ebean plugin that uses latest ebeanorm and requrie java 8 support
Apache License 2.0
2 stars 1 forks source link

Dao.tableName not initialized #9

Closed greenlaw110 closed 7 years ago

greenlaw110 commented 7 years ago

When Dao is not initialized with EbeanServer directly and went into the second branch of the following code (i.e. EbeanServer loaded lazily):

    public EbeanServer ebean() {
        if (null != ebean) {
            return ebean;
        }
        synchronized (this) {
            if (null == ebean) {
                DB db = modelType().getAnnotation(DB.class);
                String dbId = null == db ? DbServiceManager.DEFAULT : db.value();
                EbeanService dbService = getService(dbId, app().dbServiceManager());
                E.NPE(dbService);
                ebean = dbService.ebean();
            }
        }
        return ebean;
    }

The Dao is not going to load tableName field, which cause trouble when run Dao.drop() API