我需要仅通过按一下按钮,就可以通过用户在tableView中所做的更改来更新数据库中某一列的全部信息,但是我不知道如何使用它。我考虑过使用?- s(S0,S).
S0 = ['Peter', is, father, of, 'Guido'|S] ;
S0 = ['Peter', is, father, of, 'Claudia'|S] ;
S0 = ['Peter', is, mother, of, 'Guido'|S] ;
S0 = ['Peter', is, mother, of, 'Claudia'|S] ;
S0 = ['Isabel', is, father, of, 'Guido'|S] ;
S0 = ['Isabel', is, father, of, 'Claudia'|S] ;
S0 = ['Isabel', is, mother, of, 'Guido'|S] ;
S0 = ['Isabel', is, mother, of, 'Claudia'|S].
?- s(S0,[]).
S0 = ['Peter', is, father, of, 'Guido'] ;
S0 = ['Peter', is, father, of, 'Claudia'] ;
S0 = ['Peter', is, mother, of, 'Guido'] ;
S0 = ['Peter', is, mother, of, 'Claudia'] ;
S0 = ['Isabel', is, father, of, 'Guido'] ;
S0 = ['Isabel', is, father, of, 'Claudia'] ;
S0 = ['Isabel', is, mother, of, 'Guido'] ;
S0 = ['Isabel', is, mother, of, 'Claudia'].
?- phrase(s,S,[]).
S = ['Peter', is, father, of, 'Guido'] ;
S = ['Peter', is, father, of, 'Claudia'] ;
S = ['Peter', is, mother, of, 'Guido'] ;
S = ['Peter', is, mother, of, 'Claudia'] ;
S = ['Isabel', is, father, of, 'Guido'] ;
S = ['Isabel', is, father, of, 'Claudia'] ;
S = ['Isabel', is, mother, of, 'Guido'] ;
S = ['Isabel', is, mother, of, 'Claudia'].
来遍历每个项目。如何使用?- listing.
child('Guido', ['Guido'|A], A).
child('Claudia', ['Claudia'|A], A).
verb(is, [is|A], A).
relation('father of', [father, of|A], A).
relation('mother of', [mother, of|A], A).
father('Peter', ['Peter'|A], A).
mother('Isabel', ['Isabel'|A], A).
s(A, B) :-
father(Father, A, C),
verb(Verb, C, D),
relation(Relation, D, E),
child(Child, E, B).
s(A, B) :-
mother(Father, A, C),
verb(Verb, C, D),
relation(Relation, D, E),
child(Child, E, B).
test :-
DCG=father(Father),
phrase(DCG, Input, Rest),
format('Father: ~w~n', [Father]).
true.
从表中获取信息来更新数据库?
这是我的TableController:
listview.forEach()
这是我的fxml:
forEach