MappedStringIndexがMapperのフィールドリストに含まれていないのはなぜですか
質問
マッパーの文字列を主キーとして持っているのに、なぜ MappedStringIndexは表示されていません 経由で取得されるすべてのフィールドのリストで Mapper's allFields
方法
私のマッパーはこのようになります...
class DummyMapper extends KeyedMapper[String,DummyMapper] {
def getSingleton = DummyMapper
def primaryKeyField = dummyCode
object dummyCode extends MappedStringIndex(this,5)
{
override def writePermission_? = true
override def dbAutogenerated_? = false
override def dbNotNull_? = true
override def dbColumnName="dummy_code"
}
.....
私もそれを試してみました fieldOrder
. 。それでも結果は同じでした、 それは見せませんでした 上 DummyMapper.allFields
リスト
解決
(任意のデータタイプの)プライマリキーフィールドはです 含まれていない 返されたリストに allFileds
マッパーの方法。
必要に応じて、フィールドを個別に準備できます
何かのようなもの
var myMapperPrimaryKey=DummyMapper.primaryKeyField
var fieldList=DummyMapper.allFields.toBuffer[BaseField]
fieldList.prepend(myMapperPrimaryKey)
// Now fieldList is having the primaryKey along with other fields.
所属していません StackOverflow