You can have an employment contract, which might allow you to sue them if they quit before the contact period was up, but the Thirteenth Amendment outlawed slavery and involuntary servitude a long time ago.
Why would you want to keep employees in a job they hate, anyway? Working conditions at your business would have to be pretty miserable for you even to consider this.
One option is to not hire any employees. You can use an employment contract and establish "liquidated damages" if they quit before the contract expires, but no contract is fool proof and you can expect litigation if it comes down to it. Why not retain an experienced employment law attorney with HR experience and prepare a detailed employment contract. Keep your employees happy and hopefully they'll stick around.
All employees are at will in California unless there is an express contractual agreement that provides otherwise. A provision that you seek would be a term agreement, meaning an agreement where the parties agree that the employment is for a defined amount of time, like for a year, or three years, or the like. Under term agreements, the parties either define the cause that would allow an early termination, or, if no cause is defined in the contract, termination terms will be implied into the agreement from the Labor Code.
There are significant disadvantages for the employer in making employees all subject to a term agreement. Before you move any further on this thought, it would be a very prudent move for you to engage an employment attorney to discuss confidentially what you are trying to achieve and methods to achieve your ultimate goals with these employees.
Good luck to you.
If you have an employment contract stating that you will employ the individual(s) for a set period of time, you can have the contract written so that they can only quit for cause. However, that means that you can only fire them for cause. If either side breaches the contract, then you/they can sue for breach of contract.