Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于注解@View 和@@Readonly的问题 #918

Closed
muei opened this issue Aug 8, 2015 · 7 comments
Closed

关于注解@View 和@@Readonly的问题 #918

muei opened this issue Aug 8, 2015 · 7 comments
Assignees
Labels
Milestone

Comments

@muei
Copy link

muei commented Aug 8, 2015

  • @View
    在实体上声明@View后,在使用Daos.createTablesInPackage(dao, "....", true);创建表的时候,如果视图不存在,会抛找不到视图的异常http://nutz.cn/fp
  • @Readonly
    字段只声明了@Readonly是不起作用的,需要声明@Column.但是声明@Column 后,在使用Daos.createTablesInPackage(dao, "....", true);建表时,该被声明的字段还是会创建
@wendal
Copy link
Member

wendal commented Aug 8, 2015

第一个已经单独开issue #917

@wendal wendal closed this as completed in 30852bc Aug 8, 2015
@wendal wendal added the Dao label Aug 8, 2015
@wendal wendal added this to the 1.b.53 milestone Aug 8, 2015
@wendal wendal self-assigned this Aug 8, 2015
@wendal
Copy link
Member

wendal commented Aug 8, 2015

解决方法: 依然要求加@column(如果其他属性加了@column的话), 但建表时忽略

@muei
Copy link
Author

muei commented Aug 10, 2015

我现在的情况是建表时候没有忽略。

public abstract class AbstractXxx{
    @Readonly
    @Column
    private int level;
        ...
}
@Table("...")
public class Xxx extends AbstractXxx{
...
}

@wendal
Copy link
Member

wendal commented Aug 10, 2015

最新的代码?整个类贴一下吧

@muei
Copy link
Author

muei commented Aug 11, 2015

父类 http://nutz.cn/g6
子类 http://nutz.cn/g7
这个level是@readonly的,Daos.createTablesInPackage(dao, "....", true);会将level建到数据库

@wendal
Copy link
Member

wendal commented Aug 11, 2015

我试了最新的代码,没问题呢

2015-08-11 14:37:02,795 org.nutz.dao.impl.sql.run.NutDaoExecutor._runStatement(NutDaoExecutor.java:313) DEBUG - CREATE TABLE regions(
id SERIAL,
name VARCHAR(50),
code VARCHAR(50),
zip_code VARCHAR(50),
p_id NUMERIC(16),
lft NUMERIC(16),
rgt NUMERIC(16),
status NUMERIC(8) DEFAULT '1',
CONSTRAINT regions_pkey PRIMARY KEY (id)
)

@muei
Copy link
Author

muei commented Aug 11, 2015

嗯 最新的是解决了!好了 现在可以用快照版了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants