Minecraft wiki entry for Crop_farming, associated text: Most common is water: Flowing water breaks crops, and produce their usual drops. This can be used to harvest crops semi-automatically, and carry the resulting items to some central location such as a hopper. A water flood does not revert farmland back into dirt.
Sticky pistons can be used to move the farmland block itself, breaking the crop without reverting the farmland to dirt. Water currents for collecting the items can be placed under the farmland rather than beside it, making this method more compact than harvesting directly with pistons. A pair of pistons, appropriately clocked, could be used to shift an entire row of farmland.
Crops are also broken when directly pushed by pistons, with the usual drops. Unfortunately, this reverts the farmland back into dirt, so that it needs to be re-tilled after every harvest, rather defeating the point of automation.