2012-03-21 38 views
0

使用playframework,它可以使用getter作为模型列定义吗?我尝试这样做:使用getters作为模型属性

@Column(name="filename") 
    public String getFilename() { 
     return getFile().getName(); 
    } 

,但它没有工作

回答

0

我不认为这是可能的。 您可以像往常一样定义模型列,然后如果需要,可以定义特定的功能以获得某些特殊功能。

希望这会有所帮助。

玛塔

0

documentation(可悲的PDF所以它不容易挂):

@Column 
Use this if the naming convention does not match the bean property name to the database 
column or if you need to use quoted identifiers. Otherwise it is not required. 

所有的例子在整个指 “财产”(这是我采取的平均场)。没有示例显示注释方法。